39 curcpu()->arch.tick_switch = 1;
57 asm volatile(
"msr daifclr, #2; wfi; msr daifset, #2" :::
"memory");
int aarch64_ctx_save(struct aarch64_ctx *ctx)
void aarch64_goto(uintptr_t fn, uintptr_t sp)
void arch_yield(void)
Puts the current thread at the end of the ready list, and runs the next ready thread.
static void sched_tick(void)
Runs the timer tick: charges the running process for it, and asks for a switch, which happens once th...
void arch_idle(void)
Makes this CPU idle, on its idle stack, until an interrupt makes a thread ready.
static uint64_t timer_period
static void __arch_idle(void)
Runs the idle loop, on the CPU's idle stack.
void arch_sleep(void)
Puts the current thread to sleep.
static void __arch_cur_thread_kill(void)
Frees the running thread, from the CPU's idle stack, and idles.
void arch_cur_thread_kill(void)
Ends the current thread.
void arch_sched_init(void)
Starts the timer tick on every CPU, and the clock where it needs to be started.
static uint64_t timer_ticks
void kfree(void *)
Frees an object that kmalloc() gave.
void kernel_unlock(void)
Lets go of the kernel lock, for the next CPU waiting for it.
int kernel_lock_held(void)
Says whether this CPU holds the kernel lock.
void kernel_idle(void)
Gives up the CPU when the current thread can't run anymore (it sleeps, or it exited): the next ready ...
void sched_timer_tick(uint32_t period, int user)
Runs the boot CPU's timer tick.
unsigned long long int uint64_t
What an exception saves on the kernel stack (cpu/vectors.S): the context it interrupted.
A thread's aarch64 state (thread->arch).
int thread_kill(struct thread *thread)
Releases what a thread holds (its poll() registrations, its CPU state and kernel stack) and makes it ...
void time_resync(void)
Sets the wall clock from the real time clock again, if they are 2 seconds or more apart.
struct aarch64_regs * aarch64_irq_regs
void aarch64_preempt(void)
Switches away from this CPU's running thread, which stays ready, to the next ready thread.
uint64_t timer_setup(uint64_t period_ns, void(*handler)(void))
Starts the tick.