Changes in kernel/generic/include/cpu.h [31e15be:d23712e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cpu.h
r31e15be 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. … … 51 85 */ 52 86 typedef struct cpu { 53 IRQ_SPINLOCK_DECLARE( lock);87 IRQ_SPINLOCK_DECLARE(tlb_lock); 54 88 55 89 tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN]; 56 90 size_t tlb_messages_count; 57 91 58 context_t saved_context;59 60 92 atomic_size_t nrdy; 61 93 runq_t rq[RQ_COUNT]; 62 volatile size_t needs_relink;63 94 64 95 IRQ_SPINLOCK_DECLARE(timeoutlock); … … 66 97 67 98 /** 68 * When system clock loses a tick, it is69 * recorded here so that clock() can react.70 * This variable is CPU-local and can be71 * only accessed when interrupts are72 * disabled.73 */74 size_t missed_clock_ticks;75 76 /**77 99 * Processor cycle accounting. 78 100 */ 79 bool idle; 80 uint64_t last_cycle; 81 uint64_t idle_cycles; 82 uint64_t busy_cycles; 101 atomic_time_stat_t idle_cycles; 102 atomic_time_stat_t busy_cycles; 83 103 84 104 /** … … 95 115 cpu_arch_t arch; 96 116 97 struct thread *fpu_owner; 117 #ifdef CONFIG_FPU_LAZY 118 /* For synchronization between FPU trap and thread destructor. */ 119 IRQ_SPINLOCK_DECLARE(fpu_lock); 120 #endif 121 _Atomic(struct thread *) fpu_owner; 98 122 99 /** 100 * Stack used by scheduler when there is no running thread. 101 */ 102 uint8_t *stack; 123 cpu_local_t local; 103 124 } cpu_t; 104 125
Note:
See TracChangeset
for help on using the changeset viewer.