Changes in kernel/generic/include/context.h [b1c21c2:b1d3c36] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/context.h
rb1c21c2 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
Note:
See TracChangeset
for help on using the changeset viewer.