Changes in kernel/generic/include/cpu.h [f3dbe27:d23712e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cpu.h
rf3dbe27 rd23712e 44 44 #include <arch.h> 45 45 46 #define CPU CURRENT->cpu 46 #define CPU (CURRENT->cpu) 47 #define CPU_LOCAL (&CPU->local) 48 49 /** 50 * Contents of CPU_LOCAL. These are variables that are only ever accessed by 51 * the CPU they belong to, so they don't need any synchronization, 52 * just locally disabled interrupts. 53 */ 54 typedef struct cpu_local { 55 /** 56 * When system clock loses a tick, it is 57 * recorded here so that clock() can react. 58 */ 59 size_t missed_clock_ticks; 60 61 uint64_t current_clock_tick; 62 uint64_t preempt_deadline; /* < when should the currently running thread be preempted */ 63 uint64_t relink_deadline; 64 65 /** 66 * Stack used by scheduler when there is no running thread. 67 * This field is unchanged after initialization. 68 */ 69 uint8_t *stack; 70 71 /** 72 * Processor cycle accounting. 73 */ 74 bool idle; 75 uint64_t last_cycle; 76 77 context_t scheduler_context; 78 79 struct thread *prev_thread; 80 } cpu_local_t; 47 81 48 82 /** CPU structure. … … 63 97 64 98 /** 65 * When system clock loses a tick, it is66 * recorded here so that clock() can react.67 * This variable is CPU-local and can be68 * only accessed when interrupts are69 * disabled.70 */71 size_t missed_clock_ticks;72 73 /** Can only be accessed by the CPU represented by this structure when interrupts are disabled. */74 uint64_t current_clock_tick;75 uint64_t preempt_deadline; /* < when should the currently running thread be preempted */76 uint64_t relink_deadline;77 78 /**79 99 * Processor cycle accounting. 80 100 */ 81 bool idle;82 uint64_t last_cycle;83 101 atomic_time_stat_t idle_cycles; 84 102 atomic_time_stat_t busy_cycles; … … 103 121 _Atomic(struct thread *) fpu_owner; 104 122 105 /** 106 * Stack used by scheduler when there is no running thread. 107 */ 108 uint8_t *stack; 123 cpu_local_t local; 109 124 } cpu_t; 110 125
Note:
See TracChangeset
for help on using the changeset viewer.