Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/cpu.h

    rd23712e rf3dbe27  
    4444#include <arch.h>
    4545
    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;
     46#define CPU                  CURRENT->cpu
    8147
    8248/** CPU structure.
     
    9763
    9864        /**
     65         * When system clock loses a tick, it is
     66         * recorded here so that clock() can react.
     67         * This variable is CPU-local and can be
     68         * only accessed when interrupts are
     69         * 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        /**
    9979         * Processor cycle accounting.
    10080         */
     81        bool idle;
     82        uint64_t last_cycle;
    10183        atomic_time_stat_t idle_cycles;
    10284        atomic_time_stat_t busy_cycles;
     
    121103        _Atomic(struct thread *) fpu_owner;
    122104
    123         cpu_local_t local;
     105        /**
     106         * Stack used by scheduler when there is no running thread.
     107         */
     108        uint8_t *stack;
    124109} cpu_t;
    125110
Note: See TracChangeset for help on using the changeset viewer.