Changeset 7715994 in mainline for kernel/arch
- Timestamp:
- 2010-03-13T12:17:02Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ba20a6b
- Parents:
- d0febca (diff), 2070570 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/arch
- Files:
-
- 25 edited
-
abs32le/src/abs32le.c (modified) (1 diff)
-
amd64/src/cpu/cpu.c (modified) (1 diff)
-
amd64/src/debugger.c (modified) (2 diffs)
-
amd64/src/interrupt.c (modified) (1 diff)
-
arm32/src/cpu/cpu.c (modified) (3 diffs)
-
ia32/src/cpu/cpu.c (modified) (1 diff)
-
ia32/src/interrupt.c (modified) (2 diffs)
-
ia32/src/mm/frame.c (modified) (3 diffs)
-
ia64/src/cpu/cpu.c (modified) (1 diff)
-
ia64/src/interrupt.c (modified) (6 diffs)
-
mips32/src/cpu/cpu.c (modified) (1 diff)
-
mips32/src/debugger.c (modified) (2 diffs)
-
mips32/src/exception.c (modified) (3 diffs)
-
mips32/src/mm/tlb.c (modified) (3 diffs)
-
ppc32/src/cpu/cpu.c (modified) (1 diff)
-
ppc32/src/mm/tlb.c (modified) (1 diff)
-
sparc64/include/sun4v/hypercall.h (modified) (2 diffs)
-
sparc64/include/trap/regwin.h (modified) (2 diffs)
-
sparc64/src/cpu/sun4u/cpu.c (modified) (1 diff)
-
sparc64/src/drivers/niagara.c (modified) (2 diffs)
-
sparc64/src/mm/sun4u/tlb.c (modified) (1 diff)
-
sparc64/src/mm/sun4v/tlb.c (modified) (3 diffs)
-
sparc64/src/sun4v/md.c (modified) (7 diffs)
-
sparc64/src/trap/exception.c (modified) (1 diff)
-
sparc64/src/trap/sun4v/interrupt.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/src/abs32le.c
rd0febca r7715994 114 114 } 115 115 116 void panic_printf(c har *fmt, ...)116 void panic_printf(const char *fmt, ...) 117 117 { 118 118 va_list args; -
kernel/arch/amd64/src/cpu/cpu.c
rd0febca r7715994 62 62 }; 63 63 64 static c har *vendor_str[] = {64 static const char *vendor_str[] = { 65 65 "Unknown Vendor", 66 66 "AuthenticAMD", -
kernel/arch/amd64/src/debugger.c
rd0febca r7715994 339 339 { 340 340 unsigned int i; 341 char *symbol;342 341 343 342 #ifdef __32_BITS__ … … 353 352 for (i = 0; i < BKPOINTS_MAX; i++) 354 353 if (breakpoints[i].address) { 355 symbol = symtab_fmt_name_lookup(354 const char *symbol = symtab_fmt_name_lookup( 356 355 breakpoints[i].address); 357 356 -
kernel/arch/amd64/src/interrupt.c
rd0febca r7715994 65 65 void decode_istate(int n, istate_t *istate) 66 66 { 67 char *symbol; 68 69 symbol = symtab_fmt_name_lookup(istate->rip); 70 67 const char *symbol = symtab_fmt_name_lookup(istate->rip); 68 71 69 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n", n, __func__); 72 70 printf("%%rip: %#llx (%s)\n", istate->rip, symbol); -
kernel/arch/arm32/src/cpu/cpu.c
rd0febca r7715994 43 43 44 44 /** Implementators (vendor) names */ 45 static c har *imp_data[] = {45 static const char *imp_data[] = { 46 46 "?", /* IMP_DATA_START_OFFSET */ 47 47 "ARM Ltd", /* 0x41 */ … … 60 60 61 61 /** Architecture names */ 62 static c har *arch_data[] = {62 static const char *arch_data[] = { 63 63 "?", /* 0x0 */ 64 64 "4", /* 0x1 */ … … 108 108 void cpu_print_report(cpu_t *m) 109 109 { 110 c har *vendor = imp_data[0];111 c har *architecture = arch_data[0];110 const char *vendor = imp_data[0]; 111 const char *architecture = arch_data[0]; 112 112 cpu_arch_t * cpu_arch = &m->arch; 113 113 -
kernel/arch/ia32/src/cpu/cpu.c
rd0febca r7715994 64 64 }; 65 65 66 static c har *vendor_str[] = {66 static const char *vendor_str[] = { 67 67 "Unknown Vendor", 68 68 "AMD", -
kernel/arch/ia32/src/interrupt.c
rd0febca r7715994 65 65 void decode_istate(istate_t *istate) 66 66 { 67 char *symbol; 68 69 symbol = symtab_fmt_name_lookup(istate->eip); 70 67 const char *symbol = symtab_fmt_name_lookup(istate->eip); 68 71 69 if (CPU) 72 70 printf("----------------EXCEPTION OCCURED (cpu%u)----------------\n", CPU->id); 73 71 else 74 72 printf("----------------EXCEPTION OCCURED----------------\n"); 75 73 76 74 printf("%%eip: %#lx (%s)\n", istate->eip, symbol); 77 75 printf("ERROR_WORD=%#lx\n", istate->error_word); … … 80 78 printf("stack: %#lx, %#lx, %#lx, %#lx\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]); 81 79 printf(" %#lx, %#lx, %#lx, %#lx\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]); 82 80 83 81 stack_trace_istate(istate); 84 82 } -
kernel/arch/ia32/src/mm/frame.c
rd0febca r7715994 27 27 */ 28 28 29 /** @addtogroup ia32mm 29 /** @addtogroup ia32mm 30 30 * @{ 31 31 */ … … 109 109 } 110 110 111 static c har *e820names[] = {111 static const char *e820names[] = { 112 112 "invalid", 113 113 "available", … … 122 122 { 123 123 unsigned int i; 124 c har *name;124 const char *name; 125 125 126 126 printf("Base Size Name\n"); -
kernel/arch/ia64/src/cpu/cpu.c
rd0febca r7715994 52 52 void cpu_print_report(cpu_t *m) 53 53 { 54 c har *family_str;54 const char *family_str; 55 55 char vendor[2 * sizeof(uint64_t) + 1]; 56 56 -
kernel/arch/ia64/src/interrupt.c
rd0febca r7715994 64 64 #define BUNDLE_SIZE 16 65 65 66 char *vector_names_64_bundle[VECTORS_64_BUNDLE] = {66 static const char *vector_names_64_bundle[VECTORS_64_BUNDLE] = { 67 67 "VHPT Translation vector", 68 68 "Instruction TLB vector", … … 87 87 }; 88 88 89 char *vector_names_16_bundle[VECTORS_16_BUNDLE] = {89 static const char *vector_names_16_bundle[VECTORS_16_BUNDLE] = { 90 90 "Page Not Present vector", 91 91 "Key Permission vector", … … 121 121 }; 122 122 123 static char *vector_to_string(uint16_t vector); 124 static void dump_interrupted_context(istate_t *istate); 125 126 char *vector_to_string(uint16_t vector) 123 static const char *vector_to_string(uint16_t vector) 127 124 { 128 125 ASSERT(vector <= VECTOR_MAX); … … 135 132 } 136 133 137 void dump_interrupted_context(istate_t *istate) 138 { 139 char *ifa, *iipa, *iip; 140 141 ifa = symtab_fmt_name_lookup(istate->cr_ifa); 142 iipa = symtab_fmt_name_lookup(istate->cr_iipa); 143 iip = symtab_fmt_name_lookup(istate->cr_iip); 144 134 static void dump_interrupted_context(istate_t *istate) 135 { 136 const char *ifa = symtab_fmt_name_lookup(istate->cr_ifa); 137 const char *iipa = symtab_fmt_name_lookup(istate->cr_iipa); 138 const char *iip = symtab_fmt_name_lookup(istate->cr_iip); 139 145 140 putchar('\n'); 146 141 printf("Interrupted context dump:\n"); … … 162 157 void general_exception(uint64_t vector, istate_t *istate) 163 158 { 164 c har *desc = "";165 159 const char *desc; 160 166 161 switch (istate->cr_isr.ge_code) { 167 162 case GE_ILLEGALOP: … … 187 182 break; 188 183 } 189 184 190 185 fault_if_from_uspace(istate, "General Exception (%s).", desc); 191 186 192 187 dump_interrupted_context(istate); 193 188 panic("General Exception (%s).", desc); -
kernel/arch/mips32/src/cpu/cpu.c
rd0febca r7715994 40 40 41 41 struct data_t { 42 c har *vendor;43 c har *model;42 const char *vendor; 43 const char *model; 44 44 }; 45 45 -
kernel/arch/mips32/src/debugger.c
rd0febca r7715994 253 253 { 254 254 unsigned int i; 255 char *symbol;256 255 257 256 printf("# Count Address INPROG ONESHOT FUNCCALL In symbol\n"); 258 257 printf("-- ----- ---------- ------ ------- -------- ---------\n"); 259 258 260 for (i = 0; i < BKPOINTS_MAX; i++) 259 for (i = 0; i < BKPOINTS_MAX; i++) { 261 260 if (breakpoints[i].address) { 262 symbol = symtab_fmt_name_lookup(261 const char *symbol = symtab_fmt_name_lookup( 263 262 breakpoints[i].address); 264 263 265 264 printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i, 266 265 breakpoints[i].counter, breakpoints[i].address, … … 270 269 BKPOINT_FUNCCALL) ? "true" : "false"), symbol); 271 270 } 271 } 272 272 273 return 1; 273 274 } -
kernel/arch/mips32/src/exception.c
rd0febca r7715994 49 49 #include <symtab.h> 50 50 51 static c har *exctable[] = {51 static const char *exctable[] = { 52 52 "Interrupt", 53 53 "TLB Modified", … … 74 74 static void print_regdump(istate_t *istate) 75 75 { 76 char *pcsymbol, *rasymbol; 77 78 pcsymbol = symtab_fmt_name_lookup(istate->epc); 79 rasymbol = symtab_fmt_name_lookup(istate->ra); 80 76 const char *pcsymbol = symtab_fmt_name_lookup(istate->epc); 77 const char *rasymbol = symtab_fmt_name_lookup(istate->ra); 78 81 79 printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol, 82 80 istate->ra, rasymbol, istate->sp); … … 93 91 static void reserved_instr_exception(int n, istate_t *istate) 94 92 { 95 if (*((uint32_t *) istate->epc) == 0x7c03e83b) {93 if (*((uint32_t *) istate->epc) == 0x7c03e83b) { 96 94 ASSERT(THREAD); 97 95 istate->epc += 4; 98 96 istate->v1 = istate->k1; 99 } else 97 } else 100 98 unhandled_exception(n, istate); 101 99 } -
kernel/arch/mips32/src/mm/tlb.c
rd0febca r7715994 321 321 void tlb_refill_fail(istate_t *istate) 322 322 { 323 char *symbol, *sym2; 324 325 symbol = symtab_fmt_name_lookup(istate->epc); 326 sym2 = symtab_fmt_name_lookup(istate->ra); 323 const char *symbol = symtab_fmt_name_lookup(istate->epc); 324 const char *sym2 = symtab_fmt_name_lookup(istate->ra); 327 325 328 326 fault_if_from_uspace(istate, "TLB Refill Exception on %p.", … … 335 333 void tlb_invalid_fail(istate_t *istate) 336 334 { 337 char *symbol; 338 339 symbol = symtab_fmt_name_lookup(istate->epc); 340 335 const char *symbol = symtab_fmt_name_lookup(istate->epc); 336 341 337 fault_if_from_uspace(istate, "TLB Invalid Exception on %p.", 342 338 cp0_badvaddr_read()); … … 347 343 void tlb_modified_fail(istate_t *istate) 348 344 { 349 char *symbol; 350 351 symbol = symtab_fmt_name_lookup(istate->epc); 352 345 const char *symbol = symtab_fmt_name_lookup(istate->epc); 346 353 347 fault_if_from_uspace(istate, "TLB Modified Exception on %p.", 354 348 cp0_badvaddr_read()); -
kernel/arch/ppc32/src/cpu/cpu.c
rd0febca r7715994 54 54 void cpu_print_report(cpu_t *m) 55 55 { 56 c har *name;56 const char *name; 57 57 58 58 switch (m->arch.version) { -
kernel/arch/ppc32/src/mm/tlb.c
rd0febca r7715994 114 114 static void pht_refill_fail(uintptr_t badvaddr, istate_t *istate) 115 115 { 116 char *symbol; 117 char *sym2; 118 119 symbol = symtab_fmt_name_lookup(istate->pc); 120 sym2 = symtab_fmt_name_lookup(istate->lr); 121 116 const char *symbol = symtab_fmt_name_lookup(istate->pc); 117 const char *sym2 = symtab_fmt_name_lookup(istate->lr); 118 122 119 fault_if_from_uspace(istate, 123 120 "PHT Refill Exception on %p.", badvaddr); -
kernel/arch/sparc64/include/sun4v/hypercall.h
rd0febca r7715994 75 75 76 76 /* return codes */ 77 #define EOK0 /**< Successful return */78 #define ENOCPU 1 /**< Invalid CPU id */79 #define ENORADDR2 /**< Invalid real address */80 #define ENOINTR 3 /**< Invalid interrupt id */81 #define EBADPGSZ4 /**< Invalid pagesize encoding */82 #define EBADTSB 5 /**< Invalid TSB description */83 #define HV_EINVAL 6 /**< Invalid argument */84 #define EBADTRAP7 /**< Invalid function number */85 #define EBADALIGN8 /**< Invalid address alignment */86 #define EWOULDBLOCK9 /**< Cannot complete operation without blocking */87 #define ENOACCESS10 /**< No access to specified resource */88 #define EIO11 /**< I/O Error */89 #define ECPUERROR12 /**< CPU is in error state */90 #define ENOTSUPPORTED 13 /**< Function not supported */91 #define ENOMAP 14 /**< No mapping found */92 #define ETOOMANY15 /**< Too many items specified / limit reached */93 #define ECHANNEL16 /**< Invalid LDC channel */94 #define HV_EBUSY 17 /**< Operation failed as resource is otherwise busy */77 #define HV_EOK 0 /**< Successful return */ 78 #define HV_ENOCPU 1 /**< Invalid CPU id */ 79 #define HV_ENORADDR 2 /**< Invalid real address */ 80 #define HV_ENOINTR 3 /**< Invalid interrupt id */ 81 #define HV_EBADPGSZ 4 /**< Invalid pagesize encoding */ 82 #define HV_EBADTSB 5 /**< Invalid TSB description */ 83 #define HV_EINVAL 6 /**< Invalid argument */ 84 #define HV_EBADTRAP 7 /**< Invalid function number */ 85 #define HV_EBADALIGN 8 /**< Invalid address alignment */ 86 #define HV_EWOULDBLOCK 9 /**< Cannot complete operation without blocking */ 87 #define HV_ENOACCESS 10 /**< No access to specified resource */ 88 #define HV_EIO 11 /**< I/O Error */ 89 #define HV_ECPUERROR 12 /**< CPU is in error state */ 90 #define HV_ENOTSUPPORTED 13 /**< Function not supported */ 91 #define HV_ENOMAP 14 /**< No mapping found */ 92 #define HV_ETOOMANY 15 /**< Too many items specified / limit reached */ 93 #define HV_ECHANNEL 16 /**< Invalid LDC channel */ 94 #define HV_EBUSY 17 /**< Operation failed as resource is otherwise busy */ 95 95 96 96 … … 190 190 __hypercall_fast_ret1(const uint64_t p1, const uint64_t p2, const uint64_t p3, 191 191 const uint64_t p4, const uint64_t p5, const uint64_t function_number, 192 uint64_t * constret1)192 uint64_t *ret1) 193 193 { 194 uint64_t errno = __hypercall_fast(p1, p2, p3, p4, p5, function_number); 195 if (ret1 != NULL) { 196 asm volatile ("mov %%o1, %0\n" : "=r" (*ret1)); 197 } 198 return errno; 194 register uint64_t a6 asm("o5") = function_number; 195 register uint64_t a1 asm("o0") = p1; 196 register uint64_t a2 asm("o1") = p2; 197 register uint64_t a3 asm("o2") = p3; 198 register uint64_t a4 asm("o3") = p4; 199 register uint64_t a5 asm("o4") = p5; 200 201 asm volatile ( 202 "ta %8\n" 203 : "=r" (a1), "=r" (a2) 204 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), 205 "i" (FAST_TRAP) 206 : "memory" 207 ); 208 209 if (ret1) 210 *ret1 = a2; 211 212 return a1; 199 213 } 200 214 -
kernel/arch/sparc64/include/trap/regwin.h
rd0febca r7715994 183 183 add %l0, 1, %l0 184 184 wrpr %l0, 0, %cleanwin 185 #if defined(SUN4U) 185 186 mov %r0, %l0 186 187 mov %r0, %l1 … … 199 200 mov %r0, %o6 200 201 mov %r0, %o7 202 #endif 201 203 retry 202 204 .endm 203 205 #endif /* __ASM__ */ 204 206 205 #if defined (SUN4U)207 #if defined(SUN4U) 206 208 #include <arch/trap/sun4u/regwin.h> 207 #elif defined (SUN4V)209 #elif defined(SUN4V) 208 210 #include <arch/trap/sun4v/regwin.h> 209 211 #endif -
kernel/arch/sparc64/src/cpu/sun4u/cpu.c
rd0febca r7715994 129 129 void cpu_print_report(cpu_t *m) 130 130 { 131 char *manuf, *impl; 131 const char *manuf; 132 const char *impl; 132 133 133 134 switch (m->arch.ver.manuf) { -
kernel/arch/sparc64/src/drivers/niagara.c
rd0febca r7715994 104 104 static inline void do_putchar(const char c) { 105 105 /* repeat until the buffer is non-full */ 106 while (__hypercall_fast1(CONS_PUTCHAR, c) == EWOULDBLOCK)106 while (__hypercall_fast1(CONS_PUTCHAR, c) == HV_EWOULDBLOCK) 107 107 ; 108 108 } … … 139 139 140 140 /* read character from keyboard, send it to upper layers of HelenOS */ 141 if (__hypercall_fast_ret1(0, 0, 0, 0, 0, CONS_GETCHAR, &c) == EOK) {141 if (__hypercall_fast_ret1(0, 0, 0, 0, 0, CONS_GETCHAR, &c) == HV_EOK) { 142 142 if (!silent) { 143 143 /* kconsole active, send the character to kernel */ -
kernel/arch/sparc64/src/mm/sun4u/tlb.c
rd0febca r7715994 64 64 tlb_tag_access_reg_t, const char *); 65 65 66 c har *context_encoding[] = {66 const char *context_encoding[] = { 67 67 "Primary", 68 68 "Secondary", -
kernel/arch/sparc64/src/mm/sun4v/tlb.c
rd0febca r7715994 89 89 * field of the MMU fault status area is i. 90 90 */ 91 char *fault_types[] = {91 static const char *fault_types[] = { 92 92 "unknown", 93 93 "fast miss", … … 107 107 "invalid page size" 108 108 }; 109 110 109 111 110 /** Array of MMU fault status areas. */ … … 406 405 uint64_t errno = __hypercall_fast3(MMU_DEMAP_ALL, 0, 0, 407 406 MMU_FLAG_DTLB | MMU_FLAG_ITLB); 408 if (errno != EOK) {407 if (errno != HV_EOK) { 409 408 panic("Error code = %d.\n", errno); 410 409 } -
kernel/arch/sparc64/src/sun4v/md.c
rd0febca r7715994 104 104 static md_element_t *get_element(element_idx_t idx) 105 105 { 106 return (md_element_t *) ( 107 mach_desc +sizeof(md_header_t) + idx * sizeof(md_element_t));106 return (md_element_t *) (mach_desc + 107 sizeof(md_header_t) + idx * sizeof(md_element_t)); 108 108 } 109 109 … … 114 114 uintptr_t name_offset = get_element(idx)->name_offset; 115 115 return (char *) mach_desc + sizeof(md_header_t) + 116 md_header->node_blk_sz + name_offset;116 md_header->node_blk_sz + name_offset; 117 117 } 118 118 … … 137 137 md_element_t *element = get_element(idx); 138 138 if (element->tag == PROP_VAL && 139 str_cmp(key, get_element_name(idx)) == 0) {139 str_cmp(key, get_element_name(idx)) == 0) { 140 140 *result = element->d.val; 141 141 return true; … … 161 161 md_element_t *element = get_element(idx); 162 162 if (element->tag == PROP_DATA && 163 str_cmp(key, get_element_name(idx)) == 0) {163 str_cmp(key, get_element_name(idx)) == 0) { 164 164 *result = (char *) mach_desc + sizeof(md_header_t) + 165 md_header->node_blk_sz + md_header->name_blk_sz +166 element->d.y.data_offset;165 md_header->node_blk_sz + md_header->name_blk_sz + 166 element->d.y.data_offset; 167 167 return true; 168 168 } … … 186 186 md_element_t *element = get_element(*it); 187 187 if (element->tag == PROP_ARC && 188 str_cmp("fwd", get_element_name(*it)) == 0) {188 str_cmp("fwd", get_element_name(*it)) == 0) { 189 189 return true; 190 190 } … … 289 289 290 290 if (element->tag == NODE && 291 str_cmp(name, get_element_name(*node)) == 0) {291 str_cmp(name, get_element_name(*node)) == 0) { 292 292 return true; 293 293 } … … 306 306 { 307 307 uint64_t retval = __hypercall_fast2(MACH_DESC, KA2PA(mach_desc), 308 MD_MAX_SIZE);308 MD_MAX_SIZE); 309 309 310 310 retval = retval; 311 if (retval != EOK) {311 if (retval != HV_EOK) { 312 312 printf("Could not retrieve machine description, error = %d.\n", 313 retval);313 retval); 314 314 } 315 315 } -
kernel/arch/sparc64/src/trap/exception.c
rd0febca r7715994 46 46 void dump_istate(istate_t *istate) 47 47 { 48 char *tpcs, *tnpcs; 49 50 tpcs = symtab_fmt_name_lookup(istate->tpc); 51 tnpcs = symtab_fmt_name_lookup(istate->tnpc); 52 48 const char *tpcs = symtab_fmt_name_lookup(istate->tpc); 49 const char *tnpcs = symtab_fmt_name_lookup(istate->tnpc); 50 53 51 printf("TSTATE=%#" PRIx64 "\n", istate->tstate); 54 52 printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, tpcs); -
kernel/arch/sparc64/src/trap/sun4v/interrupt.c
rd0febca r7715994 86 86 CPU_MONDO_QUEUE_ID, 87 87 KA2PA(cpu_mondo_queues[CPU->id]), 88 CPU_MONDO_NENTRIES) != EOK)88 CPU_MONDO_NENTRIES) != HV_EOK) 89 89 panic("Initializing mondo queue failed on CPU %d.\n", 90 90 CPU->arch.id);
Note:
See TracChangeset
for help on using the changeset viewer.
