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/*
12 * Set the firmware waking vector in FACS.
13 *
14 * 'addr32' is the real mode entry-point address
15 * 'addr64' is the protected mode entry-point address
16 */
17UACPI_ALWAYS_ERROR_FOR_REDUCED_HARDWARE(
18uacpi_status uacpi_set_waking_vector(
19 uacpi_phys_addr addr32, uacpi_phys_addr addr64
20))
21
22typedef enum uacpi_sleep_state {
23 UACPI_SLEEP_STATE_S0 = 0,
24 UACPI_SLEEP_STATE_S1,
25 UACPI_SLEEP_STATE_S2,
26 UACPI_SLEEP_STATE_S3,
27 UACPI_SLEEP_STATE_S4,
28 UACPI_SLEEP_STATE_S5,
29 UACPI_SLEEP_STATE_MAX = UACPI_SLEEP_STATE_S5,
30} uacpi_sleep_state;
31
32/*
33 * Prepare for a given sleep state.
34 * Must be caled with interrupts ENABLED.
35 */
36uacpi_status uacpi_prepare_for_sleep_state(uacpi_sleep_state);
37
38/*
39 * Enter the given sleep state after preparation.
40 * Must be called with interrupts DISABLED.
41 */
42uacpi_status uacpi_enter_sleep_state(uacpi_sleep_state);
43
44/*
45 * Prepare to leave the given sleep state.
46 * Must be called with interrupts DISABLED.
47 */
48uacpi_status uacpi_prepare_for_wake_from_sleep_state(uacpi_sleep_state);
49
50/*
51 * Wake from the given sleep state.
52 * Must be called with interrupts ENABLED.
53 */
54uacpi_status uacpi_wake_from_sleep_state(uacpi_sleep_state);
55
56/*
57 * Attempt reset via the FADT reset register.
58 */
59uacpi_status uacpi_reboot(void);
60
61#ifdef __cplusplus
62}
63#endif
64