Changes in kernel/generic/include/arch.h [128359eb:aae365bc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/arch.h
r128359eb raae365bc 36 36 #define KERN_ARCH_H_ 37 37 38 #include <arch/asm.h> /* get_stack_base() */ 38 39 #include <config.h> 39 40 40 /** Return the current_t structure 41 * 41 /* 42 42 * The current_t structure holds pointers to various parts of the current 43 43 * execution state, like running task, thread, address space, etc. 44 *45 * The current_t structure is located at the base address of the current46 * stack. The stack is assumed to be STACK_SIZE bytes long. The stack base47 * address must be aligned to STACK_SIZE.48 *49 44 */ 50 #define CURRENT \ 51 ((current_t *) (((uintptr_t) __builtin_frame_address(0)) & \ 52 (~((uintptr_t) STACK_SIZE - 1)))) 45 #define CURRENT ((current_t * )(get_stack_base())) 53 46 54 #define MAGIC UINT32_C(0xfacefeed)47 #define MAGIC UINT32_C(0xfacefeed) 55 48 56 49 #define container_check(ctn1, ctn2) ((ctn1) == (ctn2)) … … 66 59 struct as; 67 60 68 /** Current structure 69 * 61 /** 70 62 * For each possible kernel stack, structure 71 63 * of the following type will be placed at 72 64 * the base address of the stack. 73 *74 65 */ 75 66 typedef struct { 76 size_t preemption; 77 struct thread *thread; 78 struct task *task; 79 struct cpu *cpu; /**< Executing CPU. */80 struct as *as; 81 uint32_t magic; /**< Magic value.*/67 size_t preemption; /**< Preemption disabled counter and flag. */ 68 struct thread *thread; /**< Current thread. */ 69 struct task *task; /**< Current task. */ 70 struct cpu *cpu; /**< Executing cpu. */ 71 struct as *as; /**< Current address space. */ 72 uint32_t magic; /**< Magic value */ 82 73 } current_t; 83 74 … … 98 89 } while (0) 99 90 100 #define ARCH_OP(op) 91 #define ARCH_OP(op) ARCH_STRUCT_OP(arch_ops, op) 101 92 102 93 extern void current_initialize(current_t *);
Note:
See TracChangeset
for help on using the changeset viewer.