📄 actypes.h
字号:
/* * Structure and flags for Acpi_get_system_info */#define SYS_MODE_UNKNOWN 0x0000#define SYS_MODE_ACPI 0x0001#define SYS_MODE_LEGACY 0x0002#define SYS_MODES_MASK 0x0003/* * ACPI CPU Cx state handler */typedefACPI_STATUS (*ACPI_SET_C_STATE_HANDLER) ( NATIVE_UINT pblk_address);/* * ACPI Cx State info */typedef struct{ u32 state_number; u32 latency;} ACPI_CX_STATE;/* * ACPI CPU throttling info */typedef struct{ u32 state_number; u32 percent_of_clock;} ACPI_CPU_THROTTLING_STATE;/* * ACPI Table Info. One per ACPI table _type_ */typedef struct acpi_table_info{ u32 count;} ACPI_TABLE_INFO;/* * System info returned by Acpi_get_system_info() */typedef struct _acpi_sys_info{ u32 acpi_ca_version; u32 flags; u32 timer_resolution; u32 reserved1; u32 reserved2; u32 debug_level; u32 debug_layer; u32 num_table_types; ACPI_TABLE_INFO table_info [NUM_ACPI_TABLES];} ACPI_SYSTEM_INFO;/* * System Initiailization data. This data is passed to ACPIInitialize * copyied to global data and retained by ACPI CA */typedef struct _acpi_init_data{ void *RSDP_physical_address; /* Address of RSDP, needed it it is */ /* not found in the IA32 manner */} ACPI_INIT_DATA;/* * Various handlers and callback procedures */typedefu32 (*FIXED_EVENT_HANDLER) ( void *context);typedefvoid (*GPE_HANDLER) ( void *context);typedefvoid (*NOTIFY_HANDLER) ( ACPI_HANDLE device, u32 value, void *context);#define ADDRESS_SPACE_READ 1#define ADDRESS_SPACE_WRITE 2typedefACPI_STATUS (*ADDRESS_SPACE_HANDLER) ( u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, u32 *value, void *handler_context, void *region_context);#define ACPI_DEFAULT_HANDLER ((ADDRESS_SPACE_HANDLER) NULL)typedefACPI_STATUS (*ADDRESS_SPACE_SETUP) ( ACPI_HANDLE region_handle, u32 function, void *handler_context, void **region_context);#define ACPI_REGION_ACTIVATE 0#define ACPI_REGION_DEACTIVATE 1typedefACPI_STATUS (*WALK_CALLBACK) ( ACPI_HANDLE obj_handle, u32 nesting_level, void *context, void **return_value);/* Interrupt handler return values */#define INTERRUPT_NOT_HANDLED 0x00#define INTERRUPT_HANDLED 0x01/* Structure and flags for Acpi_get_device_info */#define ACPI_VALID_HID 0x1#define ACPI_VALID_UID 0x2#define ACPI_VALID_ADR 0x4#define ACPI_VALID_STA 0x8#define ACPI_COMMON_OBJ_INFO \ ACPI_OBJECT_TYPE type; /* ACPI object type */ \ ACPI_NAME name /* ACPI object Name */typedef struct{ ACPI_COMMON_OBJ_INFO;} ACPI_OBJ_INFO_HEADER;typedef struct{ ACPI_COMMON_OBJ_INFO; u32 valid; /* Are the next bits legit? */ NATIVE_CHAR hardware_id [9]; /* _HID value if any */ NATIVE_CHAR unique_id[9]; /* _UID value if any */ ACPI_INTEGER address; /* _ADR value if any */ u32 current_status; /* _STA value */} ACPI_DEVICE_INFO;/* Context structs for address space handlers */typedef struct{ u32 seg; u32 bus; u32 dev_func;} PCI_HANDLER_CONTEXT;typedef struct{ ACPI_PHYSICAL_ADDRESS mapped_physical_address; u8 *mapped_logical_address; u32 mapped_length;} MEM_HANDLER_CONTEXT;/* * C-state handler */typedef ACPI_STATUS (*ACPI_C_STATE_HANDLER) (ACPI_IO_ADDRESS, u32*);/* * Definitions for Resource Attributes *//* * Memory Attributes */#define READ_ONLY_MEMORY (u8) 0x00#define READ_WRITE_MEMORY (u8) 0x01#define NON_CACHEABLE_MEMORY (u8) 0x00#define CACHABLE_MEMORY (u8) 0x01#define WRITE_COMBINING_MEMORY (u8) 0x02#define PREFETCHABLE_MEMORY (u8) 0x03/* * IO Attributes * The ISA IO ranges are: n000-n0FFh, 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 NON_ISA_ONLY_RANGES (u8) 0x01#define ISA_ONLY_RANGES (u8) 0x02#define ENTIRE_RANGE (NON_ISA_ONLY_RANGES | ISA_ONLY_RANGES)/* * IO Port Descriptor Decode */#define DECODE_10 (u8) 0x00 /* 10-bit IO address decode */#define DECODE_16 (u8) 0x01 /* 16-bit IO address decode *//* * IRQ Attributes */#define EDGE_SENSITIVE (u8) 0x00#define LEVEL_SENSITIVE (u8) 0x01#define ACTIVE_HIGH (u8) 0x00#define ACTIVE_LOW (u8) 0x01#define EXCLUSIVE (u8) 0x00#define SHARED (u8) 0x01/* * DMA Attributes */#define COMPATIBILITY (u8) 0x00#define TYPE_A (u8) 0x01#define TYPE_B (u8) 0x02#define TYPE_F (u8) 0x03#define NOT_BUS_MASTER (u8) 0x00#define BUS_MASTER (u8) 0x01#define TRANSFER_8 (u8) 0x00#define TRANSFER_8_16 (u8) 0x01#define TRANSFER_16 (u8) 0x02/* * Start Dependent Functions Priority definitions */#define GOOD_CONFIGURATION (u8) 0x00#define ACCEPTABLE_CONFIGURATION (u8) 0x01#define SUB_OPTIMAL_CONFIGURATION (u8) 0x02/* * 16, 32 and 64-bit Address Descriptor resource types */#define MEMORY_RANGE (u8) 0x00#define IO_RANGE (u8) 0x01#define BUS_NUMBER_RANGE (u8) 0x02#define ADDRESS_NOT_FIXED (u8) 0x00#define ADDRESS_FIXED (u8) 0x01#define POS_DECODE (u8) 0x00#define SUB_DECODE (u8) 0x01#define PRODUCER (u8) 0x00#define CONSUMER (u8) 0x01/* * Structures used to describe device resources */typedef struct{ u32 edge_level; u32 active_high_low; u32 shared_exclusive; u32 number_of_interrupts; u32 interrupts[1];} IRQ_RESOURCE;typedef struct{ u32 type; u32 bus_master; u32 transfer; u32 number_of_channels; u32 channels[1];} DMA_RESOURCE;typedef struct{ u32 compatibility_priority; u32 performance_robustness;} START_DEPENDENT_FUNCTIONS_RESOURCE;/* * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not * needed because it has no fields */typedef struct{ u32 io_decode; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;} IO_RESOURCE;typedef struct{ u32 base_address; u32 range_length;} FIXED_IO_RESOURCE;typedef struct{ u32 length; u8 reserved[1];} VENDOR_RESOURCE;typedef struct{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;} MEMORY24_RESOURCE;typedef struct{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;} MEMORY32_RESOURCE;typedef struct{ u32 read_write_attribute; u32 range_base_address; u32 range_length;} FIXED_MEMORY32_RESOURCE;typedef struct{ u16 cache_attribute; u16 read_write_attribute;} MEMORY_ATTRIBUTE;typedef struct{ u16 range_attribute; u16 reserved;} IO_ATTRIBUTE;typedef struct{ u16 reserved1; u16 reserved2;} BUS_ATTRIBUTE;typedef union{ MEMORY_ATTRIBUTE memory; IO_ATTRIBUTE io; BUS_ATTRIBUTE bus;} ATTRIBUTE_DATA;typedef struct{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; ATTRIBUTE_DATA attribute; u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; u32 address_length; u32 resource_source_index; u32 resource_source_string_length; NATIVE_CHAR resource_source[1];} ADDRESS16_RESOURCE;typedef struct{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; ATTRIBUTE_DATA attribute; u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; u32 address_length; u32 resource_source_index; u32 resource_source_string_length; NATIVE_CHAR resource_source[1];} ADDRESS32_RESOURCE;typedef struct{ u32 producer_consumer; u32 edge_level; u32 active_high_low; u32 shared_exclusive; u32 number_of_interrupts; u32 interrupts[1]; u32 resource_source_index; u32 resource_source_string_length; NATIVE_CHAR resource_source[1];} EXTENDED_IRQ_RESOURCE;typedef enum{ irq, dma, start_dependent_functions, end_dependent_functions, io, fixed_io, vendor_specific, end_tag, memory24, memory32, fixed_memory32, address16, address32, extended_irq} RESOURCE_TYPE;typedef union{ IRQ_RESOURCE irq; DMA_RESOURCE dma; START_DEPENDENT_FUNCTIONS_RESOURCE start_dependent_functions; IO_RESOURCE io; FIXED_IO_RESOURCE fixed_io; VENDOR_RESOURCE vendor_specific; MEMORY24_RESOURCE memory24; MEMORY32_RESOURCE memory32; FIXED_MEMORY32_RESOURCE fixed_memory32; ADDRESS16_RESOURCE address16; ADDRESS32_RESOURCE address32; EXTENDED_IRQ_RESOURCE extended_irq;} RESOURCE_DATA;typedef struct _resource_tag{ RESOURCE_TYPE id; u32 length; RESOURCE_DATA data;} RESOURCE;#define RESOURCE_LENGTH 12#define RESOURCE_LENGTH_NO_DATA 8#define NEXT_RESOURCE(res) (RESOURCE*)((u8*) res + res->length)/* * END: Definitions for Resource Attributes *//* * Definitions for PCI Routing tables */typedef struct{ ACPI_INTEGER address; u32 pin; u32 source_index; NATIVE_CHAR source[1];} PRT_ENTRY;typedef struct _prt_tag{ u32 length; PRT_ENTRY data;} PCI_ROUTING_TABLE;/* * END: Definitions for PCI Routing tables */#endif /* __ACTYPES_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -