AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
cpu.h
Go to the documentation of this file.
1#ifndef _SYS_CPU_H
2#define _SYS_CPU_H
3
4#include <core/system.h>
5#include <cpu/cpu.h> /* struct arch_cpu, curcpu() */
6
7struct thread;
8
11struct cpu {
12 struct cpu *self; /* curcpu() reads it, so it comes first */
13 int id; /* its index in cpus[] */
14 struct thread *thread; /* the running thread (curthread), or NULL */
15 int idle; /* it runs no thread (kernel_idle()) */
16 int kicked; /* it was woken up to run one (sched_cpu_wake()) */
17 struct arch_cpu arch;
18};
19
20/* The most CPUs the kernel uses. */
21#define CPUS_MAX 32
22
23/* The CPUs; cpus[0] is the one that booted. */
24extern struct cpu cpus[CPUS_MAX];
25extern int cpus_count;
26
35void arch_cpu_kick(struct cpu *cpu);
36
37#endif /* ! _SYS_CPU_H */
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 ...
Definition smp.c:14
struct cpu cpus[CPUS_MAX]
Definition sched.c:28
int cpus_count
Definition sched.c:29
#define CPUS_MAX
Definition cpu.h:21
A CPU's aarch64 state (struct cpu's arch).
Definition cpu.h:51
A processor, and what runs on it.
Definition cpu.h:11
struct thread * thread
Definition cpu.h:14
int id
Definition cpu.h:13
int idle
Definition cpu.h:15
struct cpu * self
Definition cpu.h:12
struct arch_cpu arch
Definition cpu.h:17
int kicked
Definition cpu.h:16
A thread.
Definition thread.h:23