actypes.h

来自「一个类似windows」· C头文件 代码 · 共 1,078 行 · 第 1/3 页

H
1,078
字号
	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
 */


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 + =
减小字号Ctrl + -
显示快捷键?