Changeset 91a8f83 in mainline for kernel/generic/include
- Timestamp:
- 2018-10-31T18:15:56Z (7 years ago)
- Children:
- 071cb36
- Parents:
- 482f968
- Location:
- kernel/generic/include
- Files:
-
- 8 edited
-
arch.h (modified) (4 diffs)
-
cpu.h (modified) (1 diff)
-
mm/as.h (modified) (1 diff)
-
preemption.h (modified) (3 diffs)
-
proc/task.h (modified) (1 diff)
-
proc/thread.h (modified) (1 diff)
-
synch/rcu.h (modified) (2 diffs)
-
time/timeout.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/arch.h
r482f968 r91a8f83 40 40 41 41 /* 42 * THE is not an abbreviation, but the English definite article written in 43 * capital letters. It means the current pointer to something, e.g. thread, 44 * processor or address space. Kind reader of this comment shall appreciate 45 * the wit of constructs like THE->thread and similar. 42 * The context pointer. The current_t structure holds pointers to various parts 43 * of the current execution context, like running task, thread, address space, 44 * etc. 46 45 */ 47 #define THE ((the_t * )(get_stack_base()))46 #define CURRENT ((current_t * )(get_stack_base())) 48 47 49 48 #define MAGIC UINT32_C(0xfacefeed) … … 53 52 #define DEFAULT_CONTAINER 0 54 53 #define CONTAINER \ 55 (( THE->task) ? (THE->task->container) : (DEFAULT_CONTAINER))54 ((CURRENT->task) ? (CURRENT->task->container) : (DEFAULT_CONTAINER)) 56 55 57 56 /* Fwd decl. to avoid include hell. */ … … 76 75 struct as *as; /**< Current address space. */ 77 76 uint32_t magic; /**< Magic value */ 78 } the_t;77 } current_t; 79 78 80 79 typedef struct { … … 96 95 #define ARCH_OP(op) ARCH_STRUCT_OP(arch_ops, op) 97 96 98 extern void the_initialize(the_t *);99 extern void the_copy(the_t *, the_t *);97 extern void current_initialize(current_t *); 98 extern void current_copy(current_t *, current_t *); 100 99 101 100 extern void calibrate_delay_loop(void); -
kernel/generic/include/cpu.h
r482f968 r91a8f83 45 45 #include <arch.h> 46 46 47 #define CPU THE->cpu47 #define CPU CURRENT->cpu 48 48 49 49 /** CPU structure. -
kernel/generic/include/mm/as.h
r482f968 r91a8f83 50 50 #include <lib/refcount.h> 51 51 52 #define AS THE->as52 #define AS CURRENT->as 53 53 54 54 /** -
kernel/generic/include/preemption.h
r482f968 r91a8f83 41 41 42 42 #define PREEMPTION_INC (1 << 0) 43 #define PREEMPTION_DISABLED (PREEMPTION_INC <= THE->preemption)43 #define PREEMPTION_DISABLED (PREEMPTION_INC <= CURRENT->preemption) 44 44 #define PREEMPTION_ENABLED (!PREEMPTION_DISABLED) 45 45 … … 47 47 #define preemption_disable() \ 48 48 do { \ 49 THE->preemption += PREEMPTION_INC; \49 CURRENT->preemption += PREEMPTION_INC; \ 50 50 compiler_barrier(); \ 51 51 } while (0) … … 56 56 assert(PREEMPTION_DISABLED); \ 57 57 compiler_barrier(); \ 58 THE->preemption -= PREEMPTION_INC; \58 CURRENT->preemption -= PREEMPTION_INC; \ 59 59 } while (0) 60 60 -
kernel/generic/include/proc/task.h
r482f968 r91a8f83 63 63 #include <cap/cap.h> 64 64 65 #define TASK THE->task65 #define TASK CURRENT->task 66 66 67 67 struct thread; -
kernel/generic/include/proc/thread.h
r482f968 r91a8f83 52 52 #include <arch.h> 53 53 54 #define THREAD THE->thread54 #define THREAD CURRENT->thread 55 55 56 56 #define THREAD_NAME_BUFLEN 20 -
kernel/generic/include/synch/rcu.h
r482f968 r91a8f83 132 132 static inline void rcu_read_lock(void) 133 133 { 134 THE->rcu_nesting += RCU_CNT_INC;134 CURRENT->rcu_nesting += RCU_CNT_INC; 135 135 compiler_barrier(); 136 136 } … … 140 140 { 141 141 compiler_barrier(); 142 THE->rcu_nesting -= RCU_CNT_INC;143 144 if (RCU_WAS_PREEMPTED == THE->rcu_nesting) {142 CURRENT->rcu_nesting -= RCU_CNT_INC; 143 144 if (RCU_WAS_PREEMPTED == CURRENT->rcu_nesting) { 145 145 _rcu_preempted_unlock(); 146 146 } -
kernel/generic/include/time/timeout.h
r482f968 r91a8f83 45 45 IRQ_SPINLOCK_DECLARE(lock); 46 46 47 /** Link to the list of active timeouts on THE->cpu */47 /** Link to the list of active timeouts on CURRENT->cpu */ 48 48 link_t link; 49 49 /** Timeout will be activated in this amount of clock() ticks. */
Note:
See TracChangeset
for help on using the changeset viewer.
