Changeset 99de22b in mainline for uspace/lib/libc/arch


Ignore:
Timestamp:
2010-01-15T18:30:25Z (16 years ago)
Author:
Pavel Rimsky <pavel@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eeb643d
Parents:
387416b (diff), 563d6077 (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:

Merged latest trunk changes.

Location:
uspace/lib/libc/arch
Files:
7 added
23 edited

Legend:

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

    r387416b r99de22b  
    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

    r387416b r99de22b  
    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

    r387416b r99de22b  
    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

    r387416b r99de22b  
    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        #
  • uspace/lib/libc/arch/arm32/Makefile.inc

    r387416b r99de22b  
    3737        arch/$(UARCH)/src/fibril.S \
    3838        arch/$(UARCH)/src/tls.c \
    39         arch/$(UARCH)/src/eabi.S
     39        arch/$(UARCH)/src/eabi.S \
     40        arch/$(UARCH)/src/stacktrace.S
    4041
    41 GCC_CFLAGS += -ffixed-r9 -mtp=soft
     42GCC_CFLAGS += -ffixed-r9 -mtp=soft -mapcs-frame -fno-omit-frame-pointer
    4243LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
    4344
  • uspace/lib/libc/arch/arm32/include/fibril.h

    r387416b r99de22b  
    5858 *  @param ptls  Pointer to the TCB.
    5959 */
    60 #define context_set(c, _pc, stack, size, ptls)                  \
    61         (c)->pc = (sysarg_t) (_pc);                             \
    62         (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
    63         (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET;
    64 
     60#define context_set(c, _pc, stack, size, ptls) \
     61        do { \
     62                (c)->pc = (sysarg_t) (_pc); \
     63                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
     64                (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; \
     65                (c)->fp = 0; \
     66        } while (0)
    6567
    6668/** Fibril context.
     
    7981        uint32_t r7;
    8082        uint32_t r8;
    81         uint32_t tls;
     83        uint32_t tls;   /* r9 */
    8284        uint32_t r10;
    83         uint32_t r11;
     85        uint32_t fp;    /* r11 */
    8486} context_t;
    8587
  • uspace/lib/libc/arch/arm32/src/entry.s

    r387416b r99de22b  
    4343        str r2, [r0]
    4444
     45        #
     46        # Create the first stack frame.
     47        #
     48        mov fp, #0
     49        mov ip, sp
     50        push {fp, ip, lr, pc}
     51        sub fp, ip, #4
     52
    4553        # Pass pcb_ptr to __main as the first argument (in r0)
    4654        mov r0, r1
  • uspace/lib/libc/arch/arm32/src/thread_entry.s

    r387416b r99de22b  
    3535#
    3636__thread_entry:
     37        #
     38        # Create the first stack frame.
     39        #
     40        mov fp, #0
     41        mov ip, sp
     42        push {fp, ip, lr, pc}
     43        sub fp, ip, #4
     44
    3745        b __thread_main
  • uspace/lib/libc/arch/ia32/Makefile.inc

    r387416b r99de22b  
    3737        arch/$(UARCH)/src/fibril.S \
    3838        arch/$(UARCH)/src/tls.c \
    39         arch/$(UARCH)/src/setjmp.S
     39        arch/$(UARCH)/src/setjmp.S \
     40        arch/$(UARCH)/src/stacktrace.S
    4041
    4142GCC_CFLAGS += -march=pentium
  • uspace/lib/libc/arch/ia32/include/fibril.h

    r387416b r99de22b  
    4444#define SP_DELTA     (12)
    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)->ebp = 0; \
     52        } while (0)
     53       
    4654/* We include only registers that must be preserved
    4755 * during function call
  • uspace/lib/libc/arch/ia32/src/entry.s

    r387416b r99de22b  
    5555        movl $__syscall_fast, (%eax)
    56560:
     57        #
     58        # Create the first stack frame.
     59        #
     60        pushl $0
     61        movl %esp, %ebp
    5762
    5863        # Pass the PCB pointer to __main as the first argument
  • uspace/lib/libc/arch/ia32/src/thread_entry.s

    r387416b r99de22b  
    4242
    4343        #
     44        # Create the first stack frame.
     45        #
     46        pushl $0
     47        mov %esp, %ebp
     48
     49        #
    4450        # EAX contains address of uarg.
    4551        #
  • uspace/lib/libc/arch/ia64/Makefile.inc

    r387416b r99de22b  
    3636        arch/$(UARCH)/src/fibril.S \
    3737        arch/$(UARCH)/src/tls.c \
    38         arch/$(UARCH)/src/ddi.c
     38        arch/$(UARCH)/src/ddi.c \
     39        arch/$(UARCH)/src/stacktrace.S
    3940
    4041GCC_CFLAGS += -fno-unwind-tables
  • uspace/lib/libc/arch/mips32/Makefile.inc

    r387416b r99de22b  
    3535ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
    3636        arch/$(UARCH)/src/fibril.S \
    37         arch/$(UARCH)/src/tls.c
     37        arch/$(UARCH)/src/tls.c \
     38        arch/$(UARCH)/src/stacktrace.S
    3839
    3940GCC_CFLAGS += -mips3
  • uspace/lib/libc/arch/mips32eb/Makefile.inc

    r387416b r99de22b  
    3535ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
    3636        arch/$(UARCH)/src/fibril.S \
    37         arch/$(UARCH)/src/tls.c
     37        arch/$(UARCH)/src/tls.c \
     38        arch/$(UARCH)/src/stacktrace.S
    3839
    3940GCC_CFLAGS += -mips3
  • uspace/lib/libc/arch/ppc32/Makefile.inc

    r387416b r99de22b  
    3535ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
    3636        arch/$(UARCH)/src/fibril.S \
    37         arch/$(UARCH)/src/tls.c
     37        arch/$(UARCH)/src/tls.c \
     38        arch/$(UARCH)/src/stacktrace.S
    3839
    3940GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
  • uspace/lib/libc/arch/ppc32/src/entry.s

    r387416b r99de22b  
    3838#
    3939__entry:
     40        #
     41        # Create the first stack frame.
     42        #
     43        li %r3, 0
     44        stw %r3, 0(%r1)
     45        stwu %r1, -16(%r1)
     46
    4047        # Pass the PCB pointer to __main() as the first argument.
    4148        # The first argument is passed in r3.
  • uspace/lib/libc/arch/ppc32/src/thread_entry.s

    r387416b r99de22b  
    3535#
    3636__thread_entry:
     37        #
     38        # Create the first stack frame.
     39        #
     40        li %r4, 0
     41        stw %r4, 0(%r1)
     42        stwu %r1, -16(%r1)
     43
    3744        b __thread_main
    3845
  • uspace/lib/libc/arch/sparc64/Makefile.inc

    r387416b r99de22b  
    3434
    3535ARCH_SOURCES += arch/$(UARCH)/src/fibril.S \
    36         arch/$(UARCH)/src/tls.c
     36        arch/$(UARCH)/src/tls.c \
     37        arch/$(UARCH)/src/stacktrace.S
    3738
    3839GCC_CFLAGS += -mcpu=ultrasparc -m64
  • uspace/lib/libc/arch/sparc64/include/fibril.h

    r387416b r99de22b  
    4646#endif
    4747
    48 #define context_set(c, _pc, stack, size, ptls)                  \
    49         (c)->pc = ((uintptr_t) _pc) - 8;                        \
    50         (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size),        \
    51                 STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA);     \
    52         (c)->fp = -STACK_BIAS;                                  \
    53         (c)->tp = ptls
     48#define context_set(c, _pc, stack, size, ptls) \
     49        do { \
     50                (c)->pc = ((uintptr_t) _pc) - 8; \
     51                (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size), \
     52                    STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \
     53                (c)->fp = -STACK_BIAS; \
     54                (c)->tp = ptls; \
     55        } while (0)
    5456       
    5557/*
  • uspace/lib/libc/arch/sparc64/src/entry.s

    r387416b r99de22b  
    3939#
    4040__entry:
     41        #
     42        # Create the first stack frame.
     43        #
     44        save %sp, -176, %sp
     45        flushw
     46        add %g0, -0x7ff, %fp
     47
    4148        # Pass pcb_ptr as the first argument to __main()
    42         mov %o1, %o0
     49        mov %i1, %o0
    4350        sethi %hi(_gp), %l7
    4451        call __main
  • uspace/lib/libc/arch/sparc64/src/fibril.S

    r387416b r99de22b  
    3535
    3636context_save:
     37        #
     38        # We rely on the kernel to flush our active register windows to memory
     39        # should a thread switch occur.
     40        #
    3741        CONTEXT_SAVE_ARCH_CORE %o0
    3842        retl
     
    4246        #
    4347        # Flush all active windows.
    44         # This is essential, because CONTEXT_LOAD overwrites
    45         # %sp of CWP - 1 with the value written to %fp of CWP.
    46         # Flushing all active windows mitigates this problem
    47         # as CWP - 1 becomes the overlap window.
    48         #               
     48        # This is essential, because CONTEXT_RESTORE_ARCH_CORE overwrites %sp of
     49        # CWP - 1 with the value written to %fp of CWP.  Flushing all active
     50        # windows mitigates this problem as CWP - 1 becomes the overlap window.
     51        #
    4952        flushw
    5053       
  • uspace/lib/libc/arch/sparc64/src/thread_entry.s

    r387416b r99de22b  
    3535#
    3636__thread_entry:
     37        #
     38        # Create the first stack frame.
     39        #
     40        save %sp, -176, %sp
     41        flushw
     42        add %g0, -0x7ff, %fp
     43
    3744        sethi %hi(_gp), %l7
    3845        call __thread_main              ! %o0 contains address of uarg
Note: See TracChangeset for help on using the changeset viewer.