• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------- *
2  *
3  *   Copyright 2009-2011 Erwan Velu - All Rights Reserved
4  *
5  *   This program is free software; you can redistribute it and/or modify
6  *   it under the terms of the GNU General Public License as published by
7  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8  *   Boston MA 02111-1307, USA; either version 2 of the License, or
9  *   (at your option) any later version; incorporated herein by reference.
10  *
11  * ----------------------------------------------------------------------- */
12 
13 #ifndef ACPI_STRUCTS_H
14 #define ACPI_STRUCTS_H
15 #include <inttypes.h>
16 #include <stdbool.h>
17 
18 /* This value define the real size of the acpi structure
19  * Our is bigger as we manage the \0 of strings
20  * */
21 #define ACPI_HEADER_SIZE 36
22 
23 enum { GAS_SYSTEM_MEMORY=0, GAS_SYSTEM_IO=1 };
24 
25 /* Generic Address Structure (GAS) Format */
26 typedef struct {
27     /* address_space_id could be {GAS_SYSTEM_MEMORY | GAS_SYSTEM_IO} */
28     uint8_t address_space_id;
29     uint8_t register_bit_width;
30     uint8_t register_bit_offset;
31     uint8_t reserved;
32     uint64_t address;
33 } __attribute__ ((packed)) s_gas;
34 
35 typedef struct {
36     uint8_t signature[4 + 1];
37     uint32_t length;
38     uint8_t revision;
39     uint8_t checksum;
40     uint8_t oem_id[6 + 1];
41     uint8_t oem_table_id[8 + 1];
42     uint32_t oem_revision;
43     uint8_t creator_id[4 + 1];
44     uint32_t creator_revision;
45 } s_acpi_description_header;
46 
47 #endif
48