xref: /minix3/sys/arch/x86/include/acpi_machdep.h (revision 1cd76c751364e6270e8d5a0daebc6d3d169baf4d)
1*1cd76c75SBen Gras /*	$NetBSD: acpi_machdep.h,v 1.11 2012/09/23 00:31:05 chs Exp $	*/
2*1cd76c75SBen Gras 
3*1cd76c75SBen Gras /*
4*1cd76c75SBen Gras  * Copyright 2001 Wasabi Systems, Inc.
5*1cd76c75SBen Gras  * All rights reserved.
6*1cd76c75SBen Gras  *
7*1cd76c75SBen Gras  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8*1cd76c75SBen Gras  *
9*1cd76c75SBen Gras  * Redistribution and use in source and binary forms, with or without
10*1cd76c75SBen Gras  * modification, are permitted provided that the following conditions
11*1cd76c75SBen Gras  * are met:
12*1cd76c75SBen Gras  * 1. Redistributions of source code must retain the above copyright
13*1cd76c75SBen Gras  *    notice, this list of conditions and the following disclaimer.
14*1cd76c75SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
15*1cd76c75SBen Gras  *    notice, this list of conditions and the following disclaimer in the
16*1cd76c75SBen Gras  *    documentation and/or other materials provided with the distribution.
17*1cd76c75SBen Gras  * 3. All advertising materials mentioning features or use of this software
18*1cd76c75SBen Gras  *    must display the following acknowledgement:
19*1cd76c75SBen Gras  *	This product includes software developed for the NetBSD Project by
20*1cd76c75SBen Gras  *	Wasabi Systems, Inc.
21*1cd76c75SBen Gras  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22*1cd76c75SBen Gras  *    or promote products derived from this software without specific prior
23*1cd76c75SBen Gras  *    written permission.
24*1cd76c75SBen Gras  *
25*1cd76c75SBen Gras  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26*1cd76c75SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27*1cd76c75SBen Gras  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28*1cd76c75SBen Gras  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
29*1cd76c75SBen Gras  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30*1cd76c75SBen Gras  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31*1cd76c75SBen Gras  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32*1cd76c75SBen Gras  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33*1cd76c75SBen Gras  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34*1cd76c75SBen Gras  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35*1cd76c75SBen Gras  * POSSIBILITY OF SUCH DAMAGE.
36*1cd76c75SBen Gras  */
37*1cd76c75SBen Gras 
38*1cd76c75SBen Gras #ifndef _X86_ACPI_MACHDEP_H_
39*1cd76c75SBen Gras #define _X86_ACPI_MACHDEP_H_
40*1cd76c75SBen Gras 
41*1cd76c75SBen Gras /*
42*1cd76c75SBen Gras  * Machine-dependent code for ACPI.
43*1cd76c75SBen Gras  */
44*1cd76c75SBen Gras #include <machine/pio.h>
45*1cd76c75SBen Gras #include <machine/i82489var.h>
46*1cd76c75SBen Gras #include <machine/i82489reg.h>
47*1cd76c75SBen Gras 
48*1cd76c75SBen Gras ACPI_STATUS		acpi_md_OsInitialize(void);
49*1cd76c75SBen Gras ACPI_PHYSICAL_ADDRESS	acpi_md_OsGetRootPointer(void);
50*1cd76c75SBen Gras 
51*1cd76c75SBen Gras #define	acpi_md_OsIn8(x)	inb((x))
52*1cd76c75SBen Gras #define	acpi_md_OsIn16(x)	inw((x))
53*1cd76c75SBen Gras #define	acpi_md_OsIn32(x)	inl((x))
54*1cd76c75SBen Gras 
55*1cd76c75SBen Gras #define	acpi_md_OsOut8(x, v)	outb((x), (v))
56*1cd76c75SBen Gras #define	acpi_md_OsOut16(x, v)	outw((x), (v))
57*1cd76c75SBen Gras #define	acpi_md_OsOut32(x, v)	outl((x), (v))
58*1cd76c75SBen Gras 
59*1cd76c75SBen Gras ACPI_STATUS	acpi_md_OsInstallInterruptHandler(UINT32,
60*1cd76c75SBen Gras 		    ACPI_OSD_HANDLER, void *, void **);
61*1cd76c75SBen Gras void		acpi_md_OsRemoveInterruptHandler(void *);
62*1cd76c75SBen Gras 
63*1cd76c75SBen Gras ACPI_STATUS	acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **);
64*1cd76c75SBen Gras void		acpi_md_OsUnmapMemory(void *, UINT32);
65*1cd76c75SBen Gras ACPI_STATUS	acpi_md_OsGetPhysicalAddress(void *LogicalAddress,
66*1cd76c75SBen Gras 		    ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
67*1cd76c75SBen Gras 
68*1cd76c75SBen Gras BOOLEAN		acpi_md_OsReadable(void *, UINT32);
69*1cd76c75SBen Gras BOOLEAN		acpi_md_OsWritable(void *, UINT32);
70*1cd76c75SBen Gras void		acpi_md_OsDisableInterrupt(void);
71*1cd76c75SBen Gras void		acpi_md_OsEnableInterrupt(void);
72*1cd76c75SBen Gras 
73*1cd76c75SBen Gras int		acpi_md_sleep(int);
74*1cd76c75SBen Gras void		acpi_md_sleep_init(void);
75*1cd76c75SBen Gras 
76*1cd76c75SBen Gras uint32_t	acpi_md_pdc(void);
77*1cd76c75SBen Gras uint32_t	acpi_md_ncpus(void);
78*1cd76c75SBen Gras struct acpi_softc;
79*1cd76c75SBen Gras void		acpi_md_callback(struct acpi_softc *);
80*1cd76c75SBen Gras 
81*1cd76c75SBen Gras #endif /* !_X86_ACPI_MACHDEP_H_ */
82