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 /* 228906SEric.Saxe@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 25*9652SMichael.Corcoran@Sun.COM /* 26*9652SMichael.Corcoran@Sun.COM * Copyright (c) 2009, Intel Corporation. 27*9652SMichael.Corcoran@Sun.COM * All rights reserved. 28*9652SMichael.Corcoran@Sun.COM */ 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifndef _SYS_ACPICA_H 310Sstevel@tonic-gate #define _SYS_ACPICA_H 320Sstevel@tonic-gate 330Sstevel@tonic-gate #ifdef __cplusplus 340Sstevel@tonic-gate extern "C" { 350Sstevel@tonic-gate #endif 360Sstevel@tonic-gate 370Sstevel@tonic-gate typedef struct { 380Sstevel@tonic-gate dev_info_t *dip; 390Sstevel@tonic-gate kmutex_t mutex; 400Sstevel@tonic-gate ddi_iblock_cookie_t iblock_cookie; 410Sstevel@tonic-gate } AcpiCA; 420Sstevel@tonic-gate 430Sstevel@tonic-gate /* acpi-user-options options property */ 440Sstevel@tonic-gate extern unsigned int acpi_options_prop; 450Sstevel@tonic-gate #define ACPI_OUSER_MASK 0x0003 460Sstevel@tonic-gate #define ACPI_OUSER_DFLT 0x0000 470Sstevel@tonic-gate #define ACPI_OUSER_ON 0x0001 480Sstevel@tonic-gate #define ACPI_OUSER_OFF 0x0002 490Sstevel@tonic-gate #define ACPI_OUSER_MADT 0x0004 500Sstevel@tonic-gate #define ACPI_OUSER_LEGACY 0x0008 510Sstevel@tonic-gate 520Sstevel@tonic-gate 530Sstevel@tonic-gate /* 540Sstevel@tonic-gate * Initialization state of the ACPI CA subsystem 550Sstevel@tonic-gate */ 560Sstevel@tonic-gate #define ACPICA_NOT_INITIALIZED (0) 570Sstevel@tonic-gate #define ACPICA_INITIALIZED (1) 580Sstevel@tonic-gate 590Sstevel@tonic-gate extern int acpica_init(void); 600Sstevel@tonic-gate extern void acpica_ec_init(void); 610Sstevel@tonic-gate 62250Ssmall /* 63250Ssmall * acpi_status property values 64250Ssmall */ 65250Ssmall #define ACPI_BOOT_INIT 0x00000001 66250Ssmall #define ACPI_BOOT_ENABLE 0x00000002 67250Ssmall #define ACPI_BOOT_BOOTCONF 0x00000010 68250Ssmall 690Sstevel@tonic-gate #define SCI_IPL (LOCK_LEVEL-1) 700Sstevel@tonic-gate 710Sstevel@tonic-gate /* 720Sstevel@tonic-gate * definitions of Bus Type 730Sstevel@tonic-gate */ 740Sstevel@tonic-gate #define BUS_CBUS 1 750Sstevel@tonic-gate #define BUS_CBUSII 2 760Sstevel@tonic-gate #define BUS_EISA 3 770Sstevel@tonic-gate #define BUS_FUTURE 4 780Sstevel@tonic-gate #define BUS_INTERN 5 790Sstevel@tonic-gate #define BUS_ISA 6 800Sstevel@tonic-gate #define BUS_MBI 7 810Sstevel@tonic-gate #define BUS_MBII 8 822980Srs90106 #define BUS_PCIE 9 830Sstevel@tonic-gate #define BUS_MPI 10 840Sstevel@tonic-gate #define BUS_MPSA 11 850Sstevel@tonic-gate #define BUS_NUBUS 12 860Sstevel@tonic-gate #define BUS_PCI 13 870Sstevel@tonic-gate #define BUS_PCMCIA 14 880Sstevel@tonic-gate #define BUS_TC 15 890Sstevel@tonic-gate #define BUS_VL 16 900Sstevel@tonic-gate #define BUS_VME 17 910Sstevel@tonic-gate #define BUS_XPRESS 18 920Sstevel@tonic-gate 930Sstevel@tonic-gate 940Sstevel@tonic-gate /* 950Sstevel@tonic-gate * intr_po - polarity definitions 960Sstevel@tonic-gate */ 970Sstevel@tonic-gate #define INTR_PO_CONFORM 0x00 980Sstevel@tonic-gate #define INTR_PO_ACTIVE_HIGH 0x01 990Sstevel@tonic-gate #define INTR_PO_RESERVED 0x02 1000Sstevel@tonic-gate #define INTR_PO_ACTIVE_LOW 0x03 1010Sstevel@tonic-gate 1020Sstevel@tonic-gate /* 1030Sstevel@tonic-gate * intr_el edge or level definitions 1040Sstevel@tonic-gate */ 1050Sstevel@tonic-gate #define INTR_EL_CONFORM 0x00 1060Sstevel@tonic-gate #define INTR_EL_EDGE 0x01 1070Sstevel@tonic-gate #define INTR_EL_RESERVED 0x02 1080Sstevel@tonic-gate #define INTR_EL_LEVEL 0x03 1090Sstevel@tonic-gate 1100Sstevel@tonic-gate /* 1110Sstevel@tonic-gate * interrupt flags structure 1120Sstevel@tonic-gate */ 1130Sstevel@tonic-gate typedef struct iflag { 1140Sstevel@tonic-gate uchar_t intr_po: 2, 1150Sstevel@tonic-gate intr_el: 2, 1160Sstevel@tonic-gate bustype: 4; 1170Sstevel@tonic-gate } iflag_t; 1180Sstevel@tonic-gate 1190Sstevel@tonic-gate /* _HID for PCI bus object */ 1200Sstevel@tonic-gate #define HID_PCI_BUS 0x30AD041 1210Sstevel@tonic-gate #define HID_PCI_EXPRESS_BUS 0x080AD041 1220Sstevel@tonic-gate 123*9652SMichael.Corcoran@Sun.COM /* ACPICA subsystem has been fully initialized except SCI interrupt. */ 124*9652SMichael.Corcoran@Sun.COM #define ACPI_FEATURE_FULL_INIT 0x1 125*9652SMichael.Corcoran@Sun.COM /* ACPI SCI interrupt has been enabled. */ 126*9652SMichael.Corcoran@Sun.COM #define ACPI_FEATURE_SCI_EVENT 0x2 127*9652SMichael.Corcoran@Sun.COM /* ACPI device configuration has been enabled. */ 128*9652SMichael.Corcoran@Sun.COM #define ACPI_FEATURE_DEVCFG 0x4 129*9652SMichael.Corcoran@Sun.COM /* ACPI _OSI method should report support of ACPI Module Device. */ 130*9652SMichael.Corcoran@Sun.COM #define ACPI_FEATURE_OSI_MODULE 0x8 131*9652SMichael.Corcoran@Sun.COM 132*9652SMichael.Corcoran@Sun.COM /* ACPI device configuration features. */ 133*9652SMichael.Corcoran@Sun.COM #define ACPI_DEVCFG_CPU 0x1 134*9652SMichael.Corcoran@Sun.COM #define ACPI_DEVCFG_MEMORY 0x2 135*9652SMichael.Corcoran@Sun.COM #define ACPI_DEVCFG_CONTAINER 0x4 136*9652SMichael.Corcoran@Sun.COM 1370Sstevel@tonic-gate /* 1384667Smh27603 * Function prototypes 1390Sstevel@tonic-gate */ 1404667Smh27603 extern ACPI_STATUS acpica_get_sci(int *, iflag_t *); 1414667Smh27603 extern int acpica_get_bdf(dev_info_t *, int *, int *, int *); 142*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_eval_int(ACPI_HANDLE, char *, int *); 143*9652SMichael.Corcoran@Sun.COM extern void acpica_ddi_save_resources(dev_info_t *); 144*9652SMichael.Corcoran@Sun.COM extern void acpica_ddi_restore_resources(dev_info_t *); 145*9652SMichael.Corcoran@Sun.COM extern void acpica_get_global_FADT(ACPI_TABLE_FADT **); 146*9652SMichael.Corcoran@Sun.COM 147*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_tag_devinfo(dev_info_t *, ACPI_HANDLE); 148*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_untag_devinfo(dev_info_t *, ACPI_HANDLE); 1494667Smh27603 extern ACPI_STATUS acpica_get_devinfo(ACPI_HANDLE, dev_info_t **); 1504667Smh27603 extern ACPI_STATUS acpica_get_handle(dev_info_t *, ACPI_HANDLE *); 1518906SEric.Saxe@Sun.COM extern ACPI_STATUS acpica_get_handle_cpu(int, ACPI_HANDLE *); 152*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_build_processor_map(void); 153*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_add_processor_to_map(UINT32, ACPI_HANDLE, UINT32); 154*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_remove_processor_from_map(UINT32); 155*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_map_cpu(processorid_t, UINT32); 156*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_unmap_cpu(processorid_t); 157*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_get_cpu_object_by_cpuid(processorid_t, ACPI_HANDLE *); 158*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_get_cpu_object_by_procid(UINT32, ACPI_HANDLE *); 159*9652SMichael.Corcoran@Sun.COM extern ACPI_STATUS acpica_get_cpu_object_by_apicid(UINT32, ACPI_HANDLE *); 160*9652SMichael.Corcoran@Sun.COM 161*9652SMichael.Corcoran@Sun.COM extern uint64_t acpica_get_core_feature(uint64_t); 162*9652SMichael.Corcoran@Sun.COM extern void acpica_set_core_feature(uint64_t); 163*9652SMichael.Corcoran@Sun.COM extern void acpica_clear_core_feature(uint64_t); 164*9652SMichael.Corcoran@Sun.COM extern uint64_t acpica_get_devcfg_feature(uint64_t); 165*9652SMichael.Corcoran@Sun.COM extern void acpica_set_devcfg_feature(uint64_t); 166*9652SMichael.Corcoran@Sun.COM extern void acpica_clear_devcfg_feature(uint64_t); 1670Sstevel@tonic-gate 1680Sstevel@tonic-gate #ifdef __cplusplus 1690Sstevel@tonic-gate } 1700Sstevel@tonic-gate #endif 1710Sstevel@tonic-gate 1720Sstevel@tonic-gate #endif /* _SYS_ACPICA_H */ 173