📄 actypes.h
字号:
/* Context structs for address space handlers */typedef struct{ u16 segment; u16 bus; u16 device; u16 function;} acpi_pci_id;typedef struct{ ACPI_PHYSICAL_ADDRESS mapped_physical_address; u8 *mapped_logical_address; u32 mapped_length;} acpi_mem_space_context;/* Sleep states */#define ACPI_NUM_SLEEP_STATES 7/* * 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];} acpi_resource_irq;typedef struct{ u32 type; u32 bus_master; u32 transfer; u32 number_of_channels; u32 channels[1];} acpi_resource_dma;typedef struct{ u32 compatibility_priority; u32 performance_robustness;} acpi_resource_start_dpf;/* * 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;} acpi_resource_io;typedef struct{ u32 base_address; u32 range_length;} acpi_resource_fixed_io;typedef struct{ u32 length; u8 reserved[1];} acpi_resource_vendor;typedef struct{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;} acpi_resource_mem24;typedef struct{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; u32 alignment; u32 range_length;} acpi_resource_mem32;typedef struct{ u32 read_write_attribute; u32 range_base_address; u32 range_length;} acpi_resource_fixed_mem32;typedef struct{ u16 cache_attribute; u16 read_write_attribute;} acpi_memory_attribute;typedef struct{ u16 range_attribute; u16 reserved;} acpi_io_attribute;typedef struct{ u16 reserved1; u16 reserved2;} acpi_bus_attribute;typedef union{ acpi_memory_attribute memory; acpi_io_attribute io; acpi_bus_attribute bus;} acpi_resource_attribute;typedef struct{ u32 index; u32 string_length; NATIVE_CHAR *string_ptr;} acpi_resource_source;typedef struct{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; acpi_resource_attribute attribute; u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; u32 address_length; acpi_resource_source resource_source;} acpi_resource_address16;typedef struct{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; acpi_resource_attribute attribute; u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; u32 address_length; acpi_resource_source resource_source;} acpi_resource_address32;typedef struct{ u32 resource_type; u32 producer_consumer; u32 decode; u32 min_address_fixed; u32 max_address_fixed; acpi_resource_attribute attribute; u64 granularity; u64 min_address_range; u64 max_address_range; u64 address_translation_offset; u64 address_length; acpi_resource_source resource_source;} acpi_resource_address64;typedef struct{ u32 producer_consumer; u32 edge_level; u32 active_high_low; u32 shared_exclusive; u32 number_of_interrupts; acpi_resource_source resource_source; u32 interrupts[1];} acpi_resource_ext_irq;/* 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;typedef union{ acpi_resource_irq irq; acpi_resource_dma dma; acpi_resource_start_dpf start_dpf; acpi_resource_io io; acpi_resource_fixed_io fixed_io; acpi_resource_vendor vendor_specific; acpi_resource_mem24 memory24; acpi_resource_mem32 memory32; acpi_resource_fixed_mem32 fixed_memory32; acpi_resource_address16 address16; acpi_resource_address32 address32; acpi_resource_address64 address64; acpi_resource_ext_irq extended_irq;} acpi_resource_data;typedef struct acpi_resource{ acpi_resource_type id; u32 length; acpi_resource_data data;} acpi_resource;#define ACPI_RESOURCE_LENGTH 12#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */#define SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type))#define NEXT_RESOURCE(res) (acpi_resource *)((u8 *) res + res->length)/* * END: Definitions for Resource Attributes */typedef struct pci_routing_table{ u32 length; u32 pin; acpi_integer address; /* here for 64-bit alignment */ u32 source_index; NATIVE_CHAR source[4]; /* pad to 64 bits so sizeof() works in all cases */} pci_routing_table;/* * END: Definitions for PCI Routing tables */#endif /* __ACTYPES_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -