Changeset 65737d4 in mainline
- Timestamp:
- 2010-01-13T20:39:42Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 711e1f32
- Parents:
- 9245413 (diff), fd608dc (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. - Files:
-
- 16 added
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
r9245413 r65737d4 26 26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 # 28 29 -include ../Makefile.config 28 30 29 31 TMP = distroot -
boot/arch/ia64/loader/Makefile
r9245413 r65737d4 29 29 30 30 include Makefile.common 31 include ../../../../Makefile.config 31 32 32 33 .PHONY: all clean -
boot/arch/ia64/loader/Makefile.common
r9245413 r65737d4 31 31 # 32 32 33 include ../../../../Makefile.config 33 34 include ../../../Makefile.common 34 35 … … 44 45 KERNELDIR = ../../../../kernel 45 46 USPACEDIR = ../../../../uspace 47 48 ifeq ($(MACHINE),i460GX) 49 RD_SRVS += \ 50 $(USPACEDIR)/srv/hw/char/i8042/i8042 \ 51 $(USPACEDIR)/srv/hid/c_mouse/c_mouse 52 endif -
kernel/Makefile.build
r9245413 r65737d4 186 186 generic/src/ddi/device.c \ 187 187 generic/src/debug/symtab.c \ 188 generic/src/debug/stacktrace.c \ 188 189 generic/src/interrupt/interrupt.c \ 189 190 generic/src/main/main.c \ -
kernel/arch/amd64/Makefile.inc
r9245413 r65737d4 38 38 39 39 FPU_NO_CFLAGS = -mno-sse -mno-sse2 40 CMN1 = -m64 -mcmodel=kernel -mno-red-zone -fno-unwind-tables 40 CMN1 = -m64 -mcmodel=kernel -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer 41 41 GCC_CFLAGS += $(CMN1) 42 42 ICC_CFLAGS += $(CMN1) … … 60 60 arch/$(KARCH)/src/boot/boot.S \ 61 61 arch/$(KARCH)/src/boot/memmap.c \ 62 arch/$(KARCH)/src/debug/stacktrace.c \ 63 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 62 64 arch/$(KARCH)/src/pm.c \ 63 65 arch/$(KARCH)/src/context.S \ -
kernel/arch/amd64/_link.ld.in
r9245413 r65737d4 44 44 *(COMMON); /* global variables */ 45 45 46 . = ALIGN(8); 46 47 symbol_table = .; 47 48 *(symtab.*); /* Symbol table, must be LAST symbol!*/ -
kernel/arch/amd64/include/context.h
r9245413 r65737d4 46 46 #define SP_DELTA 16 47 47 48 #define context_set(c, _pc, stack, size) \ 49 do { \ 50 (c)->pc = (uintptr_t) (_pc); \ 51 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \ 52 (c)->rbp = 0; \ 53 } while (0) 54 48 55 #endif /* KERNEL */ 49 56 -
kernel/arch/amd64/include/interrupt.h
r9245413 r65737d4 70 70 71 71 /** This is passed to interrupt handlers */ 72 typedef struct {72 typedef struct istate { 73 73 uint64_t rax; 74 74 uint64_t rcx; … … 80 80 uint64_t r10; 81 81 uint64_t r11; 82 uint64_t rbp; 82 83 uint64_t error_word; 83 84 uint64_t rip; … … 101 102 return istate->rip; 102 103 } 104 static inline unative_t istate_get_fp(istate_t *istate) 105 { 106 return istate->rbp; 107 } 103 108 104 109 extern void (* disable_irqs_function)(uint16_t irqmask); -
kernel/arch/amd64/src/asm_utils.S
r9245413 r65737d4 27 27 # 28 28 29 #define IREGISTER_SPACE 7229 #define IREGISTER_SPACE 80 30 30 31 31 #define IOFFSET_RAX 0x0 … … 38 38 #define IOFFSET_R10 0x38 39 39 #define IOFFSET_R11 0x40 40 #define IOFFSET_RBP 0x48 40 41 41 42 # Mask for interrupts 0 - 31 (bits 0 - 31) where 0 means that int has no error word … … 179 180 movq %r10, IOFFSET_R10(%rsp) 180 181 movq %r11, IOFFSET_R11(%rsp) 182 movq %rbp, IOFFSET_RBP(%rsp) 181 183 .endm 182 184 … … 191 193 movq IOFFSET_R10(%rsp), %r10 192 194 movq IOFFSET_R11(%rsp), %r11 195 movq IOFFSET_RBP(%rsp), %rbp 193 196 .endm 194 197 … … 235 238 cld 236 239 240 # Stop stack traces here 241 xorq %rbp, %rbp 242 237 243 movq $(\i), %rdi # %rdi - first parameter 238 244 movq %rsp, %rsi # %rsi - pointer to istate -
kernel/arch/amd64/src/boot/boot.S
r9245413 r65737d4 174 174 call arch_pre_main 175 175 176 # create the first stack frame 177 pushq $0 178 movq %rsp, %rbp 179 176 180 call main_bsp 177 181 -
kernel/arch/amd64/src/interrupt.c
r9245413 r65737d4 53 53 #include <ddi/irq.h> 54 54 #include <symtab.h> 55 #include <stacktrace.h> 55 56 56 57 /* … … 80 81 istate->r10, istate->r11); 81 82 printf("%%rsp=%#llx\n", &istate->stack[0]); 83 84 stack_trace_istate(istate); 82 85 } 83 86 -
kernel/arch/amd64/src/mm/page.c
r9245413 r65737d4 203 203 { 204 204 if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) 205 panic("Unable to map physical memory %p (%d bytes).", physaddr, size) 205 panic("Unable to map physical memory %p (%d bytes).", physaddr, 206 size); 206 207 207 208 uintptr_t virtaddr = PA2KA(last_frame); -
kernel/arch/amd64/src/smp/ap.S
r9245413 r65737d4 99 99 start64: 100 100 movq (ctx), %rsp 101 pushq $0 102 movq %rsp, %rbp 101 103 call main_ap - AP_BOOT_OFFSET + BOOT_OFFSET # never returns 102 104 -
kernel/arch/arm32/Makefile.inc
r9245413 r65737d4 38 38 ATSIGN = % 39 39 40 GCC_CFLAGS += -fno-zero-initialized-in-bss 40 GCC_CFLAGS += -fno-zero-initialized-in-bss -mapcs-frame 41 41 42 42 BITS = 32 … … 57 57 arch/$(KARCH)/src/exception.c \ 58 58 arch/$(KARCH)/src/userspace.c \ 59 arch/$(KARCH)/src/debug/stacktrace.c \ 60 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 59 61 arch/$(KARCH)/src/mm/as.c \ 60 62 arch/$(KARCH)/src/mm/frame.c \ -
kernel/arch/arm32/_link.ld.in
r9245413 r65737d4 34 34 *(.sdata); 35 35 *(.reginfo); 36 . = ALIGN(8); 36 37 symbol_table = .; 37 38 *(symtab.*); -
kernel/arch/arm32/include/context.h
r9245413 r65737d4 43 43 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 44 44 45 #define context_set(c, _pc, stack, size) \ 46 do { \ 47 (c)->pc = (uintptr_t) (_pc); \ 48 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \ 49 (c)->fp = 0; \ 50 } while (0) 51 45 52 #ifndef __ASM__ 46 53 … … 62 69 uint32_t r9; 63 70 uint32_t r10; 64 uint32_t r11;71 uint32_t fp; /* r11 */ 65 72 66 73 ipl_t ipl; -
kernel/arch/arm32/include/exception.h
r9245413 r65737d4 86 86 87 87 /** Struct representing CPU state saved when an exception occurs. */ 88 typedef struct {88 typedef struct istate { 89 89 uint32_t spsr; 90 90 uint32_t sp; … … 102 102 uint32_t r9; 103 103 uint32_t r10; 104 uint32_t r11;104 uint32_t fp; 105 105 uint32_t r12; 106 106 … … 133 133 } 134 134 135 static inline unative_t istate_get_fp(istate_t *istate) 136 { 137 return istate->fp; 138 } 139 135 140 136 141 extern void install_exception_handlers(void); -
kernel/arch/arm32/src/exc_handler.S
r9245413 r65737d4 123 123 stmfd r13!, {r2} 124 124 2: 125 # Stop stack traces here 126 mov fp, #0 125 127 .endm 126 128 -
kernel/arch/arm32/src/exception.c
r9245413 r65737d4 42 42 #include <print.h> 43 43 #include <syscall/syscall.h> 44 #include <stacktrace.h> 44 45 45 46 #ifdef MACHINE_testarm … … 183 184 printf(" r4: %x r5: %x r6: %x r7: %x\n", 184 185 istate->r4, istate->r5, istate->r6, istate->r7); 185 printf(" r8: %x r8: %x r10: %x r11: %x\n",186 istate->r8, istate->r9, istate->r10, istate-> r11);186 printf(" r8: %x r8: %x r10: %x fp: %x\n", 187 istate->r8, istate->r9, istate->r10, istate->fp); 187 188 printf(" r12: %x sp: %x lr: %x spsr: %x\n", 188 189 istate->r12, istate->sp, istate->lr, istate->spsr); 189 190 190 191 printf(" pc: %x\n", istate->pc); 192 193 stack_trace_istate(istate); 191 194 } 192 195 -
kernel/arch/arm32/src/mm/page.c
r9245413 r65737d4 88 88 KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) { 89 89 panic("Unable to map physical memory %p (%d bytes).", 90 physaddr, size) 90 physaddr, size); 91 91 } 92 92 -
kernel/arch/arm32/src/mm/page_fault.c
r9245413 r65737d4 181 181 182 182 if (ret == AS_PF_FAULT) { 183 fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr); 183 184 print_istate(istate); 184 185 printf("page fault - pc: %x, va: %x, status: %x(%x), " … … 186 187 access); 187 188 188 fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr);189 189 panic("Page fault."); 190 190 } -
kernel/arch/arm32/src/start.S
r9245413 r65737d4 69 69 bl arch_pre_main 70 70 71 # 72 # Create the first stack frame. 73 # 74 mov fp, #0 75 mov ip, sp 76 push {fp, ip, lr, pc} 77 sub fp, ip, #4 78 71 79 bl main_bsp 72 80 -
kernel/arch/ia32/Makefile.inc
r9245413 r65737d4 78 78 arch/$(KARCH)/src/context.S \ 79 79 arch/$(KARCH)/src/debug/panic.s \ 80 arch/$(KARCH)/src/debug/stacktrace.c \ 81 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 80 82 arch/$(KARCH)/src/delay.s \ 81 83 arch/$(KARCH)/src/asm.S \ -
kernel/arch/ia32/_link.ld.in
r9245413 r65737d4 42 42 hardcoded_unmapped_kdata_size = .; 43 43 LONG(unmapped_kdata_end - unmapped_kdata_start); 44 . = ALIGN(8); 44 45 symbol_table = .; 45 46 *(symtab.*); /* Symbol table, must be LAST symbol! */ -
kernel/arch/ia32/include/context.h
r9245413 r65737d4 49 49 #define SP_DELTA (8 + STACK_ITEM_SIZE) 50 50 51 #define context_set(c, _pc, stack, size) \ 52 do { \ 53 (c)->pc = (uintptr_t) (_pc); \ 54 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \ 55 (c)->ebp = 0; \ 56 } while (0) 57 51 58 #endif /* KERNEL */ 52 59 -
kernel/arch/ia32/include/interrupt.h
r9245413 r65737d4 69 69 #define VECTOR_DEBUG_IPI (IVT_FREEBASE + 2) 70 70 71 typedef struct {71 typedef struct istate { 72 72 uint32_t eax; 73 73 uint32_t ecx; 74 74 uint32_t edx; 75 uint32_t ebp; 75 76 76 77 uint32_t gs; … … 102 103 } 103 104 105 static inline unative_t istate_get_fp(istate_t *istate) 106 { 107 return istate->ebp; 108 } 109 104 110 extern void (* disable_irqs_function)(uint16_t irqmask); 105 111 extern void (* enable_irqs_function)(uint16_t irqmask); -
kernel/arch/ia32/src/asm.S
r9245413 r65737d4 269 269 pushl %gs 270 270 271 pushl %ebp 271 272 pushl %edx 272 273 pushl %ecx … … 278 279 movw %ax, %es 279 280 280 cld 281 # stop stack traces here 282 xorl %ebp, %ebp 281 283 282 284 pushl %esp # *istate … … 290 292 popl %ecx 291 293 popl %edx 294 popl %ebp 292 295 293 296 popl %gs -
kernel/arch/ia32/src/boot/boot.S
r9245413 r65737d4 94 94 pushl grub_eax 95 95 call arch_pre_main 96 97 # Create the first stack frame 98 pushl $0 99 movl %esp, %ebp 96 100 97 101 call main_bsp -
kernel/arch/ia32/src/interrupt.c
r9245413 r65737d4 53 53 #include <ddi/irq.h> 54 54 #include <symtab.h> 55 #include <stacktrace.h> 55 56 56 57 /* … … 79 80 printf("stack: %#lx, %#lx, %#lx, %#lx\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]); 80 81 printf(" %#lx, %#lx, %#lx, %#lx\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]); 82 83 stack_trace_istate(istate); 81 84 } 82 85 -
kernel/arch/ia32/src/mm/page.c
r9245413 r65737d4 80 80 { 81 81 if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) 82 panic("Unable to map physical memory %p (%d bytes).", physaddr, size) 82 panic("Unable to map physical memory %p (%d bytes).", physaddr, size); 83 83 84 84 uintptr_t virtaddr = PA2KA(last_frame); -
kernel/arch/ia32/src/smp/ap.S
r9245413 r65737d4 78 78 addl $0x80000000, %esp # PA2KA(ctx.sp) 79 79 80 pushl $0 # create the first stack frame 81 movl %esp, %ebp 82 80 83 jmpl $KTEXT, $main_ap 81 84 -
kernel/arch/ia64/Makefile.inc
r9245413 r65737d4 53 53 arch/$(KARCH)/src/context.S \ 54 54 arch/$(KARCH)/src/cpu/cpu.c \ 55 arch/$(KARCH)/src/debug/stacktrace.c \ 56 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 55 57 arch/$(KARCH)/src/ivt.S \ 56 58 arch/$(KARCH)/src/interrupt.c \ -
kernel/arch/ia64/_link.ld.in
r9245413 r65737d4 37 37 *(COMMON); 38 38 39 . = ALIGN(8); 39 40 symbol_table = .; 40 41 *(symtab.*); /* Symbol table, must be LAST symbol!*/ -
kernel/arch/ia64/include/interrupt.h
r9245413 r65737d4 72 72 #define EOI 0 /**< The actual value doesn't matter. */ 73 73 74 typedef struct {74 typedef struct istate { 75 75 uint128_t f2; 76 76 uint128_t f3; … … 143 143 } 144 144 145 static inline unative_t istate_get_fp(istate_t *istate) 146 { 147 return 0; /* FIXME */ 148 } 149 145 150 static inline int istate_from_uspace(istate_t *istate) 146 151 { -
kernel/arch/ia64/include/mm/asid.h
r9245413 r65737d4 50 50 * but those extra bits are not used by the kernel. 51 51 */ 52 #define RIDS_PER_ASID 752 #define RIDS_PER_ASID 8 53 53 54 54 #define RID_MAX 262143 /* 2^18 - 1 */ 55 #define RID_KERNEL 0 56 #define RID_INVALID 1 55 #define RID_KERNEL7 7 57 56 58 #define ASID2RID(asid, vrn) (((asid)>RIDS_PER_ASID)?(((asid)*RIDS_PER_ASID)+(vrn)):(asid))59 #define RID2ASID(rid) ((rid)/RIDS_PER_ASID)57 #define ASID2RID(asid, vrn) \ 58 ((asid) * RIDS_PER_ASID + (vrn)) 60 59 61 #define ASID_MAX_ARCH (RID_MAX/RIDS_PER_ASID) 60 #define RID2ASID(rid) \ 61 ((rid) / RIDS_PER_ASID) 62 63 #define ASID_MAX_ARCH (RID_MAX / RIDS_PER_ASID) 62 64 63 65 #endif -
kernel/arch/ia64/src/ia64.c
r9245413 r65737d4 203 203 } 204 204 205 sysinfo_set_item_val(" kbd", NULL, true);206 sysinfo_set_item_val(" kbd.inr", NULL, IRQ_KBD);207 sysinfo_set_item_val(" kbd.type", NULL, KBD_LEGACY);208 sysinfo_set_item_val(" kbd.address.physical", NULL,205 sysinfo_set_item_val("i8042", NULL, true); 206 sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD); 207 sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE); 208 sysinfo_set_item_val("i8042.address.physical", NULL, 209 209 (uintptr_t) I8042_BASE); 210 sysinfo_set_item_val(" kbd.address.kernel", NULL,210 sysinfo_set_item_val("i8042.address.kernel", NULL, 211 211 (uintptr_t) I8042_BASE); 212 212 #endif -
kernel/arch/ia64/src/mm/page.c
r9245413 r65737d4 71 71 72 72 /* 73 * First set up kernel region register. 74 * This is redundant (see start.S) but we keep it here just for sure. 75 */ 76 rr.word = rr_read(VRN_KERNEL); 77 rr.map.ve = 0; /* disable VHPT walker */ 78 rr.map.ps = PAGE_WIDTH; 79 rr.map.rid = ASID2RID(ASID_KERNEL, VRN_KERNEL); 80 rr_write(VRN_KERNEL, rr.word); 81 srlz_i(); 82 srlz_d(); 83 84 /* 85 * And setup the rest of region register. 73 * Set up kernel region registers. 74 * VRN_KERNEL has already been set in start.S. 75 * For paranoia reasons, we set it again. 86 76 */ 87 77 for(i = 0; i < REGION_REGISTERS; i++) { 88 /* skip kernel rr */89 if (i == VRN_KERNEL)90 continue;91 92 78 rr.word = rr_read(i); 93 79 rr.map.ve = 0; /* disable VHPT walker */ 94 rr.map.rid = RID_KERNEL;80 rr.map.rid = ASID2RID(ASID_KERNEL, i); 95 81 rr.map.ps = PAGE_WIDTH; 96 82 rr_write(i, rr.word); -
kernel/arch/ia64/src/start.S
r9245413 r65737d4 74 74 movl r10 = (RR_MASK) 75 75 and r9 = r10, r9 76 movl r10 = (( RID_KERNEL<< RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))76 movl r10 = (((RID_KERNEL7) << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT)) 77 77 or r9 = r10, r9 78 78 -
kernel/arch/mips32/Makefile.inc
r9245413 r65737d4 70 70 arch/$(KARCH)/src/debugger.c \ 71 71 arch/$(KARCH)/src/cpu/cpu.c \ 72 arch/$(KARCH)/src/debug/stacktrace.c \ 73 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 72 74 arch/$(KARCH)/src/mm/frame.c \ 73 75 arch/$(KARCH)/src/mm/page.c \ -
kernel/arch/mips32/_link.ld.in
r9245413 r65737d4 38 38 *(.bss); /* uninitialized static variables */ 39 39 *(COMMON); /* global variables */ 40 . = ALIGN(8); 40 41 symbol_table = .; 41 42 *(symtab.*); -
kernel/arch/mips32/include/exception.h
r9245413 r65737d4 58 58 #define EXC_VCED 31 59 59 60 typedef struct {60 typedef struct istate { 61 61 uint32_t at; 62 62 uint32_t v0; … … 102 102 return istate->epc; 103 103 } 104 static inline unative_t istate_get_fp(istate_t *istate) 105 { 106 return 0; /* FIXME */ 107 } 104 108 105 109 extern void exception(istate_t *istate); -
kernel/arch/ppc32/Makefile.inc
r9245413 r65737d4 46 46 arch/$(KARCH)/src/context.S \ 47 47 arch/$(KARCH)/src/debug/panic.s \ 48 arch/$(KARCH)/src/debug/stacktrace.c \ 49 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 48 50 arch/$(KARCH)/src/fpu_context.S \ 49 51 arch/$(KARCH)/src/boot/boot.S \ -
kernel/arch/ppc32/_link.ld.in
r9245413 r65737d4 51 51 *(COMMON); /* global variables */ 52 52 53 . = ALIGN(8); 53 54 symbol_table = .; 54 55 *(symtab.*); /* Symbol table, must be LAST symbol!*/ -
kernel/arch/ppc32/include/exception.h
r9245413 r65737d4 39 39 #include <arch/regutils.h> 40 40 41 typedef struct {41 typedef struct istate { 42 42 uint32_t r0; 43 43 uint32_t r2; … … 98 98 } 99 99 100 static inline unative_t istate_get_fp(istate_t *istate) 101 { 102 return istate->sp; 103 } 104 100 105 #endif 101 106 -
kernel/arch/ppc32/src/mm/page.c
r9245413 r65737d4 51 51 KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) 52 52 panic("Unable to map physical memory %p (%" PRIs " bytes).", 53 physaddr, size) 53 physaddr, size); 54 54 55 55 uintptr_t virtaddr = PA2KA(last_frame); -
kernel/arch/sparc64/Makefile.inc
r9245413 r65737d4 54 54 ARCH_SOURCES = \ 55 55 arch/$(KARCH)/src/cpu/cpu.c \ 56 arch/$(KARCH)/src/debug/stacktrace.c \ 57 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 56 58 arch/$(KARCH)/src/asm.S \ 57 59 arch/$(KARCH)/src/panic.S \ -
kernel/arch/sparc64/_link.ld.in
r9245413 r65737d4 36 36 *(COMMON); /* global variables */ 37 37 38 . = ALIGN(8); 38 39 symbol_table = .; 39 40 *(symtab.*); /* Symbol table, must be LAST symbol!*/ -
kernel/arch/sparc64/include/interrupt.h
r9245413 r65737d4 50 50 }; 51 51 52 typedef struct {52 typedef struct istate { 53 53 uint64_t tnpc; 54 54 uint64_t tpc; … … 71 71 } 72 72 73 static inline unative_t istate_get_fp(istate_t *istate) 74 { 75 return 0; /* TODO */ 76 } 77 73 78 #endif 74 79 -
kernel/generic/include/debug.h
r9245413 r65737d4 75 75 # define LOG(format, ...) \ 76 76 printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \ 77 77 __LINE__, ##__VA_ARGS__); 78 78 #else 79 79 # define LOG(format, ...) … … 92 92 { \ 93 93 printf("%s() at %s:%u: " #fnc "\n", __func__, __FILE__, \ 94 __LINE__); \94 __LINE__); \ 95 95 fnc; \ 96 96 } -
kernel/generic/include/interrupt.h
r9245413 r65737d4 42 42 #include <arch.h> 43 43 #include <ddi/irq.h> 44 #include <stacktrace.h> 44 45 45 46 typedef void (* iroutine)(int n, istate_t *istate); … … 49 50 if (istate_from_uspace(istate)) { \ 50 51 task_t *task = TASK; \ 51 printf("Task %s (%" PRIu64 ") killed due to an exception at %p: ", task->name, task->taskid, istate_get_pc(istate)); \ 52 printf(fmt "\n", ##__VA_ARGS__); \ 52 printf("Task %s (%" PRIu64 ") killed due to an exception at " \ 53 "program counter %p.\n", task->name, task->taskid, istate_get_pc(istate)); \ 54 stack_trace_istate(istate); \ 55 printf("Kill message: " fmt "\n", ##__VA_ARGS__); \ 53 56 task_kill(task->taskid); \ 54 57 thread_exit(); \ -
kernel/generic/include/panic.h
r9245413 r65737d4 36 36 #define KERN_PANIC_H_ 37 37 38 #include <stacktrace.h> 39 #include <print.h> 40 38 41 #ifdef CONFIG_DEBUG 39 42 # define panic(format, ...) \ 40 panic_printf("Kernel panic in %s() at %s:%u: " format "\n", \ 41 __func__, __FILE__, __LINE__, ##__VA_ARGS__); 43 do { \ 44 printf("Kernel panic in %s() at %s:%u.\n", \ 45 __func__, __FILE__, __LINE__); \ 46 stack_trace(); \ 47 panic_printf("Panic message: " format "\n", \ 48 ##__VA_ARGS__);\ 49 } while (0) 42 50 #else 43 51 # define panic(format, ...) \ -
kernel/generic/include/symtab.h
r9245413 r65737d4 45 45 }; 46 46 47 extern int symtab_name_lookup(u native_t addr, char **name);48 extern char *symtab_fmt_name_lookup(u native_t addr);49 extern int symtab_addr_lookup(const char * name, uintptr_t *addr);50 extern void symtab_print_search(const char * name);51 extern int symtab_compl(char * input, size_t size);47 extern int symtab_name_lookup(uintptr_t, char **, uintptr_t *); 48 extern char *symtab_fmt_name_lookup(uintptr_t); 49 extern int symtab_addr_lookup(const char *, uintptr_t *); 50 extern void symtab_print_search(const char *); 51 extern int symtab_compl(char *, size_t); 52 52 53 53 #ifdef CONFIG_SYMTAB -
kernel/generic/src/debug/symtab.c
r9245413 r65737d4 46 46 /** Get name of a symbol that seems most likely to correspond to address. 47 47 * 48 * @param addr Address. 49 * @param name Place to store pointer to the symbol name. 48 * @param addr Address. 49 * @param name Place to store pointer to the symbol name. 50 * @param offset Place to store offset from the symbol address. 50 51 * 51 52 * @return Zero on success or negative error code, ENOENT if not found, … … 53 54 * 54 55 */ 55 int symtab_name_lookup(u native_t addr, char **name)56 int symtab_name_lookup(uintptr_t addr, char **name, uintptr_t *offset) 56 57 { 57 58 #ifdef CONFIG_SYMTAB … … 65 66 if (addr >= uint64_t_le2host(symbol_table[i - 1].address_le)) { 66 67 *name = symbol_table[i - 1].symbol_name; 68 if (offset) 69 *offset = addr - 70 uint64_t_le2host(symbol_table[i - 1].address_le); 67 71 return EOK; 68 72 } … … 88 92 * 89 93 */ 90 char *symtab_fmt_name_lookup(u native_t addr)94 char *symtab_fmt_name_lookup(uintptr_t addr) 91 95 { 92 96 char *name; 93 int rc = symtab_name_lookup(addr, &name );97 int rc = symtab_name_lookup(addr, &name, NULL); 94 98 95 99 switch (rc) { -
tools/mkfat.py
r9245413 r65737d4 354 354 return 355 355 356 fat16_clusters = 8192356 fat16_clusters = 4096 357 357 358 358 sector_size = 512 -
uspace/lib/libc/arch/mips32eb/Makefile.inc
r9245413 r65737d4 35 35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ 36 36 arch/$(UARCH)/src/fibril.S \ 37 arch/$(UARCH)/src/tls.c 37 arch/$(UARCH)/src/tls.c \ 38 arch/$(UARCH)/src/stacktrace.S 38 39 39 40 GCC_CFLAGS += -mips3 -
uspace/lib/libc/generic/io/io.c
r9245413 r65737d4 595 595 } 596 596 597 void clearerr(FILE *stream) 598 { 599 stream->eof = false; 600 stream->error = false; 601 } 602 597 603 int fphone(FILE *stream) 598 604 { -
uspace/lib/libc/generic/stacktrace.c
r9245413 r65737d4 39 39 void stack_trace_fp_pc(uintptr_t fp, uintptr_t pc) 40 40 { 41 printf("Printing stack trace:\n");42 printf("=====================\n");43 41 while (frame_pointer_validate(fp)) { 44 42 printf("%p: %p()\n", fp, pc); … … 46 44 fp = frame_pointer_prev(fp); 47 45 } 48 printf("=====================\n");49 46 } 50 47 -
uspace/lib/libc/include/assert.h
r9245413 r65737d4 51 51 52 52 #ifndef NDEBUG 53 # define assert(expr) if (!(expr)) { printf("Assertion failed (%s) at file '%s', line %d.\n", #expr, __FILE__, __LINE__); abort();} 53 # define assert(expr) \ 54 do { \ 55 if (!(expr)) { \ 56 printf("Assertion failed (%s) at file '%s', " \ 57 "line %d.\n", #expr, __FILE__, __LINE__); \ 58 abort(); \ 59 } \ 60 } while (0) 54 61 #else 55 62 # define assert(expr) -
uspace/srv/bd/file_bd/file_bd.c
r9245413 r65737d4 205 205 { 206 206 size_t n_rd; 207 int rc; 207 208 208 209 fibril_mutex_lock(&dev_lock); 209 210 210 fseek(img, ba * block_size, SEEK_SET); 211 clearerr(img); 212 rc = fseek(img, ba * block_size, SEEK_SET); 213 if (rc < 0) { 214 fibril_mutex_unlock(&dev_lock); 215 return EIO; 216 } 217 211 218 n_rd = fread(buf, block_size, cnt, img); 212 219 … … 228 235 { 229 236 size_t n_wr; 237 int rc; 230 238 231 239 fibril_mutex_lock(&dev_lock); 232 240 233 fseek(img, ba * block_size, SEEK_SET); 241 clearerr(img); 242 rc = fseek(img, ba * block_size, SEEK_SET); 243 if (rc < 0) { 244 fibril_mutex_unlock(&dev_lock); 245 return EIO; 246 } 247 234 248 n_wr = fwrite(buf, block_size, cnt, img); 235 249 … … 237 251 fibril_mutex_unlock(&dev_lock); 238 252 return EIO; /* Write error */ 253 } 254 255 if (fflush(img) != 0) { 256 fibril_mutex_unlock(&dev_lock); 257 return EIO; 239 258 } 240 259
Note:
See TracChangeset
for help on using the changeset viewer.