AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
smp.c File Reference

aarch64 runs on one CPU only, so far. More...

#include <core/system.h>
#include <sys/cpu.h>
#include <sys/lock.h>

Go to the source code of this file.

Functions

void arch_cpu_kick (struct cpu *cpu)
 Makes another CPU enter the kernel now, with an inter-processor interrupt: to run a thread that just became ready if it's idle, or so that its thread sees it was killed or takes its signals.
void arch_lock_spin (void)
 Runs in the kernel lock's wait loop, on each turn.
void arch_lock_taken (void)
 Runs once this CPU has taken the kernel lock.

Detailed Description

aarch64 runs on one CPU only, so far.

The kernel lock's hooks and the wake IPI have nothing to do: no other CPU waits for the lock, and none is idle meanwhile.

Definition in file smp.c.

Function Documentation

◆ arch_cpu_kick()

void arch_cpu_kick ( struct cpu * cpu)

Makes another CPU enter the kernel now, with an inter-processor interrupt: to run a thread that just became ready if it's idle, or so that its thread sees it was killed or takes its signals.

Each architecture implements it; with one CPU, it does nothing.

Parameters
cputhe CPU

Definition at line 14 of file smp.c.

References arch_cpu_kick().

Referenced by arch_cpu_kick(), arch_sched_init(), sched_cpu_wake(), and sched_thread_kick().

◆ arch_lock_spin()

void arch_lock_spin ( void )

Runs in the kernel lock's wait loop, on each turn.

The architecture answers the requests that the lock's holder makes of the other CPUs (a TLB flush), which can't wait until the lock is free.

Definition at line 20 of file smp.c.

References arch_lock_spin().

Referenced by arch_lock_spin(), and kernel_lock().

◆ arch_lock_taken()

void arch_lock_taken ( void )

Runs once this CPU has taken the kernel lock.

The architecture catches up with what changed while it waited (the kernel's mappings).

Definition at line 25 of file smp.c.

References arch_lock_taken().

Referenced by arch_lock_taken(), and kernel_lock().