1 /* ----------------------------------------------------------------------- *
3 * Copyright 2009-2011 Erwan Velu - All Rights Reserved
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.
11 * ----------------------------------------------------------------------- */
18 void dbg_printf(const char *fmt, ...);
19 #define DEBUG_PRINT(x) do { if (DEBUG_ACPI) dbg_printf x; } while (0)
23 #include <acpi/structs.h>
24 #include <acpi/rsdp.h>
25 #include <acpi/rsdt.h>
26 #include <acpi/xsdt.h>
27 #include <acpi/fadt.h>
28 #include <acpi/madt.h>
29 #include <acpi/dsdt.h>
30 #include <acpi/ssdt.h>
31 #include <acpi/sbst.h>
32 #include <acpi/ecdt.h>
33 #include <acpi/facs.h>
34 #include <acpi/hpet.h>
35 #include <acpi/tcpa.h>
36 #include <acpi/mcfg.h>
37 #include <acpi/slic.h>
38 #include <acpi/boot.h>
40 enum { ACPI_FOUND = 1, ENO_ACPI = 2 , MADT_FOUND = 3 , ENO_MADT = 4 };
44 /* Some other description HEADERS : ACPI doc: 5.2.6*/
68 /* This macro are used to extract ACPI structures
69 * please be careful about the q (interator) naming */
70 #define cp_struct(dest) memcpy(dest,q,sizeof(*dest)); q+=sizeof(*dest)
71 #define cp_str_struct(dest) memcpy(dest,q,sizeof(dest)-1); dest[sizeof(dest)-1]=0;q+=sizeof(dest)-1
80 s_ssdt *ssdt[MAX_SSDT];
92 int parse_acpi(s_acpi * acpi);
93 int parse_xsdt(s_acpi * acpi);
94 void parse_madt(s_acpi * acpi);
95 int search_rsdp(s_acpi *acpi);
96 void get_acpi_description_header(uint8_t *q, s_acpi_description_header * adh);
97 bool parse_header(uint64_t *address, s_acpi *acpi);
98 char *flags_to_string(char *buffer, uint16_t flags);