|
ReactOS 0.4.17-dev-1196-gb6224c3
|

Go to the source code of this file.
| uacpi_status uacpi_kernel_acquire_mutex | ( | uacpi_handle | Handle, |
| uacpi_u16 | Timeout | ||
| ) |
Definition at line 152 of file uacpiosl.c.
| void * uacpi_kernel_alloc | ( | uacpi_size | size | ) |
Read/write to previously mapped memory
If UACPI_NATIVE_MMIO is not defined, uACPI uses builtin generic MMIO helpers that use simple volatile stores/loads. Allocate a block of memory of 'size' bytes. The contents of the allocated memory are unspecified.
Definition at line 111 of file uacpiosl.c.
Referenced by buffer_alloc(), buffer_to_string(), do_install_gpe_handler(), handle_buffer(), handle_concatenate(), handle_concatenate_res(), handle_create_method(), handle_load(), handle_mid(), handle_special_field(), handle_string(), handle_to(), handle_to_string(), integer_to_string(), io_region_attach(), make_object_for_predefined(), memory_region_attach(), name_string_to_path(), uacpi_builtin_alloc_zeroed(), uacpi_eval_cid(), uacpi_eval_cls(), uacpi_eval_hid(), uacpi_eval_uid(), uacpi_get_namespace_node_info(), uacpi_get_pci_routing_table(), uacpi_initialize_tables(), uacpi_install_address_space_handler_with_flags(), uacpi_install_interface(), uacpi_map_gas(), uacpi_namespace_node_generate_absolute_path(), uacpi_notify_all(), and uacpi_setup_gpe_for_wake().
| void * uacpi_kernel_calloc | ( | uacpi_size | count, |
| uacpi_size | size | ||
| ) |
Definition at line 118 of file uacpiosl.c.
| uacpi_handle uacpi_kernel_create_event | ( | void | ) |
Definition at line 53 of file uacpiosl.c.
| uacpi_handle uacpi_kernel_create_mutex | ( | void | ) |
Definition at line 139 of file uacpiosl.c.
| uacpi_handle uacpi_kernel_create_spinlock | ( | void | ) |
Create/free a kernel spinlock object.
Unlike other types of locks, spinlocks may be used in interrupt contexts.
Definition at line 85 of file uacpiosl.c.
Referenced by uacpi_initialize_events(), uacpi_initialize_events_early(), and uacpi_initialize_registers().
Free a previously allocated memory block.
'mem' might be a NULL pointer. In this case, the call is assumed to be a no-op.
An optionally enabled 'size_hint' parameter contains the size of the original allocation. Note that in some scenarios this incurs additional cost to calculate the object size.
Definition at line 126 of file uacpiosl.c.
| void uacpi_kernel_free_event | ( | uacpi_handle | Handle | ) |
Definition at line 60 of file uacpiosl.c.
| void uacpi_kernel_free_mutex | ( | uacpi_handle | handle | ) |
Definition at line 146 of file uacpiosl.c.
| void uacpi_kernel_free_spinlock | ( | uacpi_handle | Handle | ) |
Definition at line 92 of file uacpiosl.c.
Referenced by uacpi_deinitialize_events(), uacpi_deinitialize_registers(), and uacpi_state_reset().
Returns the number of nanosecond ticks elapsed since boot, strictly monotonic.
Definition at line 35 of file uacpiosl.c.
Referenced by begin_block_execution(), handle_timer(), uacpi_namespace_initialize(), and uacpi_namespace_load().
| uacpi_status uacpi_kernel_get_rsdp | ( | uacpi_phys_addr * | out_rdsp_address | ) |
Definition at line 204 of file uacpiosl.c.
Referenced by initialize_from_rsdp().
| uacpi_thread_id uacpi_kernel_get_thread_id | ( | void | ) |
Returns a unique identifier of the currently executing thread.
The returned thread id cannot be UACPI_THREAD_ID_NONE.
Definition at line 184 of file uacpiosl.c.
Referenced by uacpi_acquire_aml_mutex(), uacpi_recursive_lock_acquire(), and uacpi_this_thread_owns_aml_mutex().
| uacpi_status uacpi_kernel_handle_firmware_request | ( | uacpi_firmware_request * | Req | ) |
Handle a firmware request.
Currently either a Breakpoint or Fatal operators.
Definition at line 177 of file uacpiosl.c.
Referenced by handle_firmware_request().
| uacpi_status uacpi_kernel_install_interrupt_handler | ( | uacpi_u32 | irq, |
| uacpi_interrupt_handler | handler, | ||
| uacpi_handle | ctx, | ||
| uacpi_handle * | out_irq_handle | ||
| ) |
Install an interrupt handler at 'irq', 'ctx' is passed to the provided handler for every invocation.
'out_irq_handle' is set to a kernel-implemented value that can be used to refer to this handler from other API.
Definition at line 212 of file uacpiosl.c.
Referenced by find_or_create_gpe_interrupt_ctx(), and uacpi_initialize_events().
| uacpi_status uacpi_kernel_io_map | ( | uacpi_io_addr | base, |
| uacpi_size | len, | ||
| uacpi_handle * | out_handle | ||
| ) |
Map a SystemIO address at [base, base + len) and return a kernel-implemented handle that can be used for reading and writing the IO range.
NOTE: The x86 architecture uses the in/out family of instructions to access the SystemIO address space.
Definition at line 165 of file uacpiosl.c.
Referenced by io_region_attach(), uacpi_map_gas_noalloc(), and uacpi_reboot().
| uacpi_status uacpi_kernel_io_read16 | ( | uacpi_handle | handle, |
| uacpi_size | offset, | ||
| uacpi_u16 * | out_value | ||
| ) |
Definition at line 306 of file uacpiosl.c.
Referenced by uacpi_system_io_read().
| uacpi_status uacpi_kernel_io_read32 | ( | uacpi_handle | handle, |
| uacpi_size | offset, | ||
| uacpi_u32 * | out_value | ||
| ) |
Definition at line 313 of file uacpiosl.c.
Referenced by uacpi_system_io_read().
| uacpi_status uacpi_kernel_io_read8 | ( | uacpi_handle | handle, |
| uacpi_size | offset, | ||
| uacpi_u8 * | out_value | ||
| ) |
Read/Write the IO range mapped via uacpi_kernel_io_map at a 0-based 'offset' within the range.
NOTE: The x86 architecture uses the in/out family of instructions to access the SystemIO address space.
You are NOT allowed to break e.g. a 4-byte access into four 1-byte accesses. Hardware ALWAYS expects accesses to be of the exact width.
Definition at line 299 of file uacpiosl.c.
Referenced by uacpi_system_io_read().
| void uacpi_kernel_io_unmap | ( | uacpi_handle | handle | ) |
Definition at line 171 of file uacpiosl.c.
Referenced by io_region_detach(), uacpi_reboot(), and unmap_gas_io().
| uacpi_status uacpi_kernel_io_write16 | ( | uacpi_handle | handle, |
| uacpi_size | offset, | ||
| uacpi_u16 | in_value | ||
| ) |
Definition at line 327 of file uacpiosl.c.
Referenced by uacpi_system_io_write().
| uacpi_status uacpi_kernel_io_write32 | ( | uacpi_handle | handle, |
| uacpi_size | offset, | ||
| uacpi_u32 | in_value | ||
| ) |
Definition at line 334 of file uacpiosl.c.
Referenced by uacpi_system_io_write().
| uacpi_status uacpi_kernel_io_write8 | ( | uacpi_handle | handle, |
| uacpi_size | offset, | ||
| uacpi_u8 | in_value | ||
| ) |
Definition at line 320 of file uacpiosl.c.
Referenced by uacpi_reboot(), and uacpi_system_io_write().
| uacpi_cpu_flags uacpi_kernel_lock_spinlock | ( | uacpi_handle | Handle | ) |
Lock/unlock helpers for spinlocks.
These are expected to disable interrupts, returning the previous state of cpu flags, that can be used to possibly re-enable interrupts if they were enabled before.
Note that lock is infalliable.
Definition at line 98 of file uacpiosl.c.
Referenced by create_gpe_block(), detect_gpes(), dispatch_fixed_event(), dispatch_gpe(), do_initialize_gpe_block(), ensure_register_mapped(), find_or_create_gpe_interrupt_ctx(), gpe_add_user(), gpe_block_apply_action(), gpe_disarm(), gpe_drop_claim(), gpe_enable_disable_for_wake(), gpe_is_armed(), gpe_mask_and_flush(), gpe_mask_safe(), gpe_mask_unmask(), gpe_remove_user(), gpe_set_handler(), gpe_suspend_resume(), gpe_try_claim(), gpe_work_done(), handle_global_lock(), restore_gpe(), set_gpe_state(), uacpi_acquire_global_lock_from_firmware(), uacpi_clear_gpe(), uacpi_disable_fixed_event(), uacpi_disable_gpe(), uacpi_enable_fixed_event(), uacpi_events_restore_buttons_post_wake(), uacpi_finish_handling_gpe(), uacpi_fixed_event_info(), uacpi_gpe_info(), uacpi_install_fixed_event_handler(), uacpi_setup_gpe_for_wake(), uacpi_uninstall_fixed_event_handler(), uacpi_write_register_field(), uninstall_gpe_block(), and unlink_gpe_interrupt_ctx().
| void uacpi_kernel_log | ( | uacpi_log_level | Level, |
| const uacpi_char * | Char | ||
| ) |
| void * uacpi_kernel_map | ( | uacpi_phys_addr | addr, |
| uacpi_size | len | ||
| ) |
Map a physical memory range starting at 'addr' with length 'len', and return a virtual address that can be used to access it. UACPI_MAP_FAILED is returned in case the operation wasn't successful.
NOTE: 'addr' may be misaligned, in this case the host is expected to round it down to the nearest page-aligned boundary and map that, while making sure that at least 'len' bytes are still mapped starting at 'addr'. The return value preserves the misaligned offset.
Example for uacpi_kernel_map(0x1ABC, 0xF00):
Definition at line 191 of file uacpiosl.c.
Referenced by get_external_table_header(), handle_load(), initialize_from_rsdp(), initialize_from_rxsdt(), memory_region_attach(), table_install_physical_with_origin_unlocked(), table_ref_unlocked(), uacpi_map_gas_noalloc(), and verify_and_install_table().
| void uacpi_kernel_pci_device_close | ( | uacpi_handle | Handle | ) |
Definition at line 251 of file uacpiosl.c.
Referenced by pci_region_device_close(), and uacpi_reboot().
| uacpi_status uacpi_kernel_pci_device_open | ( | uacpi_pci_address | address, |
| uacpi_handle * | out_handle | ||
| ) |
Only the above ^^^ API may be used by early table access and UACPI_BAREBONES_MODE. Convenience initialization/deinitialization hooks that will be called by uACPI automatically when appropriate if compiled-in. Open a PCI device at 'address' for reading & writing.
The device at 'address' might not actually exist on the system, in this case the api is allowed to return UACPI_STATUS_NOT_FOUND to indicate that, this error is handled gracefully by returning 0xFF on reads and ignoring writes. This is to support a common pattern in AML that probes for 0xFF reads to detect whether a device exists. The open is attempted again on the next access to the device, to support hotplug & wake-from-suspend.
The handle returned via 'out_handle' is used to perform IO on the configuration space of the device.
Definition at line 242 of file uacpiosl.c.
Referenced by pci_region_device_open(), and uacpi_reboot().
| uacpi_status uacpi_kernel_pci_read16 | ( | uacpi_handle | device, |
| uacpi_size | offset, | ||
| uacpi_u16 * | value | ||
| ) |
Definition at line 264 of file uacpiosl.c.
Referenced by uacpi_pci_read().
| uacpi_status uacpi_kernel_pci_read32 | ( | uacpi_handle | device, |
| uacpi_size | offset, | ||
| uacpi_u32 * | value | ||
| ) |
Definition at line 271 of file uacpiosl.c.
Referenced by uacpi_pci_read().
| uacpi_status uacpi_kernel_pci_read8 | ( | uacpi_handle | device, |
| uacpi_size | offset, | ||
| uacpi_u8 * | value | ||
| ) |
Read & write the configuration space of a previously open PCI device.
Definition at line 257 of file uacpiosl.c.
Referenced by pci_region_device_probe(), pci_write_is_protected(), and uacpi_pci_read().
| uacpi_status uacpi_kernel_pci_write16 | ( | uacpi_handle | device, |
| uacpi_size | offset, | ||
| uacpi_u16 | value | ||
| ) |
Definition at line 285 of file uacpiosl.c.
Referenced by uacpi_pci_write().
| uacpi_status uacpi_kernel_pci_write32 | ( | uacpi_handle | device, |
| uacpi_size | offset, | ||
| uacpi_u32 | va_list | ||
| ) |
Definition at line 292 of file uacpiosl.c.
Referenced by uacpi_pci_write().
| uacpi_status uacpi_kernel_pci_write8 | ( | uacpi_handle | device, |
| uacpi_size | offset, | ||
| uacpi_u8 | value | ||
| ) |
Definition at line 278 of file uacpiosl.c.
Referenced by uacpi_pci_write(), and uacpi_reboot().
| void uacpi_kernel_release_mutex | ( | uacpi_handle | Handle | ) |
Definition at line 159 of file uacpiosl.c.
| void uacpi_kernel_reset_event | ( | uacpi_handle | Handle | ) |
Definition at line 79 of file uacpiosl.c.
| uacpi_status uacpi_kernel_schedule_work | ( | uacpi_work_type | type, |
| uacpi_work_handler | Handler, | ||
| uacpi_handle | ctx | ||
| ) |
Definition at line 228 of file uacpiosl.c.
| void uacpi_kernel_signal_event | ( | uacpi_handle | Handle | ) |
Definition at line 73 of file uacpiosl.c.
Sleep for N milliseconds.
Definition at line 47 of file uacpiosl.c.
Referenced by handle_stall_or_sleep().
Spin for N microseconds.
Definition at line 42 of file uacpiosl.c.
Referenced by enter_sleep_state_hw_full(), handle_stall_or_sleep(), set_mode(), and uacpi_reboot().
| uacpi_status uacpi_kernel_uninstall_interrupt_handler | ( | uacpi_interrupt_handler | handler, |
| uacpi_handle | irq_handle | ||
| ) |
Uninstall an interrupt handler. 'irq_handle' is the value returned via 'out_irq_handle' during installation.
Definition at line 221 of file uacpiosl.c.
Referenced by uacpi_deinitialize_events(), and unlink_gpe_interrupt_ctx().
| void uacpi_kernel_unlock_spinlock | ( | uacpi_handle | Handle, |
| uacpi_cpu_flags | Flags | ||
| ) |
Definition at line 105 of file uacpiosl.c.
Referenced by create_gpe_block(), detect_gpes(), dispatch_fixed_event(), dispatch_gpe(), do_initialize_gpe_block(), ensure_register_mapped(), find_or_create_gpe_interrupt_ctx(), gpe_add_user(), gpe_block_apply_action(), gpe_disarm(), gpe_drop_claim(), gpe_enable_disable_for_wake(), gpe_is_armed(), gpe_mask_and_flush(), gpe_mask_safe(), gpe_mask_unmask(), gpe_remove_user(), gpe_set_handler(), gpe_suspend_resume(), gpe_try_claim(), gpe_work_done(), handle_global_lock(), restore_gpe(), set_gpe_state(), uacpi_acquire_global_lock_from_firmware(), uacpi_clear_gpe(), uacpi_disable_fixed_event(), uacpi_disable_gpe(), uacpi_enable_fixed_event(), uacpi_events_restore_buttons_post_wake(), uacpi_finish_handling_gpe(), uacpi_fixed_event_info(), uacpi_gpe_info(), uacpi_install_fixed_event_handler(), uacpi_setup_gpe_for_wake(), uacpi_uninstall_fixed_event_handler(), uacpi_write_register_field(), uninstall_gpe_block(), and unlink_gpe_interrupt_ctx().
| void uacpi_kernel_unmap | ( | void * | addr, |
| uacpi_size | len | ||
| ) |
Unmap a virtual memory range at 'addr' with a length of 'len' bytes.
NOTE: 'addr' may be misaligned, see the comment above 'uacpi_kernel_map'. Similar steps to uacpi_kernel_map can be taken to retrieve the virtual address originally returned by the VMM for this mapping as well as its true length.
Definition at line 198 of file uacpiosl.c.
Referenced by get_external_table_header(), handle_load(), initialize_from_rsdp(), initialize_from_rxsdt(), memory_region_detach(), table_install_physical_with_origin_unlocked(), table_ref_unlocked(), table_unref_unlocked(), uacpi_deinitialize_tables(), uacpi_map_gas_noalloc(), and verify_and_install_table().
| uacpi_bool uacpi_kernel_wait_for_event | ( | uacpi_handle | Handle, |
| uacpi_u16 | Timeout | ||
| ) |
Definition at line 66 of file uacpiosl.c.
| uacpi_status uacpi_kernel_wait_for_work_completion | ( | void | ) |
Waits for two types of work to finish:
Note that the waits must be done in this order specifically.
uACPI never calls this from an interrupt handler or from deferred work, so it's free to sleep, and never ends up waiting for its own caller. This relies on the host not calling any API that is documented as off limits to those from there.
NOTE: if any of the work is executed synchronously, this must wait for the work that another thread is in the middle of executing that way too.
Definition at line 235 of file uacpiosl.c.
Referenced by uacpi_state_reset(), uacpi_uninstall_notify_handler(), and wait_for_work_completion_unlocked().