9#ifndef UACPI_BAREBONES_MODE
11#ifndef UACPI_REDUCED_HARDWARE
12#define CALL_SLEEP_FN(name, state) \
13 (uacpi_is_hardware_reduced() ? \
14 name##_hw_reduced(state) : name##_hw_full(state))
16#define CALL_SLEEP_FN(name, state) name##_hw_reduced(state);
22#ifndef UACPI_REDUCED_HARDWARE
91 if (
state < UACPI_SLEEP_STATE_S4)
98 if (
state > UACPI_SLEEP_STATE_S3) {
106 while (stalled_time < (10 * 1000 * 1000)) {
126 }
while (wake_status != 1);
211 uacpi_trace(
"sleep state %d is not supported as %s was not found\n",
227 "invalid object type at pkg[0] => %s when evaluating %s\n",
244 "invalid object type when evaluating %s: "
245 "pkg[0] => %s, pkg[1] => %s\n",
path,
335 case UACPI_SLEEP_STATE_S0:
338 case UACPI_SLEEP_STATE_S1:
339 case UACPI_SLEEP_STATE_S2:
340 case UACPI_SLEEP_STATE_S3:
343 case UACPI_SLEEP_STATE_S4:
346 case UACPI_SLEEP_STATE_S5:
406 if (!fadt->sleep_control_reg.address || !fadt->sleep_status_reg.address)
420 if (
state < UACPI_SLEEP_STATE_S4)
443 }
while (wake_status != 1);
497 uacpi_error(
"invalid SLP_TYP values: 0x%02X:0x%02X\n",
539 struct acpi_gas *reset_reg = &fadt->reset_reg;
550 switch (reset_reg->address_space_id) {
570 .device = (reset_reg->address >> 32) & 0xFF,
571 .function = (reset_reg->address >> 16) & 0xFF,
579 pci_dev, reset_reg->address & 0xFFFF, fadt->reset_value
585 "unable to perform a reset: unsupported address space '%s' (%d)\n",
587 reset_reg->address_space_id
599 while (stalled_time < (1000 * 1000)) {
#define UACPI_ARCH_FLUSH_CPU_CACHE()
#define ACPI_SLP_CNT_SLP_EN_MASK
#define ACPI_PM1_CNT_SLP_TYP_MASK
#define ACPI_PM1_STS_CLEAR
#define ACPI_SLP_CNT_SLP_TYP_IDX
#define ACPI_SLP_CNT_SLP_TYP_MASK
#define ACPI_PM1_CNT_SLP_EN_MASK
#define ACPI_SLP_STS_CLEAR
#define ACPI_RESET_REG_SUP
#define ACPI_PM1_CNT_SLP_TYP_IDX
#define UACPI_ENSURE_INIT_LEVEL_AT_LEAST(lvl)
#define UACPI_SLEEP_TYP_INVALID
struct uacpi_runtime_context g_uacpi_rt_ctx
uacpi_object * uacpi_create_object(uacpi_object_type type)
uacpi_namespace_node * uacpi_namespace_get_predefined(uacpi_predefined_namespace)
@ UACPI_PREDEFINED_NAMESPACE_SI
uacpi_namespace_node * uacpi_namespace_root(void)
@ UACPI_REGISTER_FIELD_WAK_STS
@ UACPI_REGISTER_FIELD_HWR_WAK_STS
uacpi_status uacpi_read_register_field(uacpi_register_field, uacpi_u64 *)
uacpi_status uacpi_read_register(uacpi_register, uacpi_u64 *)
uacpi_status uacpi_write_register(uacpi_register, uacpi_u64)
uacpi_status uacpi_write_registers(uacpi_register, uacpi_u64, uacpi_u64)
uacpi_status uacpi_write_register_field(uacpi_register_field, uacpi_u64)
#define uacpi_unlikely_error(expr)
@ UACPI_STATUS_INVALID_ARGUMENT
@ UACPI_STATUS_UNIMPLEMENTED
@ UACPI_STATUS_OUT_OF_MEMORY
@ UACPI_STATUS_AML_INCOMPATIBLE_OBJECT_TYPE
@ UACPI_STATUS_AML_BAD_ENCODING
@ UACPI_STATUS_HARDWARE_TIMEOUT
const uacpi_char * uacpi_status_to_string(uacpi_status)
const uacpi_char * uacpi_address_space_to_string(uacpi_address_space space)
@ UACPI_OBJECT_PACKAGE_BIT
uacpi_u64 uacpi_phys_addr
const uacpi_char * uacpi_object_type_to_string(uacpi_object_type)
@ UACPI_INIT_LEVEL_SUBSYSTEM_INITIALIZED
@ UACPI_INIT_LEVEL_NAMESPACE_INITIALIZED
@ UACPI_ADDRESS_SPACE_SYSTEM_MEMORY
@ UACPI_ADDRESS_SPACE_PCI_CONFIG
@ UACPI_ADDRESS_SPACE_SYSTEM_IO
void uacpi_object_unref(uacpi_object *obj)
uacpi_status uacpi_enable_all_wake_gpes(void)
uacpi_status uacpi_disable_all_gpes(void)
uacpi_status uacpi_enable_all_runtime_gpes(void)
uacpi_status uacpi_clear_all_events(void)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
uacpi_status uacpi_kernel_io_map(uacpi_io_addr base, uacpi_size len, uacpi_handle *out_handle)
void uacpi_kernel_pci_device_close(uacpi_handle)
uacpi_status uacpi_kernel_io_write8(uacpi_handle, uacpi_size offset, uacpi_u8 in_value)
void uacpi_kernel_stall(uacpi_u8 usec)
uacpi_status uacpi_kernel_pci_device_open(uacpi_pci_address address, uacpi_handle *out_handle)
uacpi_status uacpi_kernel_pci_write8(uacpi_handle device, uacpi_size offset, uacpi_u8 value)
void uacpi_kernel_io_unmap(uacpi_handle handle)
static uacpi_status enter_sleep_state_hw_reduced(uacpi_u8 state)
uacpi_status uacpi_enter_sleep_state(enum uacpi_sleep_state state_enum)
static uacpi_status eval_wak(uacpi_u8 state)
uacpi_status uacpi_prepare_for_wake_from_sleep_state(uacpi_sleep_state state_enum)
#define CALL_SLEEP_FN(name, state)
static uacpi_status eval_sst(uacpi_u8 value)
static uacpi_status get_slp_type_for_state(uacpi_u8 state, uacpi_u8 *a, uacpi_u8 *b)
uacpi_status uacpi_wake_from_sleep_state(uacpi_sleep_state state_enum)
static uacpi_status prepare_for_wake_from_sleep_state_hw_reduced(uacpi_u8 state)
uacpi_status uacpi_reboot(void)
static uacpi_u8 make_hw_reduced_sleep_control(uacpi_u8 slp_typ)
static uacpi_status prepare_for_wake_from_sleep_state_hw_full(uacpi_u8 state)
uacpi_status uacpi_set_waking_vector(uacpi_phys_addr addr32, uacpi_phys_addr addr64)
uacpi_status uacpi_prepare_for_sleep_state(enum uacpi_sleep_state state_enum)
static uacpi_status wake_from_sleep_state_hw_reduced(uacpi_u8 state)
static uacpi_status wake_from_sleep_state_hw_full(uacpi_u8 state)
static uacpi_status eval_pts(uacpi_u8 state)
static uacpi_status enter_sleep_state_hw_full(uacpi_u8 state)
static uacpi_status eval_sst_for_state(enum uacpi_sleep_state state)
static uacpi_status eval_sleep_helper(uacpi_namespace_node *parent, const uacpi_char *path, uacpi_u8 value)
uacpi_u64 x_firmware_waking_vector
uacpi_u32 firmware_waking_vector
uacpi_status uacpi_eval(uacpi_namespace_node *parent, const uacpi_char *path, const uacpi_object_array *args, uacpi_object **ret)
uacpi_status uacpi_eval_typed(uacpi_namespace_node *parent, const uacpi_char *path, const uacpi_object_array *args, uacpi_object_type_bits ret_mask, uacpi_object **ret)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out