Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/time/clock.c

    r25939997 r169815e  
    123123static void cpu_update_accounting(void)
    124124{
    125         // FIXME: get_cycle() is unimplemented on several platforms
    126125        uint64_t now = get_cycle();
    127         atomic_time_increment(&CPU->busy_cycles, now - CPU_LOCAL->last_cycle);
    128         CPU_LOCAL->last_cycle = now;
     126        atomic_time_increment(&CPU->busy_cycles, now - CPU->last_cycle);
     127        CPU->last_cycle = now;
    129128}
    130129
     
    138137void clock(void)
    139138{
    140         size_t missed_clock_ticks = CPU_LOCAL->missed_clock_ticks;
    141         CPU_LOCAL->missed_clock_ticks = 0;
    142 
    143         CPU_LOCAL->current_clock_tick += missed_clock_ticks + 1;
    144         uint64_t current_clock_tick = CPU_LOCAL->current_clock_tick;
     139        size_t missed_clock_ticks = CPU->missed_clock_ticks;
     140        CPU->missed_clock_ticks = 0;
     141
     142        CPU->current_clock_tick += missed_clock_ticks + 1;
     143        uint64_t current_clock_tick = CPU->current_clock_tick;
    145144        clock_update_counters(current_clock_tick);
    146145
     
    187186
    188187        if (THREAD) {
    189                 if (current_clock_tick >= CPU_LOCAL->preempt_deadline && PREEMPTION_ENABLED) {
    190                         thread_yield();
     188                if (current_clock_tick >= CPU->preempt_deadline && PREEMPTION_ENABLED) {
     189                        scheduler();
    191190#ifdef CONFIG_UDEBUG
    192191                        /*
Note: See TracChangeset for help on using the changeset viewer.