Changeset 4760793 in mainline for kernel/generic/src/cpu/cpu.c


Ignore:
Timestamp:
2024-01-14T18:23:40Z (4 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
5663872, c7ceacf
Parents:
3b68542
Message:

Add CPU_LOCAL alongside CPU and segregate fields that are only used locally

This makes it more clear which fields can be used without synchronization
and which need more care.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/cpu/cpu.c

    r3b68542 r4760793  
    8181                                panic("Cannot allocate CPU stack.");
    8282
    83                         cpus[i].stack = (uint8_t *) PA2KA(stack_phys);
     83                        cpus[i].local.stack = (uint8_t *) PA2KA(stack_phys);
    8484                        cpus[i].id = i;
    8585
     
    104104        CPU->tlb_active = true;
    105105
    106         CPU->idle = false;
    107         CPU->last_cycle = get_cycle();
     106        CPU_LOCAL->idle = false;
     107        CPU_LOCAL->last_cycle = get_cycle();
    108108        CPU->idle_cycles = ATOMIC_TIME_INITIALIZER();
    109109        CPU->busy_cycles = ATOMIC_TIME_INITIALIZER();
Note: See TracChangeset for help on using the changeset viewer.