Home | History | Annotate | Line # | Download | only in acpidump
acpidump.h revision 1.2
      1  1.2    cegger /* $NetBSD: acpidump.h,v 1.2 2009/12/22 08:44:03 cegger Exp $ */
      2  1.1  christos 
      3  1.1  christos /*-
      4  1.1  christos  * Copyright (c) 1999 Doug Rabson
      5  1.1  christos  * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki (at) FreeBSD.org>
      6  1.1  christos  * All rights reserved.
      7  1.1  christos  *
      8  1.1  christos  * Redistribution and use in source and binary forms, with or without
      9  1.1  christos  * modification, are permitted provided that the following conditions
     10  1.1  christos  * are met:
     11  1.1  christos  * 1. Redistributions of source code must retain the above copyright
     12  1.1  christos  *    notice, this list of conditions and the following disclaimer.
     13  1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     15  1.1  christos  *    documentation and/or other materials provided with the distribution.
     16  1.1  christos  *
     17  1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     18  1.1  christos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     19  1.1  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     20  1.1  christos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     21  1.1  christos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     22  1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     23  1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     24  1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     25  1.1  christos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     26  1.1  christos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     27  1.1  christos  * SUCH DAMAGE.
     28  1.1  christos  *
     29  1.2    cegger  *	$FreeBSD: src/usr.sbin/acpi/acpidump/acpidump.h,v 1.24 2009/08/25 20:35:57 jhb Exp $
     30  1.1  christos  */
     31  1.1  christos 
     32  1.1  christos #ifndef _ACPIDUMP_H_
     33  1.2    cegger #define	_ACPIDUMP_H_
     34  1.1  christos 
     35  1.2    cegger #include <stdlib.h> /* for size_t */
     36  1.2    cegger #include <acpi_common.h>
     37  1.2    cegger #include <dev/acpi/acpica.h>
     38  1.2    cegger 
     39  1.2    cegger /* GAS address space ID constants. */
     40  1.2    cegger #define	ACPI_GAS_MEMORY		0
     41  1.2    cegger #define	ACPI_GAS_IO		1
     42  1.2    cegger #define	ACPI_GAS_PCI		2
     43  1.2    cegger #define	ACPI_GAS_EMBEDDED	3
     44  1.2    cegger #define	ACPI_GAS_SMBUS		4
     45  1.2    cegger #define	ACPI_GAS_CMOS		5
     46  1.2    cegger #define	ACPI_GAS_PCIBAR		6
     47  1.2    cegger #define	ACPI_GAS_DATATABLE	7
     48  1.2    cegger #define	ACPI_GAS_FIXED		0x7f
     49  1.2    cegger 
     50  1.2    cegger /* Subfields in the HPET Id member. */
     51  1.2    cegger #define	ACPI_HPET_ID_HARDWARE_REV_ID	0x000000ff
     52  1.2    cegger #define	ACPI_HPET_ID_COMPARATORS	0x00001f00
     53  1.2    cegger #define	ACPI_HPET_ID_COUNT_SIZE_CAP	0x00002000
     54  1.2    cegger #define	ACPI_HPET_ID_LEGACY_CAPABLE	0x00008000
     55  1.2    cegger #define	ACPI_HPET_ID_PCI_VENDOR_ID	0xffff0000
     56  1.2    cegger 
     57  1.2    cegger /* Find and map the RSD PTR structure and return it for parsing */
     58  1.2    cegger ACPI_TABLE_HEADER *sdt_load_devmem(void);
     59  1.2    cegger 
     60  1.2    cegger /*
     61  1.2    cegger  * Load the DSDT from a previous save file.  Note that other tables are
     62  1.2    cegger  * not saved (i.e. FADT)
     63  1.2    cegger  */
     64  1.2    cegger ACPI_TABLE_HEADER *dsdt_load_file(char *);
     65  1.2    cegger 
     66  1.2    cegger /* Save the DSDT to a file */
     67  1.2    cegger void	 dsdt_save_file(char *, ACPI_TABLE_HEADER *, ACPI_TABLE_HEADER *);
     68  1.2    cegger 
     69  1.2    cegger /* Print out as many fixed tables as possible, given the RSD PTR */
     70  1.2    cegger void	 sdt_print_all(ACPI_TABLE_HEADER *);
     71  1.2    cegger 
     72  1.2    cegger /* Disassemble the AML in the DSDT */
     73  1.2    cegger void	 aml_disassemble(ACPI_TABLE_HEADER *, ACPI_TABLE_HEADER *);
     74  1.2    cegger 
     75  1.2    cegger /* Routines for accessing tables in physical memory */
     76  1.2    cegger ACPI_TABLE_RSDP *acpi_find_rsd_ptr(void);
     77  1.2    cegger void	*acpi_map_physical(vm_offset_t, size_t);
     78  1.2    cegger ACPI_TABLE_HEADER *sdt_from_rsdt(ACPI_TABLE_HEADER *, const char *,
     79  1.2    cegger 	    ACPI_TABLE_HEADER *);
     80  1.2    cegger ACPI_TABLE_HEADER *dsdt_from_fadt(ACPI_TABLE_FADT *);
     81  1.2    cegger int	 acpi_checksum(void *, size_t);
     82  1.2    cegger 
     83  1.2    cegger /* Command line flags */
     84  1.2    cegger extern int	dflag;
     85  1.2    cegger extern int	tflag;
     86  1.2    cegger extern int	vflag;
     87  1.1  christos 
     88  1.1  christos #endif	/* !_ACPIDUMP_H_ */
     89