115#define ACPI_IRQ_DESCRIPTOR_INFO(descriptor) \
116 ((acpi_irq_descriptor_info_t)((descriptor)->header.length >= 3 \
117 ? *((((uint8_t*)(descriptor)) + sizeof(acpi_irq_descriptor_t))) \
243#define ACPI_RESOURCE_ITEM_NAME(resource) \
244 (((resource)->isLarge) \
245 ? (acpi_item_name_t)(ACPI_ITEM_NAME_LARGE_BASE + ((acpi_resource_large_t*)(resource))->itemName) \
246 : (acpi_item_name_t)((acpi_resource_small_t*)(resource))->itemName)
254#define ACPI_RESOURCE_SIZE(resource) \
255 (((resource)->isLarge) ? ((acpi_resource_large_t*)(resource))->length + sizeof(acpi_resource_large_t) \
256 : ((acpi_resource_small_t*)(resource))->length + sizeof(acpi_resource_small_t))
268#define ACPI_RESOURCES_FOR_EACH(resource, resources) \
269 for (uint8_t* __ptr = (resources)->data; \
270 (__ptr < (resources)->data + (resources)->length) && ((resource) = (acpi_resource_t*)__ptr) && \
271 (__ptr + ACPI_RESOURCE_SIZE(resource) <= (resources)->data + (resources)->length); \
272 __ptr += ACPI_RESOURCE_SIZE(resource))
#define PACKED
GCC packed attribute.
void acpi_resources_free(acpi_resources_t *resources)
Free an ACPI resources structure.
acpi_irq_descriptor_info_t
ACPI IRQ descriptor info flags.
acpi_resources_t * acpi_resources_current(aml_object_t *device)
Get the current ACPI resource settings for a device.
acpi_item_name_large_t
Large ACPI resource item names.
acpi_item_name_small_t
Small ACPI resource item names.
acpi_item_name_t
Generic ACPI resource item names.
@ ACPI_IRQ_EDGE_TRIGGERED
Interrupt is triggered in response to a change in signal state from low to high.
@ ACPI_IRQ_ACTIVE_HIGH
This interrupt is sampled with the signal is high, or true.
@ ACPI_IRQ_EXCLUSIVE
This interrupt is not shared with other devices.
@ ACPI_IRQ_WAKE_CAPABLE
This interrupt is capable of waking the system from a low-power idle state or a system sleep state.
@ ACPI_IRQ_NOT_WAKE_CAPABLE
This interrupt is not capable of waking the system.
@ ACPI_IRQ_ACTIVE_LOW
This interrupt is sampled with the signal is low, or false.
@ ACPI_IRQ_LEVEL_TRIGGERED
Interrupt is triggered in response to signal in a low state.
@ ACPI_IRQ_SHARED
This interrupt is shared with other devices.
@ ACPI_LARGE_ITEM_24_MEM_RANGE
@ ACPI_ITEM_SMALL_END_TAG
@ ACPI_ITEM_SMALL_IO_PORT
@ ACPI_ITEM_NAME_24_MEM_RANGE
@ ACPI_ITEM_NAME_LARGE_BASE
ACPI end tag resource descriptor.
uint8_t checksum
Checksum to ensure that the sum of all bytes in the resource data is zero.
acpi_resource_small_t header
ACPI IO port resource descriptor.
uint8_t alignment
Alignment of the IO port(s) to utilize within the min and max range.
uint16_t minBase
Minimum base IO port address that may be used for the device.
acpi_resource_small_t header
uint8_t decode16
0 = 10-bit decoding, 1 = 16-bit decoding.
uint16_t maxBase
Maximum base IO port address that may be used for the device.
uint8_t length
The amount of contiguous IO ports required by the device.
ACPI IRQ resource descriptor.
acpi_resource_small_t header
uint16_t mask
Mask of IRQs used by the device, bit 0 = IRQ 0, bit 1 = IRQ 1, etc..
ACPI large resource header.
uint16_t length
Does not include the header bytes.
uint8_t itemName
acpi_item_name_large_t
uint8_t isLarge
Always 1 for large resource types.
ACPI small resource header.
uint8_t isLarge
Always 0 for small resource types.
uint8_t itemName
acpi_item_name_small_t
uint8_t length
Does not include the header byte.
Generic ACPI resource descriptor.
uint8_t isLarge
Same position in both small and large resource headers.
ACPI resources structure.