Changeset 4b2c872d in mainline for include/context.h
- Timestamp:
- 2005-10-18T09:33:02Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8005218
- Parents:
- 22f7769
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/context.h
r22f7769 r4b2c872d 32 32 #include <arch/types.h> 33 33 #include <typedefs.h> 34 #include <arch/context.h> 35 34 36 35 37 #ifndef context_set … … 39 41 #endif /* context_set */ 40 42 41 extern int context_save(context_t *c); 42 extern void context_restore(context_t *c) __attribute__ ((noreturn)); 43 extern int context_save_arch(context_t *c); 44 extern void context_restore_arch(context_t *c) __attribute__ ((noreturn)); 45 46 /** Save register context. 47 * 48 * Save current register context (including stack pointers) 49 * to context structure. 50 * 51 * Note that call to context_restore() will return at the same 52 * address as the corresponding call to context_save(). 53 * 54 * @param c Context structure. 55 * 56 * @return context_save() returns 1, context_restore() returns 0. 57 */ 58 static inline int context_save(context_t *c) 59 { 60 return context_save_arch(c); 61 } 62 63 /** Restore register context. 64 * 65 * Restore previously saved register context (including stack pointers) 66 * from context structure. 67 * 68 * Note that this function does not normally return. 69 * Instead, it returns at the same address as the 70 * corresponding call to context_save(), the only 71 * difference being return value. 72 * 73 * Note that content of any local variable defined by 74 * the caller of context_save() is undefined after 75 * context_restore(). 76 * 77 * @param c Context structure. 78 */ 79 static inline void context_restore(context_t *c) 80 { 81 context_restore_arch(c); 82 } 43 83 44 84 #endif
Note:
See TracChangeset
for help on using the changeset viewer.