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

Restarting and powering off the machine, by PSCI calls to the firmware (QEMU's), made with hvc, as the virt machine's devicetree says (/psci: method "hvc"). More...

#include <core/system.h>
#include <core/arch.h>

Go to the source code of this file.

Macros

#define PSCI_SYSTEM_OFF   0x84000008
#define PSCI_SYSTEM_RESET   0x84000009

Functions

static void psci (uint64_t fn)
 Calls a PSCI function.
void arch_reboot (void)
 Restarts the machine.
void arch_poweroff (void)
 Powers the machine off, or halts it if it can't be powered off.
void arch_halt (void)
 Stops the CPU for good, with interrupts off.

Detailed Description

Restarting and powering off the machine, by PSCI calls to the firmware (QEMU's), made with hvc, as the virt machine's devicetree says (/psci: method "hvc").

References: [1] - Arm Power State Coordination Interface (DEN 0022)

Definition in file psci.c.

Macro Definition Documentation

◆ PSCI_SYSTEM_OFF

#define PSCI_SYSTEM_OFF   0x84000008

Definition at line 14 of file psci.c.

Referenced by arch_poweroff().

◆ PSCI_SYSTEM_RESET

#define PSCI_SYSTEM_RESET   0x84000009

Definition at line 15 of file psci.c.

Referenced by arch_reboot().

Function Documentation

◆ arch_halt()

void arch_halt ( void )

Stops the CPU for good, with interrupts off.

Definition at line 38 of file psci.c.

References arch_halt(), and arch_interrupts_disable().

Referenced by arch_halt(), arch_poweroff(), and kernel_reboot().

◆ arch_poweroff()

void arch_poweroff ( void )

Powers the machine off, or halts it if it can't be powered off.

Definition at line 31 of file psci.c.

References arch_halt(), arch_poweroff(), psci(), and PSCI_SYSTEM_OFF.

Referenced by arch_poweroff(), and kernel_reboot().

◆ arch_reboot()

void arch_reboot ( void )

Restarts the machine.

Definition at line 25 of file psci.c.

References arch_reboot(), psci(), and PSCI_SYSTEM_RESET.

Referenced by arch_reboot(), kernel_ctrlaltdel(), kernel_reboot(), and proc_kill().

◆ psci()

void psci ( uint64_t fn)
static

Calls a PSCI function.

Definition at line 18 of file psci.c.

References psci().

Referenced by arch_poweroff(), arch_reboot(), and psci().