Changeset 40cb845e in mainline for uspace/lib/libc/arch/amd64


Ignore:
Timestamp:
2009-12-30T19:21:45Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a7a0417
Parents:
26b50cb (diff), f0452536 (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.

So far, only userspace stack tracing on amd64, ia32 and sparc64 is supported.
Other architectures have dummy support.

Location:
uspace/lib/libc/arch/amd64
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/amd64/Makefile.inc

    r26b50cb r40cb845e  
    3636ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
    3737        arch/$(UARCH)/src/fibril.S \
    38         arch/$(UARCH)/src/tls.c
     38        arch/$(UARCH)/src/tls.c \
     39        arch/$(UARCH)/src/stacktrace.S
    3940
     41GCC_CFLAGS += -fno-omit-frame-pointer
    4042LFLAGS += -N
    4143
  • uspace/lib/libc/arch/amd64/include/fibril.h

    r26b50cb r40cb845e  
    4444#define SP_DELTA     16
    4545
     46#define context_set(c, _pc, stack, size, ptls) \
     47        do { \
     48                (c)->pc = (sysarg_t) (_pc); \
     49                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
     50                (c)->tls = (sysarg_t) (ptls); \
     51                (c)->rbp = 0; \
     52        } while (0)
     53
    4654/* We include only registers that must be preserved
    4755 * during function call
  • uspace/lib/libc/arch/amd64/src/entry.s

    r26b50cb r40cb845e  
    3838#
    3939__entry:
     40        #
     41        # Create the first stack frame.
     42        #
     43        pushq $0
     44        mov %rsp, %rbp
     45       
    4046        # %rdi was deliberately chosen as the first argument is also in %rdi
    4147        # Pass PCB pointer to __main (no operation)
  • uspace/lib/libc/arch/amd64/src/thread_entry.s

    r26b50cb r40cb845e  
    3636__thread_entry:
    3737        #
     38        # Create the first stack frame.
     39        #
     40        pushq $0
     41        movq %rsp, %rbp
     42
     43        #
    3844        # RAX contains address of uarg
    3945        #
Note: See TracChangeset for help on using the changeset viewer.