xref: /onnv-gate/usr/src/uts/intel/sys/acpica.h (revision 4667:2cb417b1d90c)
134Ssmall /*
234Ssmall  * CDDL HEADER START
334Ssmall  *
434Ssmall  * The contents of this file are subject to the terms of the
52980Srs90106  * Common Development and Distribution License (the "License").
62980Srs90106  * You may not use this file except in compliance with the License.
734Ssmall  *
834Ssmall  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
934Ssmall  * or http://www.opensolaris.org/os/licensing.
1034Ssmall  * See the License for the specific language governing permissions
1134Ssmall  * and limitations under the License.
1234Ssmall  *
1334Ssmall  * When distributing Covered Code, include this CDDL HEADER in each
1434Ssmall  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1534Ssmall  * If applicable, add the following below this CDDL HEADER, with the
1634Ssmall  * fields enclosed by brackets "[]" replaced with your own identifying
1734Ssmall  * information: Portions Copyright [yyyy] [name of copyright owner]
1834Ssmall  *
1934Ssmall  * CDDL HEADER END
2034Ssmall  */
210Sstevel@tonic-gate /*
22*4667Smh27603  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef _SYS_ACPICA_H
270Sstevel@tonic-gate #define	_SYS_ACPICA_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #ifdef __cplusplus
320Sstevel@tonic-gate extern "C" {
330Sstevel@tonic-gate #endif
340Sstevel@tonic-gate 
350Sstevel@tonic-gate typedef struct {
360Sstevel@tonic-gate 	dev_info_t		*dip;
370Sstevel@tonic-gate 	kmutex_t		mutex;
380Sstevel@tonic-gate 	ddi_iblock_cookie_t	iblock_cookie;
390Sstevel@tonic-gate } AcpiCA;
400Sstevel@tonic-gate 
410Sstevel@tonic-gate /* acpi-user-options options property */
420Sstevel@tonic-gate extern unsigned int acpi_options_prop;
430Sstevel@tonic-gate #define	ACPI_OUSER_MASK		0x0003
440Sstevel@tonic-gate #define	ACPI_OUSER_DFLT		0x0000
450Sstevel@tonic-gate #define	ACPI_OUSER_ON		0x0001
460Sstevel@tonic-gate #define	ACPI_OUSER_OFF		0x0002
470Sstevel@tonic-gate #define	ACPI_OUSER_MADT		0x0004
480Sstevel@tonic-gate #define	ACPI_OUSER_LEGACY	0x0008
490Sstevel@tonic-gate 
500Sstevel@tonic-gate 
510Sstevel@tonic-gate /*
520Sstevel@tonic-gate  * Initialization state of the ACPI CA subsystem
530Sstevel@tonic-gate  */
540Sstevel@tonic-gate #define	ACPICA_NOT_INITIALIZED	(0)
550Sstevel@tonic-gate #define	ACPICA_INITIALIZED	(1)
560Sstevel@tonic-gate 
570Sstevel@tonic-gate extern int acpica_init(void);
580Sstevel@tonic-gate extern void acpica_ec_init(void);
590Sstevel@tonic-gate 
60250Ssmall /*
61250Ssmall  * acpi_status property values
62250Ssmall  */
63250Ssmall #define	ACPI_BOOT_INIT		0x00000001
64250Ssmall #define	ACPI_BOOT_ENABLE	0x00000002
65250Ssmall #define	ACPI_BOOT_BOOTCONF	0x00000010
66250Ssmall 
670Sstevel@tonic-gate #define	SCI_IPL	(LOCK_LEVEL-1)
680Sstevel@tonic-gate 
690Sstevel@tonic-gate /*
700Sstevel@tonic-gate  * definitions of Bus Type
710Sstevel@tonic-gate  */
720Sstevel@tonic-gate #define	BUS_CBUS	1
730Sstevel@tonic-gate #define	BUS_CBUSII	2
740Sstevel@tonic-gate #define	BUS_EISA	3
750Sstevel@tonic-gate #define	BUS_FUTURE	4
760Sstevel@tonic-gate #define	BUS_INTERN	5
770Sstevel@tonic-gate #define	BUS_ISA		6
780Sstevel@tonic-gate #define	BUS_MBI		7
790Sstevel@tonic-gate #define	BUS_MBII	8
802980Srs90106 #define	BUS_PCIE	9
810Sstevel@tonic-gate #define	BUS_MPI		10
820Sstevel@tonic-gate #define	BUS_MPSA	11
830Sstevel@tonic-gate #define	BUS_NUBUS	12
840Sstevel@tonic-gate #define	BUS_PCI		13
850Sstevel@tonic-gate #define	BUS_PCMCIA	14
860Sstevel@tonic-gate #define	BUS_TC		15
870Sstevel@tonic-gate #define	BUS_VL		16
880Sstevel@tonic-gate #define	BUS_VME		17
890Sstevel@tonic-gate #define	BUS_XPRESS	18
900Sstevel@tonic-gate 
910Sstevel@tonic-gate 
920Sstevel@tonic-gate /*
930Sstevel@tonic-gate  * intr_po - polarity definitions
940Sstevel@tonic-gate  */
950Sstevel@tonic-gate #define	INTR_PO_CONFORM		0x00
960Sstevel@tonic-gate #define	INTR_PO_ACTIVE_HIGH	0x01
970Sstevel@tonic-gate #define	INTR_PO_RESERVED	0x02
980Sstevel@tonic-gate #define	INTR_PO_ACTIVE_LOW	0x03
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate /*
1010Sstevel@tonic-gate  * intr_el edge or level definitions
1020Sstevel@tonic-gate  */
1030Sstevel@tonic-gate #define	INTR_EL_CONFORM		0x00
1040Sstevel@tonic-gate #define	INTR_EL_EDGE		0x01
1050Sstevel@tonic-gate #define	INTR_EL_RESERVED	0x02
1060Sstevel@tonic-gate #define	INTR_EL_LEVEL		0x03
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate /*
1090Sstevel@tonic-gate  * interrupt flags structure
1100Sstevel@tonic-gate  */
1110Sstevel@tonic-gate typedef struct iflag {
1120Sstevel@tonic-gate 	uchar_t	intr_po: 2,
1130Sstevel@tonic-gate 		intr_el: 2,
1140Sstevel@tonic-gate 		bustype: 4;
1150Sstevel@tonic-gate } iflag_t;
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate /* _HID for PCI bus object */
1180Sstevel@tonic-gate #define	HID_PCI_BUS		0x30AD041
1190Sstevel@tonic-gate #define	HID_PCI_EXPRESS_BUS	0x080AD041
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate /*
122*4667Smh27603  * Function prototypes
1230Sstevel@tonic-gate  */
124*4667Smh27603 extern ACPI_STATUS acpica_get_sci(int *, iflag_t *);
125*4667Smh27603 extern int acpica_get_bdf(dev_info_t *, int *, int *, int *);
126*4667Smh27603 extern ACPI_STATUS acpica_get_devinfo(ACPI_HANDLE, dev_info_t **);
127*4667Smh27603 extern ACPI_STATUS acpica_get_handle(dev_info_t *, ACPI_HANDLE *);
128*4667Smh27603 extern ACPI_STATUS acpica_eval_int(ACPI_HANDLE, char *, int *);
129*4667Smh27603 extern void acpica_map_cpu(processorid_t, MADT_PROCESSOR_APIC *);
130*4667Smh27603 extern void acpica_build_processor_map();
1310Sstevel@tonic-gate 
1320Sstevel@tonic-gate #ifdef __cplusplus
1330Sstevel@tonic-gate }
1340Sstevel@tonic-gate #endif
1350Sstevel@tonic-gate 
1360Sstevel@tonic-gate #endif /* _SYS_ACPICA_H */
137