Changes in / [96598b8:53d5278] in mainline


Ignore:
Files:
6 added
9 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/context.h

    r96598b8 r53d5278  
    3838#include <typedefs.h>
    3939
    40 /*
    41  * According to ABI the stack MUST be aligned on
     40/* According to ABI the stack MUST be aligned on
    4241 * 16-byte boundary. If it is not, the va_arg calling will
    4342 * panic sooner or later
  • kernel/arch/arm32/include/context.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup arm32
     29/** @addtogroup arm32   
    3030 * @{
    3131 */
  • kernel/arch/ia64/include/context.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup ia64
     29/** @addtogroup ia64   
    3030 * @{
    3131 */
     
    4747 * One item is put onto the stack to support get_stack_base().
    4848 */
    49 #define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
     49#define SP_DELTA        (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    5050
    5151/* RSE stack starts at the bottom of memory stack, hence the division by 2. */
    52 #define context_set(c, _pc, stack, size) \
    53         do { \
    54                 (c)->pc = (uintptr_t) _pc; \
    55                 (c)->bsp = ((uintptr_t) stack) + ALIGN_UP((size / 2), REGISTER_STACK_ALIGNMENT); \
    56                 (c)->ar_pfs &= PFM_MASK; \
    57                 (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size / 2), STACK_ALIGNMENT) - SP_DELTA; \
    58         } while (0)
     52#define context_set(c, _pc, stack, size)                                                                \
     53        do {                                                                                            \
     54                (c)->pc = (uintptr_t) _pc;                                                              \
     55                (c)->bsp = ((uintptr_t) stack) + ALIGN_UP((size / 2), REGISTER_STACK_ALIGNMENT);        \
     56                (c)->ar_pfs &= PFM_MASK;                                                                \
     57                (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size / 2), STACK_ALIGNMENT) - SP_DELTA;       \
     58        } while (0);
    5959
    6060/*
  • kernel/arch/mips32/include/context.h

    r96598b8 r53d5278  
    4242 * Put one item onto the stack to support get_stack_base() and align it up.
    4343 */
    44 #define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
     44#define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    4545
    4646#ifndef __ASM__
  • kernel/arch/mips32/include/stack.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup mips32
     29/** @addtogroup mips32 
    3030 * @{
    3131 */
     
    3636#define KERN_mips32_STACK_H_
    3737
    38 #define STACK_ITEM_SIZE  4
    39 #define STACK_ALIGNMENT  8
    40 #define ABI_STACK_FRAME  32
     38#define STACK_ITEM_SIZE         4
     39#define STACK_ALIGNMENT         8
    4140
    4241#endif
  • kernel/arch/mips32/src/start.S

    r96598b8 r53d5278  
    241241        /* $a1 contains physical address of bootinfo_t */
    242242        jal arch_pre_main
    243         addiu $sp, -ABI_STACK_FRAME
     243        nop
    244244       
    245245        j main_bsp
     
    281281       
    282282        move $a1, $sp
     283        jal exc_dispatch     /* exc_dispatch(excno, register_space) */
    283284        move $a0, $k0
    284         jal exc_dispatch     /* exc_dispatch(excno, register_space) */
    285         addiu $sp, -ABI_STACK_FRAME
    286         addiu $sp, ABI_STACK_FRAME
    287285       
    288286        REGISTERS_LOAD $sp
     
    325323        sw $t0, ISTATE_OFFSET_T0($sp)  /* save the 5th argument on the stack */
    326324        sw $t1, ISTATE_OFFSET_T1($sp)  /* save the 6th argument on the stack */
    327        
    328325        jal syscall_handler
    329326        sw $v0, ISTATE_OFFSET_V0($sp)  /* save the syscall number on the stack */
     
    360357        move $sp, $k0
    361358       
    362         move $a0, $sp
    363359        jal tlb_refill
    364         addiu $sp, -ABI_STACK_FRAME
    365         addiu $sp, ABI_STACK_FRAME
     360        move $a0, $sp
    366361       
    367362        REGISTERS_LOAD $sp
     
    371366cache_error_handler:
    372367        KERNEL_STACK_TO_K0
    373         sub $k0, ISTATE_SOFT_SIZE
     368        sub $k0, ISTATE_SOFT_SIZE 
    374369        REGISTERS_STORE_AND_EXC_RESET $k0
    375370        sw $sp, ISTATE_OFFSET_SP($k0)
    376371        move $sp, $k0
    377372       
     373        jal cache_error
    378374        move $a0, $sp
    379         jal cache_error
    380         addiu $sp, -ABI_STACK_FRAME
    381         addiu $sp, ABI_STACK_FRAME
    382375       
    383376        REGISTERS_LOAD $sp
  • kernel/arch/mips64/include/context.h

    r96598b8 r53d5278  
    4242 * Put one item onto the stack to support get_stack_base() and align it up.
    4343 */
    44 #define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
     44#define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    4545
    4646#ifndef __ASM__
  • kernel/arch/mips64/include/stack.h

    r96598b8 r53d5278  
    3838#define STACK_ITEM_SIZE  8
    3939#define STACK_ALIGNMENT  8
    40 #define ABI_STACK_FRAME  64
    4140
    4241#endif
  • kernel/arch/mips64/src/start.S

    r96598b8 r53d5278  
    241241        /* $a1 contains physical address of bootinfo_t */
    242242        jal arch_pre_main
    243         addiu $sp, -ABI_STACK_FRAME
     243        nop
    244244       
    245245        j main_bsp
     
    281281       
    282282        move $a1, $sp
     283        jal exc_dispatch     /* exc_dispatch(excno, register_space) */
    283284        move $a0, $k0
    284         jal exc_dispatch     /* exc_dispatch(excno, register_space) */
    285         addiu $sp, -ABI_STACK_FRAME
    286         addiu $sp, ABI_STACK_FRAME
    287285       
    288286        REGISTERS_LOAD $sp
     
    325323        sw $t0, ISTATE_OFFSET_T0($sp)  /* save the 5th argument on the stack */
    326324        sw $t1, ISTATE_OFFSET_T1($sp)  /* save the 6th argument on the stack */
    327        
    328325        jal syscall_handler
    329326        sw $v0, ISTATE_OFFSET_V0($sp)  /* save the syscall number on the stack */
     
    360357        move $sp, $k0
    361358       
    362         move $a0, $sp
    363359        jal tlb_refill
    364         addiu $sp, -ABI_STACK_FRAME
    365         addiu $sp, ABI_STACK_FRAME
     360        move $a0, $sp
    366361       
    367362        REGISTERS_LOAD $sp
     
    371366cache_error_handler:
    372367        KERNEL_STACK_TO_K0
    373         sub $k0, ISTATE_SOFT_SIZE
     368        sub $k0, ISTATE_SOFT_SIZE 
    374369        REGISTERS_STORE_AND_EXC_RESET $k0
    375370        sw $sp, ISTATE_OFFSET_SP($k0)
    376371        move $sp, $k0
    377372       
     373        jal cache_error
    378374        move $a0, $sp
    379         jal cache_error
    380         addiu $sp, -ABI_STACK_FRAME
    381         addiu $sp, ABI_STACK_FRAME
    382375       
    383376        REGISTERS_LOAD $sp
  • kernel/arch/sparc64/include/context.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup sparc64
     29/** @addtogroup sparc64 
    3030 * @{
    3131 */
     
    4040#include <align.h>
    4141
    42 #define SP_DELTA  (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE)
     42#define SP_DELTA        (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE)
    4343
    44 #define context_set(c, _pc, stack, size) \
    45         do { \
    46                 (c)->pc = ((uintptr_t) _pc) - 8; \
    47                 (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size), \
    48                     STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \
    49                 (c)->fp = -STACK_BIAS; \
    50         } while (0)
     44#define context_set(c, _pc, stack, size)                        \
     45        (c)->pc = ((uintptr_t) _pc) - 8;                        \
     46        (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size),        \
     47                STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA);     \
     48        (c)->fp = -STACK_BIAS
     49       
    5150
    5251/*
  • kernel/generic/include/context.h

    r96598b8 r53d5278  
    4141
    4242#define context_set_generic(ctx, _pc, stack, size) \
    43         do { \
    44                 (ctx)->pc = (uintptr_t) (_pc); \
    45                 (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \
    46         } while (0)
     43        (ctx)->pc = (uintptr_t) (_pc); \
     44        (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA;
    4745
    4846extern int context_save_arch(context_t *ctx) __attribute__((returns_twice));
  • tools/toolchain.sh

    r96598b8 r53d5278  
    5353EOF
    5454
    55 BINUTILS_VERSION="2.22"
    56 BINUTILS_RELEASE=""
    57 GCC_VERSION="4.6.3"
    58 GDB_VERSION="7.4"
     55BINUTILS_VERSION="2.21.1"
     56BINUTILS_RELEASE="a"
     57GCC_VERSION="4.6.2"
     58GDB_VERSION="7.3.1"
    5959
    6060BASEDIR="`pwd`"
     
    274274        GDB_SOURCE="ftp://ftp.gnu.org/gnu/gdb/"
    275275       
    276         download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "ee0f10756c84979622b992a4a61ea3f5"
    277         download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "766091220c6a14fcaa2c06dd573e3758"
    278         download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "48ba23770c34b1cb468f72618b4452c5"
    279         download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "37515158a0fb3d0800ec41a08c05e69e"
    280         download_fetch "${GDB_SOURCE}" "${GDB}" "95a9a8305fed4d30a30a6dc28ff9d060"
     276        download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "bde820eac53fa3a8d8696667418557ad"
     277        download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "780f614ab18c7a9066dec6387d7490b2"
     278        download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "94043cc0d08394eddebed73f30ecad89"
     279        download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "87ecd60431e41096419dd8a10f76e46b"
     280        download_fetch "${GDB_SOURCE}" "${GDB}" "b89a5fac359c618dda97b88645ceab47"
    281281}
    282282
  • uspace/lib/c/arch/amd64/include/fibril.h

    r96598b8 r53d5278  
    3838#include <sys/types.h>
    3939
    40 /*
    41  * According to ABI the stack MUST be aligned on
     40/* According to ABI the stack MUST be aligned on
    4241 * 16-byte boundary. If it is not, the va_arg calling will
    4342 * panic sooner or later
    4443 */
    45 #define SP_DELTA  16
     44#define SP_DELTA     16
    4645
    4746#define context_set(c, _pc, stack, size, ptls) \
  • uspace/lib/c/arch/arm32/include/fibril.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup libcarm32
     29/** @addtogroup libcarm32       
    3030 * @{
    3131 */
     
    4242
    4343/** Size of a stack item */
    44 #define STACK_ITEM_SIZE  4
     44#define STACK_ITEM_SIZE         4
    4545
    4646/** Stack alignment - see <a href="http://www.arm.com/support/faqdev/14269.html">ABI</a> for details */
    47 #define STACK_ALIGNMENT  8
     47#define STACK_ALIGNMENT         8
    4848
    49 #define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
     49#define SP_DELTA        (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    5050
    5151
    52 /** Sets data to the context.
    53  *
     52/** Sets data to the context. 
     53 * 
    5454 *  @param c     Context (#context_t).
    5555 *  @param _pc   Program counter.
     
    6262                (c)->pc = (sysarg_t) (_pc); \
    6363                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    64                 (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; \
     64                (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; \
    6565                (c)->fp = 0; \
    6666        } while (0)
    6767
    68 /** Fibril context.
     68/** Fibril context. 
    6969 *
    7070 *  Only registers preserved accross function calls are included. r9 is used
     
    9191}
    9292
     93
    9394#endif
    9495
  • uspace/lib/c/arch/ia32/include/fibril.h

    r96598b8 r53d5278  
    3838#include <sys/types.h>
    3939
    40 /*
    41  * According to ABI the stack MUST be aligned on
     40/* According to ABI the stack MUST be aligned on
    4241 * 16-byte boundary. If it is not, the va_arg calling will
    4342 * panic sooner or later
  • uspace/lib/c/arch/ia64/include/fibril.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup libcia64
     29/** @addtogroup libcia64       
    3030 * @{
    3131 */
     
    4545 * No need to allocate scratch area.
    4646 */
    47 #define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
     47#define SP_DELTA        (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    4848
    49 #define PFM_MASK  (~0x3fffffffff)
     49#define PFM_MASK        (~0x3fffffffff)
    5050
    51 #define PSTHREAD_INITIAL_STACK_PAGES_NO  2
     51#define PSTHREAD_INITIAL_STACK_PAGES_NO 2
     52/* Stack is divided into two equal parts (for memory stack and register stack). */
     53#define PSTHREAD_INITIAL_STACK_DIVISION 2 
    5254
    53 /* Stack is divided into two equal parts (for memory stack and register stack). */
    54 #define PSTHREAD_INITIAL_STACK_DIVISION  2
    55 
    56 #define context_set(c, _pc, stack, size, tls) \
    57         do { \
    58                 (c)->pc = (uint64_t) _pc; \
    59                 (c)->bsp = ((uint64_t) stack) + \
    60                     size / PSTHREAD_INITIAL_STACK_DIVISION; \
    61                 (c)->ar_pfs &= PFM_MASK; \
    62                 (c)->sp = ((uint64_t) stack) + \
    63                     ALIGN_UP((size / PSTHREAD_INITIAL_STACK_DIVISION), STACK_ALIGNMENT) - \
    64                     SP_DELTA; \
    65                 (c)->tp = (uint64_t) tls; \
    66         } while (0)
     55#define context_set(c, _pc, stack, size, tls)                                                           \
     56        do {                                                                                            \
     57                (c)->pc = (uint64_t) _pc;                                                               \
     58                (c)->bsp = ((uint64_t) stack) + size / PSTHREAD_INITIAL_STACK_DIVISION;                                                         \
     59                (c)->ar_pfs &= PFM_MASK;                                                                \
     60                (c)->sp = ((uint64_t) stack) + ALIGN_UP((size / PSTHREAD_INITIAL_STACK_DIVISION), STACK_ALIGNMENT) - SP_DELTA;          \
     61                (c)->tp = (uint64_t) tls;                                                               \
     62        } while (0);
     63       
    6764
    6865/*
  • uspace/lib/c/arch/mips32/Makefile.inc

    r96598b8 r53d5278  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    31         arch/$(UARCH)/src/entryjmp.S \
    32         arch/$(UARCH)/src/thread_entry.S \
     30        arch/$(UARCH)/src/entry.s \
     31        arch/$(UARCH)/src/entryjmp.s \
     32        arch/$(UARCH)/src/thread_entry.s \
    3333        arch/$(UARCH)/src/syscall.c \
    3434        arch/$(UARCH)/src/fibril.S \
  • uspace/lib/c/arch/mips32/include/atomic.h

    r96598b8 r53d5278  
    6767                "       ll %0, %1\n"
    6868                "       addu %0, %0, %3\n"      /* same as add, but never traps on overflow */
    69                 "       move %2, %0\n"
     69                "       move %2, %0\n"
    7070                "       sc %0, %1\n"
    7171                "       beq %0, %4, 1b\n"       /* if the atomic operation failed, try again */
  • uspace/lib/c/arch/mips32/include/config.h

    r96598b8 r53d5278  
    3636#define LIBC_mips32_CONFIG_H_
    3737
    38 #define PAGE_WIDTH  14
    39 #define PAGE_SIZE   (1 << PAGE_WIDTH)
     38#define PAGE_WIDTH      14
     39#define PAGE_SIZE       (1 << PAGE_WIDTH)
    4040
    4141#endif
  • uspace/lib/c/arch/mips32/include/faddr.h

    r96598b8 r53d5278  
    3838#include <libarch/types.h>
    3939
    40 #define FADDR(fptr)  ((uintptr_t) (fptr))
     40#define FADDR(fptr)             ((uintptr_t) (fptr))
    4141
    4242#endif
  • uspace/lib/c/arch/mips32/include/fibril.h

    r96598b8 r53d5278  
    3838
    3939#include <sys/types.h>
    40 #include <libarch/stack.h>
    41 #include <align.h>
    4240
    43 #define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    44 
    45 /*
    46  * We define our own context_set, because we need to set
    47  * the TLS pointer to the tcb + 0x7000
     41/* We define our own context_set, because we need to set
     42 * the TLS pointer to the tcb+0x7000
    4843 *
    4944 * See tls_set in thread.h
    5045 */
    51 #define context_set(c, _pc, stack, size, ptls) \
    52         do { \
    53                 (c)->pc = (sysarg_t) (_pc); \
    54                 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    55                 (c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t); \
    56         } while (0)
     46#define context_set(c, _pc, stack, size, ptls)                  \
     47        (c)->pc = (sysarg_t) (_pc);                             \
     48        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
     49        (c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t);
     50
     51
     52/* +16 is just for sure that the called function
     53 * have space to store it's arguments
     54 */
     55#define SP_DELTA        (8+16)
    5756
    5857typedef struct  {
  • uspace/lib/c/arch/mips32/src/fibril.S

    r96598b8 r53d5278  
    3333
    3434#include <libarch/context_offset.h>
    35 
     35       
    3636.global context_save
    3737.global context_restore
    38 
     38       
    3939context_save:
    4040        CONTEXT_SAVE_ARCH_CORE $a0
    41        
     41
    4242        # context_save returns 1
    4343        j $ra
    44         li $v0, 1
    45 
     44        li $v0, 1       
     45       
    4646context_restore:
    4747        CONTEXT_RESTORE_ARCH_CORE $a0
    48        
    49         # Just for the jump into first function,
    50         # but one instruction should not bother us
    51         move $t9, $ra
    52        
     48
     49        # Just for the jump into first function, but one instruction
     50        # should not bother us
     51        move $t9, $ra   
    5352        # context_restore returns 0
    5453        j $ra
    55         xor $v0, $v0
     54        xor $v0, $v0   
     55
  • uspace/lib/c/arch/mips32/src/syscall.c

    r96598b8 r53d5278  
    5757                  "r" (__mips_reg_t1),
    5858                  "r" (__mips_reg_v0)
    59                 /*
    60                  * We are a function call, although C
    61                  * does not know it.
    62                  */
    63                 : "%ra"
     59                : "%ra" /* We are a function call, although C does not
     60                         * know it */
    6461        );
    6562       
  • uspace/lib/c/arch/mips32eb/Makefile.inc

    r96598b8 r53d5278  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    31         arch/$(UARCH)/src/entryjmp.S \
    32         arch/$(UARCH)/src/thread_entry.S \
     30        arch/$(UARCH)/src/entry.s \
     31        arch/$(UARCH)/src/entryjmp.s \
     32        arch/$(UARCH)/src/thread_entry.s \
    3333        arch/$(UARCH)/src/syscall.c \
    3434        arch/$(UARCH)/src/fibril.S \
  • uspace/lib/c/arch/mips64/Makefile.inc

    r96598b8 r53d5278  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    31         arch/$(UARCH)/src/entryjmp.S \
    32         arch/$(UARCH)/src/thread_entry.S \
     30        arch/$(UARCH)/src/entry.s \
     31        arch/$(UARCH)/src/entryjmp.s \
     32        arch/$(UARCH)/src/thread_entry.s \
    3333        arch/$(UARCH)/src/syscall.c \
    3434        arch/$(UARCH)/src/fibril.S \
  • uspace/lib/c/arch/mips64/include/fibril.h

    r96598b8 r53d5278  
    3838
    3939#include <sys/types.h>
    40 #include <libarch/stack.h>
    41 #include <align.h>
    4240
    43 #define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    44 
    45 /*
    46  * We define our own context_set, because we need to set
    47  * the TLS pointer to the tcb + 0x7000
     41/* We define our own context_set, because we need to set
     42 * the TLS pointer to the tcb+0x7000
    4843 *
    4944 * See tls_set in thread.h
    5045 */
    5146#define context_set(c, _pc, stack, size, ptls) \
    52         do { \
    53                 (c)->pc = (sysarg_t) (_pc); \
    54                 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    55                 (c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t); \
    56         } while (0)
     47        (c)->pc = (sysarg_t) (_pc); \
     48        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
     49        (c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t);
     50
     51/* +16 is just for sure that the called function
     52 * have space to store it's arguments
     53 */
     54#define SP_DELTA  (8 + 16)
    5755
    5856typedef struct {
  • uspace/lib/c/arch/ppc32/include/fibril.h

    r96598b8 r53d5278  
    2727 */
    2828
    29 /** @addtogroup libcppc32
     29/** @addtogroup libcppc32       
    3030 * @{
    3131 */
     
    3838#include <sys/types.h>
    3939
    40 #define SP_DELTA  16
    41 
    42 /*
    43  * We define our own context_set, because we need to set
    44  * the TLS pointer to the tcb + 0x7000
     40/* We define our own context_set, because we need to set
     41 * the TLS pointer to the tcb+0x7000
    4542 *
    4643 * See tls_set in thread.h
    4744 */
    48 #define context_set(c, _pc, stack, size, ptls) \
    49         do { \
    50                 (c)->pc = (sysarg_t) (_pc); \
    51                 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    52                 (c)->tls = ((sysarg_t) (ptls)) + 0x7000 + sizeof(tcb_t); \
    53         } while (0)
     45#define context_set(c, _pc, stack, size, ptls)                  \
     46        (c)->pc = (sysarg_t) (_pc);                             \
     47        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
     48        (c)->tls = ((sysarg_t) (ptls)) + 0x7000 + sizeof(tcb_t);
     49
     50#define SP_DELTA        16
    5451
    5552typedef struct {
  • uspace/lib/c/arch/sparc64/include/fibril.h

    r96598b8 r53d5278  
    4040#include <align.h>
    4141
    42 #define SP_DELTA  (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE)
     42#define SP_DELTA        (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE)
    4343
    4444#define context_set(c, _pc, stack, size, ptls) \
     
    5050                (c)->tp = (uint64_t) ptls; \
    5151        } while (0)
    52 
     52       
    5353/*
    5454 * Save only registers that must be preserved across
  • uspace/lib/c/include/fibril.h

    r96598b8 r53d5278  
    4141
    4242#define context_set_generic(c, _pc, stack, size, ptls) \
    43         do { \
    44                 (c)->pc = (sysarg_t) (_pc); \
    45                 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    46                 (c)->tls = (sysarg_t) (ptls); \
    47         } while (0)
     43        (c)->pc = (sysarg_t) (_pc); \
     44        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
     45        (c)->tls = (sysarg_t) (ptls);
    4846
    4947#define FIBRIL_SERIALIZED  1
Note: See TracChangeset for help on using the changeset viewer.