Changes in kernel/generic/include/cpu.h [d23712e:d19b3fc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cpu.h
rd23712e rd19b3fc 44 44 #include <arch.h> 45 45 46 #define CPU (CURRENT->cpu) 47 #define CPU_LOCAL (&CPU->local) 46 #define CPU CURRENT->cpu 48 47 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. 48 /** CPU structure. 49 * 50 * There is one structure like this for every processor. 53 51 */ 54 typedef struct cpu_local { 52 typedef struct cpu { 53 IRQ_SPINLOCK_DECLARE(lock); 54 55 tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN]; 56 size_t tlb_messages_count; 57 58 context_t saved_context; 59 60 atomic_t nrdy; 61 runq_t rq[RQ_COUNT]; 62 volatile size_t needs_relink; 63 64 IRQ_SPINLOCK_DECLARE(timeoutlock); 65 list_t timeout_active_list; 66 55 67 /** 56 68 * When system clock loses a tick, it is 57 69 * recorded here so that clock() can react. 70 * This variable is CPU-local and can be 71 * only accessed when interrupts are 72 * disabled. 58 73 */ 59 74 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 75 71 76 /** … … 74 79 bool idle; 75 80 uint64_t last_cycle; 76 77 context_t scheduler_context; 78 79 struct thread *prev_thread; 80 } cpu_local_t; 81 82 /** CPU structure. 83 * 84 * There is one structure like this for every processor. 85 */ 86 typedef struct cpu { 87 IRQ_SPINLOCK_DECLARE(tlb_lock); 88 89 tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN]; 90 size_t tlb_messages_count; 91 92 atomic_size_t nrdy; 93 runq_t rq[RQ_COUNT]; 94 95 IRQ_SPINLOCK_DECLARE(timeoutlock); 96 list_t timeout_active_list; 97 98 /** 99 * Processor cycle accounting. 100 */ 101 atomic_time_stat_t idle_cycles; 102 atomic_time_stat_t busy_cycles; 81 uint64_t idle_cycles; 82 uint64_t busy_cycles; 103 83 104 84 /** … … 115 95 cpu_arch_t arch; 116 96 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; 97 struct thread *fpu_owner; 122 98 123 cpu_local_t local; 99 /** 100 * Stack used by scheduler when there is no running thread. 101 */ 102 uint8_t *stack; 124 103 } cpu_t; 125 104
Note:
See TracChangeset
for help on using the changeset viewer.