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