1#pragma once
2
3#include <uacpi/types.h>
4#include <uacpi/status.h>
5#include <uacpi/uacpi.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#ifndef UACPI_BAREBONES_MODE
12
13/**
14 * Set the firmware waking vector in FACS.
15 *
16 * 'addr32' is the real mode entry-point address
17 * 'addr64' is the protected mode entry-point address
18 */
19UACPI_ALWAYS_ERROR_FOR_REDUCED_HARDWARE(
20uacpi_status uacpi_set_waking_vector(
21 uacpi_phys_addr addr32, uacpi_phys_addr addr64
22))
23
24typedef enum uacpi_sleep_state {
25 UACPI_SLEEP_STATE_S0 = 0,
26 UACPI_SLEEP_STATE_S1,
27 UACPI_SLEEP_STATE_S2,
28 UACPI_SLEEP_STATE_S3,
29 UACPI_SLEEP_STATE_S4,
30 UACPI_SLEEP_STATE_S5,
31 UACPI_SLEEP_STATE_MAX = UACPI_SLEEP_STATE_S5,
32} uacpi_sleep_state;
33
34/**
35 * Prepare for a given sleep state.
36 */
37uacpi_status uacpi_prepare_for_sleep_state(uacpi_sleep_state);
38
39/**
40 * Enter the given sleep state after preparation.
41 */
42uacpi_status uacpi_enter_sleep_state(uacpi_sleep_state);
43
44/**
45 * Prepare & enter a given sleep state
46 * May be used as a shortcut if the kernel doesn't have any other work to do
47 * inbetween calling the two separate helpers
48 */
49uacpi_status uacpi_enter_sleep_state_simple(uacpi_sleep_state);
50
51/**
52 * Prepare to leave the given sleep state.
53 */
54uacpi_status uacpi_prepare_for_wake_from_sleep_state(uacpi_sleep_state);
55
56/**
57 * Wake from the given sleep state.
58 */
59uacpi_status uacpi_wake_from_sleep_state(uacpi_sleep_state);
60
61/**
62 * Attempt reset via the FADT reset register.
63 */
64uacpi_status uacpi_reboot(void);
65
66#endif // !UACPI_BAREBONES_MODE
67
68#ifdef __cplusplus
69}
70#endif
71