Changeset 40d4c1d in mainline for kernel/arch/amd64/src


Ignore:
Timestamp:
2010-01-08T22:13:34Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
234e39e
Parents:
eb0bc90 (diff), 6d7f9bfe (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.
Message:

Merge the stack tracing branch.

The merge includes generic and amd64 and ia32 support for kernel stack traces.
The kernel will now print a stack trace for each killed task and also for
each bad trap and panic. The rest of the architectures have dummy support,
i.e. they compile and run, but the kernel cannot print the stack trace.

Location:
kernel/arch/amd64/src
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/asm_utils.S

    reb0bc90 r40d4c1d  
    2727#
    2828
    29 #define IREGISTER_SPACE 72
     29#define IREGISTER_SPACE 80
    3030
    3131#define IOFFSET_RAX     0x0
     
    3838#define IOFFSET_R10     0x38
    3939#define IOFFSET_R11     0x40
     40#define IOFFSET_RBP     0x48
    4041
    4142#  Mask for interrupts 0 - 31 (bits 0 - 31) where 0 means that int has no error word
     
    179180        movq %r10, IOFFSET_R10(%rsp)
    180181        movq %r11, IOFFSET_R11(%rsp)
     182        movq %rbp, IOFFSET_RBP(%rsp)
    181183.endm
    182184
     
    191193        movq IOFFSET_R10(%rsp), %r10
    192194        movq IOFFSET_R11(%rsp), %r11
     195        movq IOFFSET_RBP(%rsp), %rbp
    193196.endm
    194197
     
    235238        cld
    236239
     240        # Stop stack traces here
     241        xorq %rbp, %rbp
     242
    237243        movq $(\i), %rdi        # %rdi - first parameter
    238244        movq %rsp, %rsi         # %rsi - pointer to istate
  • kernel/arch/amd64/src/boot/boot.S

    reb0bc90 r40d4c1d  
    174174        call arch_pre_main
    175175       
     176        # create the first stack frame
     177        pushq $0
     178        movq %rsp, %rbp
     179
    176180        call main_bsp
    177181       
  • kernel/arch/amd64/src/interrupt.c

    reb0bc90 r40d4c1d  
    5353#include <ddi/irq.h>
    5454#include <symtab.h>
     55#include <stacktrace.h>
    5556
    5657/*
     
    8081            istate->r10, istate->r11);
    8182        printf("%%rsp=%#llx\n", &istate->stack[0]);
     83       
     84        stack_trace_istate(istate);
    8285}
    8386
  • kernel/arch/amd64/src/mm/page.c

    reb0bc90 r40d4c1d  
    203203{
    204204        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);
    206207       
    207208        uintptr_t virtaddr = PA2KA(last_frame);
  • kernel/arch/amd64/src/smp/ap.S

    reb0bc90 r40d4c1d  
    9999start64:
    100100        movq (ctx), %rsp
     101        pushq $0
     102        movq %rsp, %rbp
    101103        call main_ap - AP_BOOT_OFFSET + BOOT_OFFSET   # never returns
    102104
Note: See TracChangeset for help on using the changeset viewer.