the arch part of per-CPU data: a segment base that points at the cpu_t of the core (kernel/cpu/cpu.h).
More...
Go to the source code of this file.
|
| void | arch_cpu_set_base (struct cpu *cpu) |
| | point the per-CPU segment of the core that runs the call at its cpu_t.
|
| void | arch_smp_reserve (void) |
| | keep a page of low memory for the start code of the other cores.
|
| bool | arch_smp_prepare (struct cpu *boot) |
| | get ready to start the other cores: copy the start code to its page and make the page tables it uses.
|
| bool | arch_cpu_start (struct cpu *cpu) |
| | start one core and wait up to 100 ms for it to say it is online.
|
| void | arch_smp_finish (bool all_started) |
| | release what only the start of the cores used.
|
| void | arch_cpu_model (char *buffer, size_t size) |
| | the model name of the CPU, as the CPU gives it (the CPUID brand string on x86), or "unknown".
|
| void | arch_cpu_send_ipi (const struct cpu *cpu, arch_ipi_t ipi) |
| | send an interrupt to another core.
|
the arch part of per-CPU data: a segment base that points at the cpu_t of the core (kernel/cpu/cpu.h).
x86_64 uses the GS base, i686 a GDT entry in FS, as in Linux.
◆ ARCH_CPU_MODEL_MAX
| #define ARCH_CPU_MODEL_MAX 49 |
◆ arch_ipi_t
the kinds of interrupts one core sends to another
| Enumerator |
|---|
| ARCH_IPI_TLB_FLUSH | |
| ARCH_IPI_RESCHEDULE | |
| ARCH_IPI_STOP | |
◆ arch_cpu_set_base()
| void arch_cpu_set_base |
( |
struct cpu * | cpu | ) |
|
point the per-CPU segment of the core that runs the call at its cpu_t.
the first field of a cpu_t must point at the cpu_t itself.
- Parameters
-
| cpu | the data of this core. |
◆ arch_smp_reserve()
| void arch_smp_reserve |
( |
void | | ) |
|
keep a page of low memory for the start code of the other cores.
call it right after pmm_init, before other allocations can take that memory.
◆ arch_smp_prepare()
| bool arch_smp_prepare |
( |
struct cpu * | boot | ) |
|
get ready to start the other cores: copy the start code to its page and make the page tables it uses.
it also sets the hardware id of the boot core in its cpu_t.
- Parameters
-
| boot | the cpu_t of the boot core. |
- Returns
- false if the other cores cannot start (no local APIC, no low page or no memory).
◆ arch_cpu_start()
| bool arch_cpu_start |
( |
struct cpu * | cpu | ) |
|
start one core and wait up to 100 ms for it to say it is online.
- Parameters
-
| cpu | its cpu_t, with index, apic_id and idle_stack set. |
- Returns
- true if the core runs.
◆ arch_smp_finish()
| void arch_smp_finish |
( |
bool | all_started | ) |
|
release what only the start of the cores used.
- Parameters
-
| all_started | false if a core did not answer: then the start code and its page tables stay, because that core can still start late. |
◆ arch_cpu_model()
| void arch_cpu_model |
( |
char * | buffer, |
|
|
size_t | size ) |
the model name of the CPU, as the CPU gives it (the CPUID brand string on x86), or "unknown".
- Parameters
-
| buffer | receives the name, terminated by 0. |
| size | the size of buffer, at most ARCH_CPU_MODEL_MAX is used. |
◆ arch_cpu_send_ipi()
| void arch_cpu_send_ipi |
( |
const struct cpu * | cpu, |
|
|
arch_ipi_t | ipi ) |
send an interrupt to another core.
- Parameters
-
| cpu | the core; it must be online. |
| ipi | what the core is to do. |