Changeset 4f5dc18 in mainline for kernel/generic/include
- Timestamp:
- 2009-11-03T21:36:54Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1647323
- Parents:
- bbddafb (diff), b1c21c2 (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. - Location:
- kernel/generic/include
- Files:
-
- 1 deleted
- 4 edited
-
context.h (modified) (2 diffs)
-
print.h (modified) (1 diff)
-
printf/printf_core.h (modified) (1 diff)
-
stackarg.h (deleted)
-
stdarg.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/context.h
rbbddafb r4f5dc18 51 51 /** Save register context. 52 52 * 53 * Save current register context (including stack pointers) 54 * to context structure. 55 * 56 * Note that call to context_restore() will return at the same 53 * Save the current register context (including stack pointer) to a context 54 * structure. A subsequent call to context_restore() will return to the same 57 55 * address as the corresponding call to context_save(). 58 56 * 59 * This MUST be a macro, gcc -O0 does not inline functions even 60 * if they are marked inline and context_save_arch must be called 61 * from level <= that when context_restore is called. 57 * Note that context_save_arch() must reuse the stack frame of the function 58 * which called context_save(). We guarantee this by: 62 59 * 63 * @param c Context structure. 60 * a) implementing context_save_arch() in assembly so that it does not create 61 * its own stack frame, and by 62 * b) defining context_save() as a macro because the inline keyword is just a 63 * hint for the compiler, not a real constraint; the application of a macro 64 * will definitely not create a stack frame either. 64 65 * 65 * @return context_save() returns 1, context_restore() returns 0. 66 * To imagine what could happen if there were some extra stack frames created 67 * either by context_save() or context_save_arch(), we need to realize that the 68 * sp saved in the contex_t structure points to the current stack frame as it 69 * existed when context_save_arch() was executing. After the return from 70 * context_save_arch() and context_save(), any extra stack frames created by 71 * these functions will be destroyed and their contents sooner or later 72 * overwritten by functions called next. Any attempt to restore to a context 73 * saved like that would therefore lead to a disaster. 74 * 75 * @param c Context structure. 76 * 77 * @return context_save() returns 1, context_restore() returns 0. 66 78 */ 67 79 #define context_save(c) context_save_arch(c) … … 69 81 /** Restore register context. 70 82 * 71 * Restore previously saved register context (including stack pointers)72 * fromcontext structure.83 * Restore a previously saved register context (including stack pointer) from 84 * a context structure. 73 85 * 74 * Note that this function does not normally return. 75 * Instead, it returns at the same address as the 76 * corresponding call to context_save(), the only 77 * difference being return value. 86 * Note that this function does not normally return. Instead, it returns to the 87 * same address as the corresponding call to context_save(), the only difference 88 * being return value. 78 89 * 79 * @param c Context structure.90 * @param c Context structure. 80 91 */ 81 92 static inline void context_restore(context_t *c) -
kernel/generic/include/print.h
rbbddafb r4f5dc18 37 37 38 38 #include <arch/types.h> 39 #include < arch/arg.h>39 #include <stdarg.h> 40 40 41 41 #define EOF (-1) -
kernel/generic/include/printf/printf_core.h
rbbddafb r4f5dc18 37 37 38 38 #include <typedefs.h> 39 #include < arch/arg.h>39 #include <stdarg.h> 40 40 41 41 /** Structure for specifying output methods for different printf clones. */ -
kernel/generic/include/stdarg.h
rbbddafb r4f5dc18 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 37 37 * for all architectures with compiler support for __builtin_va_*. 38 38 */ 39 39 40 40 #ifndef KERN_STDARG_H_ 41 41 #define KERN_STDARG_H_ … … 43 43 typedef __builtin_va_list va_list; 44 44 45 #define va_start(ap, last) __builtin_va_start(ap, last)46 #define va_arg(ap, type) __builtin_va_arg(ap, type)47 #define va_end(ap) __builtin_va_end(ap)48 #define va_copy(dst, src) __builtin_va_copy(dst, src)45 #define va_start(ap, last) __builtin_va_start(ap, last) 46 #define va_arg(ap, type) __builtin_va_arg(ap, type) 47 #define va_end(ap) __builtin_va_end(ap) 48 #define va_copy(dst, src) __builtin_va_copy(dst, src) 49 49 50 50 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
