forked from uACPI/uACPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsleep.h
67 lines (55 loc) · 1.45 KB
/
sleep.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <uacpi/types.h>
#include <uacpi/status.h>
#include <uacpi/uacpi.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef UACPI_BAREBONES_MODE
/*
* Set the firmware waking vector in FACS.
*
* 'addr32' is the real mode entry-point address
* 'addr64' is the protected mode entry-point address
*/
UACPI_ALWAYS_ERROR_FOR_REDUCED_HARDWARE(
uacpi_status uacpi_set_waking_vector(
uacpi_phys_addr addr32, uacpi_phys_addr addr64
))
typedef enum uacpi_sleep_state {
UACPI_SLEEP_STATE_S0 = 0,
UACPI_SLEEP_STATE_S1,
UACPI_SLEEP_STATE_S2,
UACPI_SLEEP_STATE_S3,
UACPI_SLEEP_STATE_S4,
UACPI_SLEEP_STATE_S5,
UACPI_SLEEP_STATE_MAX = UACPI_SLEEP_STATE_S5,
} uacpi_sleep_state;
/*
* Prepare for a given sleep state.
* Must be caled with interrupts ENABLED.
*/
uacpi_status uacpi_prepare_for_sleep_state(uacpi_sleep_state);
/*
* Enter the given sleep state after preparation.
* Must be called with interrupts DISABLED.
*/
uacpi_status uacpi_enter_sleep_state(uacpi_sleep_state);
/*
* Prepare to leave the given sleep state.
* Must be called with interrupts DISABLED.
*/
uacpi_status uacpi_prepare_for_wake_from_sleep_state(uacpi_sleep_state);
/*
* Wake from the given sleep state.
* Must be called with interrupts ENABLED.
*/
uacpi_status uacpi_wake_from_sleep_state(uacpi_sleep_state);
/*
* Attempt reset via the FADT reset register.
*/
uacpi_status uacpi_reboot(void);
#endif // !UACPI_BAREBONES_MODE
#ifdef __cplusplus
}
#endif