2 * Copyright (c) 1999 Doug Rabson
3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * $Id: acpidump.h,v 1.3 2000/08/09 14:47:52 iwasaki Exp $
34 /* Generic Address structure */
36 u_int8_t address_space_id;
37 #define ACPI_GAS_MEMORY 0
39 #define ACPI_GAS_PCI 2
40 #define ACPI_GAS_EMBEDDED 3
41 #define ACPI_GAS_SMBUS 4
42 #define ACPI_GAS_FIXED 0x7f
43 u_int8_t register_bit_width;
44 u_int8_t register_bit_offset;
47 } __attribute__((packed));
49 /* Root System Description Pointer */
56 } __attribute__((packed));
58 /* System Description Table */
69 #define SIZEOF_SDT_HDR 36 /* struct size except body */
70 u_int32_t body[1];/* This member should be casted */
71 } __attribute__((packed));
73 /* Fixed ACPI Description Table (body) */
78 #define ACPI_FACP_INTMODEL_PIC 0 /* Standard PC-AT PIC */
79 #define ACPI_FACP_INTMODEL_APIC 1 /* Multiple APIC */
84 u_int8_t acpi_disable;
87 u_int32_t pm1a_evt_blk;
88 u_int32_t pm1b_evt_blk;
89 u_int32_t pm1a_cnt_blk;
90 u_int32_t pm1b_cnt_blk;
91 u_int32_t pm2_cnt_blk;
103 u_int16_t p_lvl2_lat;
104 u_int16_t p_lvl3_lat;
105 u_int16_t flush_size;
106 u_int16_t flush_stride;
112 u_int16_t iapc_boot_arch;
115 #define ACPI_FACP_FLAG_WBINVD 1 /* WBINVD is correctly supported */
116 #define ACPI_FACP_FLAG_WBINVD_FLUSH 2 /* WBINVD flushes caches */
117 #define ACPI_FACP_FLAG_PROC_C1 4 /* C1 power state supported */
118 #define ACPI_FACP_FLAG_P_LVL2_UP 8 /* C2 power state works on SMP */
119 #define ACPI_FACP_FLAG_PWR_BUTTON 16 /* Power button uses control method */
120 #define ACPI_FACP_FLAG_SLP_BUTTON 32 /* Sleep button uses control method */
121 #define ACPI_FACP_FLAG_FIX_RTC 64 /* RTC wakeup not supported */
122 #define ACPI_FACP_FLAG_RTC_S4 128 /* RTC can wakeup from S4 state */
123 #define ACPI_FACP_FLAG_TMR_VAL_EXT 256 /* TMR_VAL is 32bit */
124 #define ACPI_FACP_FLAG_DCK_CAP 512 /* Can support docking */
125 struct ACPIgas reset_reg;
126 u_int8_t reset_value;
127 u_int8_t reserved5[3];
128 u_int64_t x_firmware_ctrl;
130 struct ACPIgas x_pm1a_evt_blk;
131 struct ACPIgas x_pm1b_evt_blk;
132 struct ACPIgas x_pm1a_cnt_blk;
133 struct ACPIgas x_pm1b_cnt_blk;
134 struct ACPIgas x_pm2_cnt_blk;
135 struct ACPIgas x_pm_tmr_blk;
136 struct ACPIgas x_gpe0_blk;
137 struct ACPIgas x_gpe1_blk;
138 } __attribute__((packed));
140 /* Firmware ACPI Control Structure */
146 * NOTE This should be filled with physical address below 1MB!!
149 u_int32_t firm_wake_vec;
150 u_int32_t g_lock; /* bit field */
151 /* 5.2.6.1 Global Lock */
152 #define ACPI_GLOBAL_LOCK_PENDING 1
153 #define ACPI_GLOBAL_LOCK_OWNED 2
154 u_int32_t flags; /* bit field */
155 #define ACPI_FACS_FLAG_S4BIOS_F 1 /* Supports S4BIOS_SEQ */
157 } __attribute__((packed));
159 void *acpi_map_physical(vm_offset_t, size_t);
160 struct ACPIrsdp *acpi_find_rsd_ptr(void);
161 int acpi_checksum(void *, size_t);
162 struct ACPIsdt *acpi_map_sdt(vm_offset_t);
163 void acpi_print_rsd_ptr(struct ACPIrsdp *);
164 void acpi_print_sdt(struct ACPIsdt *);
165 void acpi_print_rsdt(struct ACPIsdt *);
166 void acpi_print_facp(struct FACPbody *);
167 void acpi_print_dsdt(struct ACPIsdt *);
169 void asl_dump_termobj(u_int8_t **, int);
170 void asl_dump_objectlist(u_int8_t **, u_int8_t *, int);
172 void aml_dump(struct ACPIsdt *);
174 void acpi_handle_rsdt(struct ACPIsdt *);
175 void acpi_load_dsdt(char *, u_int8_t **, u_int8_t **);
176 void acpi_dump_dsdt(u_int8_t *, u_int8_t *);
177 extern char *aml_dumpfile;
178 extern struct ACPIsdt dsdt_header;
181 #endif /* !_ACPIDUMP_H_ */