Changeset b1d3c36 in mainline
- Timestamp:
- 2010-02-04T16:51:36Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4cac2d69
- Parents:
- d32358f
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/context.h
rd32358f rb1d3c36 39 39 #define SP_DELTA 0 40 40 41 #define context_set(ctx, pc, stack, size) \ 42 context_set_generic(ctx, pc, stack, size) 43 41 44 /* 42 45 * On real hardware this stores the registers which -
kernel/arch/ia64/include/context.h
rd32358f rb1d3c36 48 48 */ 49 49 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 50 51 #ifdef context_set52 #undef context_set53 #endif54 50 55 51 /* RSE stack starts at the bottom of memory stack. */ -
kernel/arch/mips32/include/context.h
rd32358f rb1d3c36 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 42 42 * Put one item onto the stack to support get_stack_base() and align it up. 43 43 */ 44 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 45 44 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 46 45 47 46 #ifndef __ASM__ 48 47 49 48 #include <arch/types.h> 49 50 #define context_set(ctx, pc, stack, size) \ 51 context_set_generic(ctx, pc, stack, size) 50 52 51 53 /* -
kernel/arch/ppc32/include/context.h
rd32358f rb1d3c36 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 38 38 #include <arch/types.h> 39 39 40 #define SP_DELTA 16 40 #define SP_DELTA 16 41 42 #define context_set(ctx, pc, stack, size) \ 43 context_set_generic(ctx, pc, stack, size) 41 44 42 45 typedef struct { … … 68 71 69 72 ipl_t ipl; 70 } __attribute__ 73 } __attribute__((packed)) context_t; 71 74 72 75 #endif -
kernel/arch/sparc64/include/context.h
rd32358f rb1d3c36 42 42 #define SP_DELTA (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE) 43 43 44 #ifdef context_set45 #undef context_set46 #endif47 48 44 #define context_set(c, _pc, stack, size) \ 49 45 (c)->pc = ((uintptr_t) _pc) - 8; \ -
kernel/generic/include/context.h
rd32358f rb1d3c36 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 39 39 #include <arch/context.h> 40 40 41 #define context_set_generic(ctx, _pc, stack, size) \ 42 (ctx)->pc = (uintptr_t) (_pc); \ 43 (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; 41 44 42 #ifndef context_set 43 #define context_set(c, _pc, stack, size) \ 44 (c)->pc = (uintptr_t) (_pc); \ 45 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; 46 #endif /* context_set */ 47 48 extern int context_save_arch(context_t *c) __attribute__ ((returns_twice)); 49 extern void context_restore_arch(context_t *c) __attribute__ ((noreturn)); 45 extern int context_save_arch(context_t *ctx) __attribute__((returns_twice)); 46 extern void context_restore_arch(context_t *ctx) __attribute__((noreturn)); 50 47 51 48 /** Save register context. … … 73 70 * saved like that would therefore lead to a disaster. 74 71 * 75 * @param c 72 * @param ctx Context structure. 76 73 * 77 * @return context_save() returns 1, context_restore() returns 0. 74 * @return context_save() returns 1, context_restore() returns 0. 75 * 78 76 */ 79 #define context_save(c ) context_save_arch(c)77 #define context_save(ctx) context_save_arch(ctx) 80 78 81 79 /** Restore register context. … … 88 86 * being return value. 89 87 * 90 * @param c 88 * @param ctx Context structure. 91 89 */ 92 static inline void context_restore(context_t *c )90 static inline void context_restore(context_t *ctx) 93 91 { 94 context_restore_arch(c );92 context_restore_arch(ctx); 95 93 } 96 94 -
uspace/lib/libc/arch/ia64/include/fibril.h
rd32358f rb1d3c36 52 52 /* Stack is divided into two equal parts (for memory stack and register stack). */ 53 53 #define PSTHREAD_INITIAL_STACK_DIVISION 2 54 55 #ifdef context_set56 #undef context_set57 #endif58 54 59 55 #define context_set(c, _pc, stack, size, tls) \ -
uspace/lib/libc/arch/sparc64/include/fibril.h
rd32358f rb1d3c36 42 42 #define SP_DELTA (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE) 43 43 44 #ifdef context_set45 #undef context_set46 #endif47 48 44 #define context_set(c, _pc, stack, size, ptls) \ 49 45 do { \ -
uspace/lib/libc/include/fibril.h
rd32358f rb1d3c36 40 40 #include <libarch/tls.h> 41 41 42 #ifndef context_set 43 #define context_set(c, _pc, stack, size, ptls) \ 42 #define context_set_generic(c, _pc, stack, size, ptls) \ 44 43 (c)->pc = (sysarg_t) (_pc); \ 45 44 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 46 45 (c)->tls = (sysarg_t) (ptls); 47 #endif /* context_set */48 46 49 #define FIBRIL_SERIALIZED 50 #define FIBRIL_WRITER 47 #define FIBRIL_SERIALIZED 1 48 #define FIBRIL_WRITER 2 51 49 52 50 typedef enum { … … 59 57 typedef sysarg_t fid_t; 60 58 61 struct fibril {59 typedef struct fibril { 62 60 link_t link; 63 61 context_t ctx; … … 70 68 int retval; 71 69 int flags; 72 }; 73 typedef struct fibril fibril_t; 70 } fibril_t; 74 71 75 72 /** Fibril-local variable specifier */ 76 73 #define fibril_local __thread 77 74 78 extern int context_save(context_t *c ) __attribute__((returns_twice));79 extern void context_restore(context_t *c ) __attribute__((noreturn));75 extern int context_save(context_t *ctx) __attribute__((returns_twice)); 76 extern void context_restore(context_t *ctx) __attribute__((noreturn)); 80 77 81 78 extern fid_t fibril_create(int (*func)(void *), void *arg); … … 90 87 extern void fibril_dec_sercount(void); 91 88 92 static inline int fibril_yield(void) { 89 static inline int fibril_yield(void) 90 { 93 91 return fibril_switch(FIBRIL_PREEMPT); 94 92 }
Note:
See TracChangeset
for help on using the changeset viewer.