AquilaOS documentation
How it works, and its code
Toggle main menu visibility
Loading...
Searching...
No Matches
reboot.c
Go to the documentation of this file.
1
4
5
#include <
core/system.h
>
6
#include <
core/arch.h
>
7
#include <
platform/misc.h
>
8
#include <
dev/i8042.h
>
9
12
void
platform_reboot
(
void
)
13
{
14
#ifdef CONFIG_DEV_I8042
15
i8042_reboot
();
16
#endif
17
}
18
19
/* Restarts the machine. */
20
void
arch_reboot
(
void
)
21
{
22
platform_reboot
();
23
}
24
25
/* Stops the CPU, with interrupts off, for good. */
26
void
arch_halt
(
void
)
27
{
28
for
(;;) {
29
arch_interrupts_disable
();
30
asm
volatile
(
"hlt"
);
31
}
32
}
33
34
/* Powers the machine off with ACPI; without ACPI, it stays halted. */
35
void
arch_poweroff
(
void
)
36
{
37
if
(
x86_acpi_poweroff
)
38
x86_acpi_poweroff
();
39
40
arch_halt
();
41
}
arch_interrupts_disable
static void arch_interrupts_disable(void)
Masks IRQs.
Definition
arch.h:77
platform_reboot
void platform_reboot(void)
Restarts the machine, through the keyboard controller, which can reset the CPU.
Definition
reboot.c:12
i8042_reboot
void i8042_reboot(void)
Resets the CPU, through the controller's output line: this reboots the PC.
Definition
i8042.c:123
i8042.h
arch.h
system.h
misc.h
x86_acpi_poweroff
void x86_acpi_poweroff(void)
Powers the machine off, by entering ACPI's S5 sleep state.
Definition
acpi.c:265
arch_reboot
void arch_reboot(void)
Restarts the machine.
Definition
psci.c:25
arch_halt
void arch_halt(void)
Stops the CPU for good, with interrupts off.
Definition
psci.c:38
arch_poweroff
void arch_poweroff(void)
Powers the machine off, or halts it if it can't be powered off.
Definition
psci.c:31
kernel
arch
i386
platform
pc
reboot.c
Generated by
1.18.0