Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / acpi.h
1 #ifndef _IPXE_ACPI_H
2 #define _IPXE_ACPI_H
3
4 /** @file
5  *
6  * ACPI data structures
7  *
8  */
9
10 FILE_LICENCE ( GPL2_OR_LATER );
11
12 #include <stdint.h>
13 #include <ipxe/interface.h>
14
15 /**
16  * An ACPI description header
17  *
18  * This is the structure common to the start of all ACPI system
19  * description tables.
20  */
21 struct acpi_description_header {
22         /** ACPI signature (4 ASCII characters) */
23         uint32_t signature;
24         /** Length of table, in bytes, including header */
25         uint32_t length;
26         /** ACPI Specification minor version number */
27         uint8_t revision;
28         /** To make sum of entire table == 0 */
29         uint8_t checksum;
30         /** OEM identification */
31         char oem_id[6];
32         /** OEM table identification */
33         char oem_table_id[8];
34         /** OEM revision number */
35         uint32_t oem_revision;
36         /** ASL compiler vendor ID */
37         char asl_compiler_id[4];
38         /** ASL compiler revision number */
39         uint32_t asl_compiler_revision;
40 } __attribute__ (( packed ));
41
42 /**
43  * Build ACPI signature
44  *
45  * @v a                 First character of ACPI signature
46  * @v b                 Second character of ACPI signature
47  * @v c                 Third character of ACPI signature
48  * @v d                 Fourth character of ACPI signature
49  * @ret signature       ACPI signature
50  */
51 #define ACPI_SIGNATURE( a, b, c, d ) \
52         ( ( (a) << 0 ) | ( (b) << 8 ) | ( (c) << 16 ) | ( (d) << 24 ) )
53
54 extern int acpi_describe ( struct interface *interface,
55                            struct acpi_description_header *acpi, size_t len );
56 #define acpi_describe_TYPE( object_type )                               \
57         typeof ( int ( object_type,                                     \
58                        struct acpi_description_header *acpi,            \
59                        size_t len ) )
60
61 extern void acpi_fix_checksum ( struct acpi_description_header *acpi );
62
63 #endif /* _IPXE_ACPI_H */