Changeset f2cb80a in mainline for kernel/generic/src/time/clock.c


Ignore:
Timestamp:
2024-02-23T17:57:23Z (11 months ago)
Author:
GitHub <noreply@…>
Children:
192019f
Parents:
86f862c (diff), 90ba06c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2024-02-23 17:57:23)
git-committer:
GitHub <noreply@…> (2024-02-23 17:57:23)
Message:

Merge branch 'HelenOS:master' into topic/packet-capture

File:
1 edited

Legend:

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

    r86f862c rf2cb80a  
    123123static void cpu_update_accounting(void)
    124124{
     125        // FIXME: get_cycle() is unimplemented on several platforms
    125126        uint64_t now = get_cycle();
    126         atomic_time_increment(&CPU->busy_cycles, now - CPU->last_cycle);
    127         CPU->last_cycle = now;
     127        atomic_time_increment(&CPU->busy_cycles, now - CPU_LOCAL->last_cycle);
     128        CPU_LOCAL->last_cycle = now;
    128129}
    129130
     
    137138void clock(void)
    138139{
    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;
     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;
    144145        clock_update_counters(current_clock_tick);
    145146
     
    186187
    187188        if (THREAD) {
    188                 if (current_clock_tick >= CPU->preempt_deadline && PREEMPTION_ENABLED) {
    189                         scheduler();
     189                if (current_clock_tick >= CPU_LOCAL->preempt_deadline && PREEMPTION_ENABLED) {
     190                        thread_yield();
    190191#ifdef CONFIG_UDEBUG
    191192                        /*
Note: See TracChangeset for help on using the changeset viewer.