📄 actypes.h
字号:
#define ACPI_REGION_ACTIVATE 0#define ACPI_REGION_DEACTIVATE 1typedefacpi_status (*acpi_walk_callback) ( acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value);/* Interrupt handler return values */#define ACPI_INTERRUPT_NOT_HANDLED 0x00#define ACPI_INTERRUPT_HANDLED 0x01/* Common string version of device HIDs and UIDs */struct acpi_device_id{ char value[ACPI_DEVICE_ID_LENGTH];};/* Common string version of device CIDs */struct acpi_compatible_id{ char value[ACPI_MAX_CID_LENGTH];};struct acpi_compatible_id_list{ u32 count; u32 size; struct acpi_compatible_id id[1];};/* Structure and flags for acpi_get_object_info */#define ACPI_VALID_STA 0x0001#define ACPI_VALID_ADR 0x0002#define ACPI_VALID_HID 0x0004#define ACPI_VALID_UID 0x0008#define ACPI_VALID_CID 0x0010#define ACPI_VALID_SXDS 0x0020#define ACPI_COMMON_OBJ_INFO \ acpi_object_type type; /* ACPI object type */ \ acpi_name name /* ACPI object Name */struct acpi_obj_info_header{ ACPI_COMMON_OBJ_INFO;};/* Structure returned from Get Object Info */struct acpi_device_info{ ACPI_COMMON_OBJ_INFO; u32 valid; /* Indicates which fields below are valid */ u32 current_status; /* _STA value */ acpi_integer address; /* _ADR value if any */ struct acpi_device_id hardware_id; /* _HID value if any */ struct acpi_device_id unique_id; /* _UID value if any */ u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */};/* Context structs for address space handlers */struct acpi_pci_id{ u16 segment; u16 bus; u16 device; u16 function;};struct acpi_mem_space_context{ u32 length; acpi_physical_address address; acpi_physical_address mapped_physical_address; u8 *mapped_logical_address; acpi_size mapped_length;};/* * Definitions for Resource Attributes *//* * Memory Attributes */#define ACPI_READ_ONLY_MEMORY (u8) 0x00#define ACPI_READ_WRITE_MEMORY (u8) 0x01#define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00#define ACPI_CACHABLE_MEMORY (u8) 0x01#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03/* * IO Attributes * The ISA Io ranges are: n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh. * The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh. */#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01#define ACPI_ISA_ONLY_RANGES (u8) 0x02#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)#define ACPI_SPARSE_TRANSLATION (u8) 0x03/* * IO Port Descriptor Decode */#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode *//* * IRQ Attributes */#define ACPI_EDGE_SENSITIVE (u8) 0x00#define ACPI_LEVEL_SENSITIVE (u8) 0x01#define ACPI_ACTIVE_HIGH (u8) 0x00#define ACPI_ACTIVE_LOW (u8) 0x01#define ACPI_EXCLUSIVE (u8) 0x00#define ACPI_SHARED (u8) 0x01/* * DMA Attributes */#define ACPI_COMPATIBILITY (u8) 0x00#define ACPI_TYPE_A (u8) 0x01#define ACPI_TYPE_B (u8) 0x02#define ACPI_TYPE_F (u8) 0x03#define ACPI_NOT_BUS_MASTER (u8) 0x00#define ACPI_BUS_MASTER (u8) 0x01#define ACPI_TRANSFER_8 (u8) 0x00#define ACPI_TRANSFER_8_16 (u8) 0x01#define ACPI_TRANSFER_16 (u8) 0x02/* * Start Dependent Functions Priority definitions */#define ACPI_GOOD_CONFIGURATION (u8) 0x00#define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01#define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02/* * 16, 32 and 64-bit Address Descriptor resource types */#define ACPI_MEMORY_RANGE (u8) 0x00#define ACPI_IO_RANGE (u8) 0x01#define ACPI_BUS_NUMBER_RANGE (u8) 0x02#define ACPI_ADDRESS_NOT_FIXED (u8) 0x00#define ACPI_ADDRESS_FIXED (u8) 0x01#define ACPI_POS_DECODE (u8) 0x00#define ACPI_SUB_DECODE (u8) 0x01#define ACPI_PRODUCER (u8) 0x00#define ACPI_CONSUMER (u8) 0x01/* * Structures used to describe device resources */struct acpi_resource_irq{ u32 edge_level; u32 active_high_low; u32 shared_exclusive; u32 number_of_interrupts; u32 interrupts[1];};struct acpi_resource_dma{ u32 type; u32 bus_master; u32 transfer; u32 number_of_channels; u32 channels[1];};struct acpi_resource_start_dpf{ u32 compatibility_priority; u32 performance_robustness;};/* * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not * needed because it has no fields */struct acpi_resource_io{ u32 io_decode; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;};struct acpi_resource_fixed_io{ u32 base_address; u32 range_length;};struct acpi_resource_vendor{ u32 length; u8 reserved[1];};struct acpi_resource_end_tag{ u8 checksum;};struct acpi_resource_mem24{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;};struct acpi_resource_mem32{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;};struct acpi_resource_fixed_mem32{ u32 read_write_attribute; u32 range_base_address; u32 range_length;};struct acpi_memory_attribute{ u16 cache_attribute; u16 read_write_attribute;};struct acpi_io_attribute{ u16 range_attribute; u16 translation_attribute;};struct acpi_bus_attribute{ u16 reserved1; u16 reserved2;};union acpi_resource_attribute{ struct acpi_memory_attribute memory; struct acpi_io_attribute io; struct acpi_bus_attribute bus;};struct acpi_resource_source{ u32 index; u32 string_length; char *string_ptr;};struct acpi_resource_address16{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; union acpi_resource_attribute attribute; u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; u32 address_length; struct acpi_resource_source resource_source;};struct acpi_resource_address32{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; union acpi_resource_attribute attribute; u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; u32 address_length; struct acpi_resource_source resource_source;};struct acpi_resource_address64{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; union acpi_resource_attribute attribute; u64 granularity; u64 min_address_range; u64 max_address_range; u64 address_translation_offset; u64 address_length; struct acpi_resource_source resource_source;};struct acpi_resource_ext_irq{ u32 producer_consumer; u32 edge_level; u32 active_high_low; u32 shared_exclusive; u32 number_of_interrupts; struct acpi_resource_source resource_source; u32 interrupts[1];};/* ACPI_RESOURCE_TYPEs */#define ACPI_RSTYPE_IRQ 0#define ACPI_RSTYPE_DMA 1#define ACPI_RSTYPE_START_DPF 2#define ACPI_RSTYPE_END_DPF 3#define ACPI_RSTYPE_IO 4#define ACPI_RSTYPE_FIXED_IO 5#define ACPI_RSTYPE_VENDOR 6#define ACPI_RSTYPE_END_TAG 7#define ACPI_RSTYPE_MEM24 8#define ACPI_RSTYPE_MEM32 9#define ACPI_RSTYPE_FIXED_MEM32 10#define ACPI_RSTYPE_ADDRESS16 11#define ACPI_RSTYPE_ADDRESS32 12#define ACPI_RSTYPE_ADDRESS64 13#define ACPI_RSTYPE_EXT_IRQ 14typedef u32 acpi_resource_type;union acpi_resource_data{ struct acpi_resource_irq irq; struct acpi_resource_dma dma; struct acpi_resource_start_dpf start_dpf; struct acpi_resource_io io; struct acpi_resource_fixed_io fixed_io; struct acpi_resource_vendor vendor_specific; struct acpi_resource_end_tag end_tag; struct acpi_resource_mem24 memory24; struct acpi_resource_mem32 memory32; struct acpi_resource_fixed_mem32 fixed_memory32; struct acpi_resource_address16 address16; struct acpi_resource_address32 address32; struct acpi_resource_address64 address64; struct acpi_resource_ext_irq extended_irq;};struct acpi_resource{ acpi_resource_type id; u32 length; union acpi_resource_data data;};#define ACPI_RESOURCE_LENGTH 12#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type))#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)#ifdef ACPI_MISALIGNED_TRANSFERS#define ACPI_ALIGN_RESOURCE_SIZE(length) (length)#else#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length)#endif/* * END: of definitions for Resource Attributes */struct acpi_pci_routing_table{ u32 length; u32 pin; acpi_integer address; /* here for 64-bit alignment */ u32 source_index; char source[4]; /* pad to 64 bits so sizeof() works in all cases */};/* * END: of definitions for PCI Routing tables */#endif /* __ACTYPES_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -