AquilaOS documentation
How it works, and its code
Toggle main menu visibility
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
7
struct
thread
;
8
11
struct
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. */
24
extern
struct
cpu
cpus
[
CPUS_MAX
];
25
extern
int
cpus_count
;
26
35
void
arch_cpu_kick
(
struct
cpu
*
cpu
);
36
37
#endif
/* ! _SYS_CPU_H */
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 ...
Definition
smp.c:14
system.h
cpu.h
cpus
struct cpu cpus[CPUS_MAX]
Definition
sched.c:28
cpus_count
int cpus_count
Definition
sched.c:29
CPUS_MAX
#define CPUS_MAX
Definition
cpu.h:21
arch_cpu
A CPU's aarch64 state (struct cpu's arch).
Definition
cpu.h:51
cpu
A processor, and what runs on it.
Definition
cpu.h:11
cpu::thread
struct thread * thread
Definition
cpu.h:14
cpu::id
int id
Definition
cpu.h:13
cpu::idle
int idle
Definition
cpu.h:15
cpu::self
struct cpu * self
Definition
cpu.h:12
cpu::arch
struct arch_cpu arch
Definition
cpu.h:17
cpu::kicked
int kicked
Definition
cpu.h:16
thread
A thread.
Definition
thread.h:23
kernel
include
sys
cpu.h
Generated by
1.18.0