/* ************************************************************************* */ /* * * */ /* * HPE CONFIDENTIAL. This software is confidential proprietary software * */ /* * licensed by Hewlett Packard Enterprise Development, LP, and is not * */ /* * authorized to be used, duplicated or disclosed to anyone without the * */ /* * prior written permission of HPE. * */ /* * Copyright 2017 Hewlett Packard Enterprise Development, LP * */ /* * * */ /* * VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential * */ /* * proprietary software licensed by VMS Software, Inc., and is not * */ /* * authorized to be used, duplicated or disclosed to anyone without * */ /* * the prior written permission of VMS Software, Inc. * */ /* * Copyright 2017-2020 VMS Software, Inc. * */ /* * * */ /* ************************************************************************* */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // DESCRIPTION: The ACPI OSL (Operating System Layer) provides the interface // between OpenVMS EXEC components and the ACPI-CA (Component Architecture) // subsystem. ACPI exists as an execlet (SYS$ACPI) loaded during bootstrap. // When the boot process determines the machine is ACPI-capable (as all IPF // systems must be), an ACPI-aware SYS$CPU_ROUTINES execlet is loaded. This // module will initialize and enable ACPI. From that point forth, all // access to ACPI data structures, devices, and methods must go through the // acpi$osl routines described herein. If you don't see a routine to do what // you are trying to do with ACPI, contact the author. // // REVISION HISTORY: // // X-21 GMN G.M.Newsted 09-Apr-2020 // Redefine acpi$osl_bib_reset to use arg to select // Reset or Power-Off functions on x86. The prior use // of this arg was "cpuid" which was ignored. Behavior // on IA64 is unchanged. // // X-20 RAB Richard A. Bishop 27-Jan-2020 // Use ARCH_DEFS for platform conditionals so that // cross-platform SDA will build. // // X-19 MLW Michael Winiarski 22-Oct-2019 // Add function prototypes for acpi$osl_intrpt_override(). // // X-18 MLW Michael Winiarski 29-Aug-2019 // Add function prototypes for acpi$osl_ioapic_config() and // acpi$osl_ioapic_find_rte() for non IA64 builds. // // X-17 AHM Drew Mason 29-May-2019 // Conditionalized acpi$osl_iosapic_config and acpi$osl_iosapic_find_rte // to IA64. Add the corresponding I/O APIC definitions for x86. // // X-16 08-Nov-2018 Michael Winiarski // With the change in X-15, the acpi.h header file // was included. Since ACPI is compiled with uses long // pointers, bracket the acpi.h header with pointer_size // pragmas -- this ensures ACPI structure sizes are correct // throughout. // // X-15 19-Oct-2018 Michael Winiarski // Added definition of VMS-styled jacket routine // acpi$osl_get_table. // // X-14 19-Jul-2017 Michael Winiarski // * Support for ACPICA.ORG 20170531 code drop // // X-13 PAJ1533 Paul A. Jacobi 10-Jun-2008 // 1) Fix VGA structure definitions to match specification. // 2) Define bitfields for PCDP flags field. // 3) Seperate the flags field from the HCDP function field. // 4) Reset module Ident to match VDE. // // X13 23-Apr-2008 LSS0541 Leonard S. Szubowicz // Add definition of VMS-styled constants for various ACPI // types. These are of use to callers of various ACPI$OSL_x // routines. Add function prototype for ACPI$OSL_GET_OBJECT_TYPE. // // X12 18-Apr-2008 RAB Richard A. Bishop // Put the new definitions added in X11 under the conditional // _ACPI_OSL_EXTENSION_STRUCTURES so that only [ACPI]OSLVMS.C // and [SDA]SHOWACPI.C pick them up. Without this, several // modules that use OSLVMS.H now have a dependency on many // other ACPI headers. // // X11 11-Apr-2008 RAB Richard A. Bishop // Moved definitions here from OSLVMS.C so SDA can use them // // X10 20-Mar-2008 LSS0539 Leonard S. Szubowicz // Add function prototypes for ACPI$OSL_WALK_NAMESPACE and // ACPI$OSL_GET_DEVICES, initially for SYS$GET_WBEM_INFO. // // X9 8-Jan-2008 WDA W.D.Arbo // Add ACPI$OSL_GET_STATISTICS, ACPI$OSL_INSTALL_TABLE_HANDLER // and ACPI$REMOVE_TABLE_HANDLER. // // [acpi]oslvms (not this file) will be obsoleted with this // checkin. // // Port this update from the obsoleted [acpi]oslvms. // // X7 06-Jul-2005 ER Eric Rasmussen // Add ACPI$OSL_FIXED_CONFIG. // // // X8 8-May-2006 JRK Jim Kauffman // Add acpi$osl_bib_reset // // X7 5-May-2005 KLN3568 Karen L. Noel // Fix acpi$osl_execute_method and acpi$osl_exec_numeric_method. // // X6 25-Apr-2005 KLN3567 Karen L. Noel // Move funtion prototypes from gpscfgdef to here. // // X5 06-May-2003 TLC Tony Camuso // Changed GPSPORTDEV Addr field to unsigned quad. // Renamed GPSHEADER uqIdString field to uqHwId. // // X4 22-Apr-2003 GMN Gary M. Newsted // Merged gps_configdef.h into this header. // // X3 18-Apr-2003 GMN Gary M. Newsted // Eliminated ACPI-specific datatypes and includes. // // X2 04-Mar-2003 GMN Gary M. Newsted // Added HCDP structure defs & HCDP routines // // X1 15-Jan-2003 GMN Gary M. Newsted // Initial module creation //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifndef __ACPI_OSLVMS_H__ #define __ACPI_OSLVMS_H__ #include #include // uint64, uint32, etc. #include #pragma __pointer_size __save #pragma __pointer_size __long #include #pragma __pointer_size __restore //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // VMS-styled ACPI constants //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // These ACPI constants are useful in conjunction with some of the // ACPI$OSL_x routines, whose prototypes are defined in this header file. // // Note: Compilation of module [ACPI]OSLVMS.C will validate the equality of // these symbols to their corresponding native ACPI constants, which are // defined by [ACPI]ACTYPES.H. #define ACPI$K_TYPE_ANY 0x00 #define ACPI$K_TYPE_INTEGER 0x01 // Byte/Word/Dword/Zero/One/Ones #define ACPI$K_TYPE_STRING 0x02 #define ACPI$K_TYPE_BUFFER 0x03 #define ACPI$K_TYPE_PACKAGE 0x04 // ByteConst, multiple DataTerm/Constant/SuperName #define ACPI$K_TYPE_FIELD_UNIT 0x05 #define ACPI$K_TYPE_DEVICE 0x06 // Name, multiple Node #define ACPI$K_TYPE_EVENT 0x07 #define ACPI$K_TYPE_METHOD 0x08 // Name, ByteConst, multiple Code #define ACPI$K_TYPE_MUTEX 0x09 #define ACPI$K_TYPE_REGION 0x0A #define ACPI$K_TYPE_POWER 0x0B // Name,ByteConst,WordConst,multi Node #define ACPI$K_TYPE_PROCESSOR 0x0C // Name,ByteConst,DWordConst,ByteConst,multi NmO #define ACPI$K_TYPE_THERMAL 0x0D // Name, multiple Node #define ACPI$K_TYPE_BUFFER_FIELD 0x0E #define ACPI$K_ROOT_OBJECT (uint64)( ~((uint64) 0) ) // Root object handle in ACPI namespace #define ACPI$K_UINT32_MAX (uint32)( ~((uint32) 0) ) // Max 32-bit unsigned integer #define ACPI$K_AE_OK 0x0000 // ACPI_STATUS AE_OK, success #define ACPI$K_AE_CODE_CONTROL 0x4000 // ACPI_STATUS AE_CODE_CONTROL, control code #define ACPI$K_AE_CTRL_TERMINATE (0x0003 | ACPI$K_AE_CODE_CONTROL) // ACPI_STATUS, terminate //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // OSL FUNCTION PROTOTYPES - Support for VMS EXEC routines //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __long /* And set ptr size default to 64-bit pointers */ #endif #define acpi$osl_init_execlet ACPI$OSL_INIT_EXECLET int acpi$osl_init_execlet (void); #if IA64 // Verified for x86 port--Drew Mason & Richard Bishop #define acpi$osl_iosapic_config ACPI$OSL_IOSAPIC_CONFIG int acpi$osl_iosapic_config (void (*pfCB_User)(void), GPSIOSAPICINFO *pIoSapicInfo); #define acpi$osl_iosapic_find_rte ACPI$OSL_IOSAPIC_FIND_RTE int acpi$osl_iosapic_find_rte (unsigned int ulGsin, int *iRteOffset, unsigned __int64 *pIoSapicAddress); #else // Verified for x86 port - Michael Winiarski #define acpi$osl_ioapic_config ACPI$OSL_IOAPIC_CONFIG int acpi$osl_ioapic_config (void (*pfCB_User)(void), GPSIOAPICINFO *pIoApicInfo); #define acpi$osl_ioapic_find_rte ACPI$OSL_IOAPIC_FIND_RTE int acpi$osl_ioapic_find_rte (unsigned int ulGsin, int *iRteOffset, unsigned __int64 *pIoApicAddress); #endif // X-19 #define acpi$osl_intrpt_override ACPI$OSL_INTRPT_OVERRIDE int acpi$osl_intrpt_override (UINT32 Gsin, UINT32 *newGsin, UINT16 *newPolTrig); // end X-19 #define acpi$osl_device_config ACPI$OSL_DEVICE_CONFIG int acpi$osl_device_config (void (*pfCB_User)(void), GPSCONFIG *pConfig); #define acpi$osl_hcdp_entries ACPI$OSL_HCDP_ENTRIES int acpi$osl_hcdp_entries(void); #define acpi$osl_console_config ACPI$OSL_CONSOLE_CONFIG int acpi$osl_console_config (void (*pfCB_User)(void),GPSHCDPDEV *pHcdpDev); #define acpi$osl_spmi_config ACPI$OSL_SPMI_CONFIG int acpi$osl_spmi_config (void (*pfCB_User)(void),GPSSPMI *pRetSpmi); #define acpi$osl_gpe_config ACPI$OSL_GPE_CONFIG int acpi$osl_gpe_config (void (*pfCB_User)(void),GPSGPEDEV *pRetGpe); #define acpi$osl_cpu_config ACPI$OSL_CPU_CONFIG int acpi$osl_cpu_config ( unsigned __int64 hStart, void ( *pfCB_User )( ), GPSCONFIG *pConfig ); #define acpi$osl_get_system_info ACPI$OSL_GET_SYSTEM_INFO int acpi$osl_get_system_info (GPSSYSINFO *pSysInfo); #define acpi$osl_bib_reset ACPI$OSL_BIB_RESET #if IA64 int acpi$osl_bib_reset (int cpuid); #else int acpi$osl_bib_reset (int power_off); #endif #pragma __required_pointer_size __save #pragma __required_pointer_size __short #define acpi$osl_get_crs_item ACPI$OSL_GET_CRS_ITEM int acpi$osl_get_crs_item ( unsigned __int64 uqHwHandle, int iResTag, int iTypeTag, int iAttrTag, void **ppvRetData); #define acpi$osl_get_prt ACPI$OSL_GET_PRT int acpi$osl_get_prt ( unsigned __int64 uqHwHandle, GPSPRTENTRY **ppvRetData); #pragma __required_pointer_size __restore #define acpi$osl_free ACPI$OSL_FREE int acpi$osl_free (void *pvBuffer); #define acpi$osl_exec_numeric_method ACPI$OSL_EXEC_NUMERIC_METHOD int acpi$osl_exec_numeric_method ( unsigned __int64 uqHwHandle, char *pMethodName, unsigned __int64 *pqRetData); #define acpi$osl_execute_debug_cmd ACPI$OSL_EXECUTE_DEBUG_CMD int acpi$osl_execute_debug_cmd (char * cmd); #define acpi$osl_execute_method ACPI$OSL_EXECUTE_METHOD int acpi$osl_execute_method (unsigned __int64 uqHwHandle, char *pMethodName, GPSDESCRIPTOR *psInParamArray, unsigned int uiInParamCnt, unsigned int *pulRetType, void **ppvRetData); #define acpi$osl_install_notify_handler ACPI$OSL_INSTALL_NOTIFY_HANDLER int acpi$osl_install_notify_handler (void * Handle, unsigned int Type, void (*Handler)(void * Device, unsigned int Value, void * Context), void *Context); #define acpi$osl_remove_notify_handler ACPI$OSL_REMOVE_NOTIFY_HANDLER int acpi$osl_remove_notify_handler (void * Handle, unsigned int Type, void (*Handler)(void * Device, unsigned int Value, void * Context)); #define acpi$osl_install_gpe_handler ACPI$OSL_INSTALL_GPE_HANDLER int acpi$osl_install_gpe_handler (void * Handle, unsigned int GpeNum, unsigned int Type, unsigned int (*Handler)(void * GpeDevice, unsigned int GpeNumber, void * Context), void *Context); #define acpi$osl_remove_gpe_handler ACPI$OSL_REMOVE_GPE_HANDLER int acpi$osl_remove_gpe_handler (void * Handle, unsigned int GpeNum, unsigned int (*Handler)(void * GpeDevice, unsigned int GpeNumber, void * context)); #define acpi$osl_install_fixed_handler ACPI$OSL_INSTALL_FIXED_HANDLER int acpi$osl_install_fixed_handler (unsigned int Event, unsigned int (*Handler)(void * Context), void *Context); #define acpi$osl_remove_fixed_handler ACPI$OSL_REMOVE_FIXED_HANDLER int acpi$osl_remove_fixed_handler (unsigned int Event, unsigned int (*Handler)(void * Context)); #define acpi$osl_get_pathname ACPI$OSL_GET_PATHNAME int acpi$osl_get_pathname (void * Object, unsigned char **Name); // Executes a callback for each fixed-feature device in the FADT. // #define acpi$osl_fixed_config ACPI$OSL_FIXED_CONFIG int acpi$osl_fixed_config (void (*pfCB_User)(void), GPSCONFIG *pConfig); // Fetches the SciCount,GpeCount,FixedEventCounts from ACPI // #define acpi$osl_get_statistics ACPI$OSL_GET_STATISTICS int acpi$osl_get_statistics (GPSSTATISTICS *statistics_buffer); // Install a handler to be called when an event occurs for a table. // #define acpi$osl_install_table_handler ACPI$OSL_INSTALL_TABLE_HANDLER int acpi$osl_install_table_handler (GPSTABLEHANDLER handler, void * context); // Remove a handler to be called when an event occurs for a table. // #define acpi$osl_remove_table_handler ACPI$OSL_REMOVE_TABLE_HANDLER int acpi$osl_remove_table_handler (GPSTABLEHANDLER handler); // Walk a portion of the ACPI namespace looking for ACPI objects of the // specified type. The specified callback routine is invoked for each // matching object. The portion can be specified such that the entire // ACPI namespace is traversed. #define acpi$osl_walk_namespace ACPI$OSL_WALK_NAMESPACE int acpi$osl_walk_namespace ( uint32 obj_type, uint64 start_obj_handle, uint32 max_depth, int (*call_back_rout)( uint64 obj_handle, uint32 nesting_level, void *context, void **return_value ), void *context, void **return_value ); // Walk the entire ACPI namespace looking for ACPI device objects that // match the specified Hardware ID (HID) string. The specified callback // routine is invoked for each matching device object. #define acpi$osl_get_devices ACPI$OSL_GET_DEVICES int acpi$osl_get_devices ( char *hid, int (*call_back_rout)( uint64 obj_handle, uint32 nesting_level, void *context, void **return_value ), void *context, void **return_value ); // Get the ACPI object type (ACPI$K_TYPE_x) of an object in the ACPI namespace. #define acpi$osl_get_object_type ACPI$OSL_GET_OBJECT_TYPE int acpi$osl_get_object_type ( uint64 obj_handle, uint32 *obj_type_p ); #define acpi$osl_get_table ACPI$OSL_GET_TABLE int acpi$osl_get_table (char *Signature, uint32 Instance, ACPI_TABLE_HEADER **OutTable); #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #endif #ifdef _ACPI_OSL_EXTENSION_STRUCTURES //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ACPI-OSL EXTENSION STRUCTURES (some of these may emerge in Intel headers) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Should only be needed by [ACPI]OSLVMS.C and [SDA]SHOWACPI.C // #pragma __member_alignment __save #pragma __nomember_alignment // HCDP - Headless Console & Debug Port Table def from DIG64 spec typedef struct { ACPI_TABLE_HEADER TableHeader; // actbl.h - 24 bytes UINT32 NumEntries; UINT32 Entry; // First entry } OSL_HCDP_HEADER; typedef struct { UINT8 Type; // 0 = UART Desc, 1 = DEBUGPORT Desc UINT8 NumDataBits; UINT8 Parity; UINT8 StopBits; UINT8 PciSegNum; // If UART is a PCI device UINT8 PciBusNum; // If UART is a PCI device UINT8 PciDeviceNum; // If UART is a PCI device struct { unsigned PciFunctionNum : 3; unsigned Rsvd : 3; unsigned InterruptFlag : 1; unsigned PciDeviceFlag : 1; } PciFunctionFields; UINT64 Baud; UINT8 AddressSpaceID; // 38 UINT8 RegisterBitWidth; UINT8 RegisterBitOffset; UINT8 Fill1; UINT64 BaseAddress; // 3C UINT16 DeviceID; UINT16 VendorID; UINT32 GlobalSystemInterrupt; UINT32 PseudoClockRate; UINT8 PciClass; UINT8 Fill2[7]; } OSL_HCDP_ENTRY; //============================================================================= // INTERCONNECT STRUCTURES // // For New Type (PCDP) Device Descriptor Entries, an area is reserved for the // Interconnect Data for access to the device through MMIO, Port, or PCI // Config space. // // See "DIG64 Descriptions for Primary Console & Debug Port Devices" // Table 2-4, Offset 6 // //============================================================================= #define INTERCONNECT_TYPE_ACPI 0 #define INTERCONNECT_TYPE_PCI 1 // ------------------- // INTERCONNECT_HEADER // ------------------- // Header for the Interconnect types is implemented as a macro rather // than as a separate data structure. The macro provides fields with // the same names when declared within other structures, allowing // access to the header fields common to all types. An additional // benefit is that the macro provides more maintainablility, since // changes made to the macro can propagate to other structures that // use it. // // See "DIG64 Descriptions for Primary Console & Debug Port Devices" // Tables 2-6 and 2-7, offsets 0, 1, and 2 // This header has a 4 byte (32 bit) displacement. // #define INTERCONNECT_HEADER \ UINT8 InterconnectType; \ UINT8 ICT_Reserved_0; \ UINT16 Length; // --------------------------- // INTERCONNECT_HEADER_OVERLAY // --------------------------- // The following structure is used in the INTERCONNECT union to access // the header fields for any INTERCONNECT type. // typedef struct { INTERCONNECT_HEADER } INTERCONNECT_HEADER_OVERLAY; // ------------------ // INTERCONNECT_FLAGS // ------------------ // "DIG64 Descriptions for Primary Console & Debug Port Devices" // Table 2-6, offset 32 // typedef struct { unsigned IrqMode : 1; // 0 = Edge, 1 = Level unsigned IrqPolarity : 1; // 0 = Hi, 1 = Lo unsigned Reserved_0 : 1; // MBZ unsigned SparseXlat : 1; // 1 = Sparse Translation (Port IO swizzle) unsigned MmioXlat : 1; // Memory-to-IO Translation unsigned Reserved_1 : 1; // MBZ unsigned IrqValid : 1; // 1 = IRQ supported unsigned Reserved_2 : 1; // MBZ } INTERCONNECT_FLAGS; // ------------------------ // INTERCONNECT_XLAT_FIELDS // ------------------------ // "DIG64 Descriptions for Primary Console & Debug Port Devices" // Table 2-6, offset 33 // typedef struct { unsigned MmIoTraValid : 1; unsigned PortIoTraValid : 1; unsigned Reserved : 6; } INTERCONNECT_XLAT; // -------------------- // INTERCONNECT_TRAILER // -------------------- // These are fields that are common to the APCI and PCI Interconnect types // See "DIG64 Descriptions for Primary Console & Debug Port Devices" // Tables 2-7 and 2-7. // #define INTERCONNECT_TRAILER \ UINT32 Gsin; \ UINT64 MmIoTra; \ UINT64 PortIoTra; \ INTERCONNECT_FLAGS Flags; \ INTERCONNECT_XLAT Xlat; // ----------------- // ACPI_INTERCONNECT // ----------------- // "DIG64 Descriptions for Primary Console & Debug Port Devices" // Table 2-6 // typedef struct { INTERCONNECT_HEADER // 4 Bytes UINT32 AcpiUid; UINT32 AcpiHid; INTERCONNECT_TRAILER } ACPI_INTERCONNECT; // ---------------- // PCI_INTERCONNECT // ---------------- // X-58 TLC 20060714 VGA Console Support // We must add the PCI Interconnect Specific structure for the PCDP in order to // properly characterize a possible VGA entry in the PCDP. Note that the fields // are aligned on natural boundaries, as defined in the DIG64 specification. // typedef struct { INTERCONNECT_HEADER // 4 Bytes UINT8 Segment; UINT8 Bus; UINT8 Device; // Only bits 4:0 are valid UINT8 Function; // Only bits 2:0 are valid UINT16 DeviceID; UINT16 VendorID; INTERCONNECT_TRAILER } PCI_INTERCONNECT; // ------------ // INTERCONNECT // ------------ // This union is basically "Any Interconnect" and provides access to the // header fields before knowing which type of interconnect was encountered. // We need to access the header fields first in order to determine which // type of interconnect was encountered. // typedef union { INTERCONNECT_HEADER_OVERLAY InterconnectX; ACPI_INTERCONNECT AcpiInterconnect; PCI_INTERCONNECT PciInterconnect; } INTERCONNECT; // See Table 2-4 in "DIG64 Descriptions for Primary Console & Debug Port Devices" // #if 0 // // This structure has been deprecated and has been replaced by the // macro below it. It is left here for historical reference. One // reason for deprecating it is that, once the type has been determined, // the pointer to the entry can be cast as that type to access the other // fields. This structure was replaced by the macro immediately below it, // where other reasons for replacing this structure with a macro are // detailed. // typedef struct { // PCDP new device type template UINT8 Type; UINT8 PrimaryConsole; // <0> UINT16 EntryLength; UINT16 ConDevIndex; } OSL_PCDP_NEWTYPE_ENTRY; #endif // ----------------------------- // OSL_PCDP_NEWTYPE_ENTRY_HEADER // ----------------------------- // See Table 2-4 in "DIG64 Descriptions for Primary Console & Debug Port // Devices" // // This defines the header fields of the new PCDP descriptor type header. // It is done as a macro so that the descriptors that use these header // fieds can use the macro rather than redefining the fields. This provides // more maintainability, because, if changes to the header are ever needed, // the changes only have to be made to the macro, whereupon the changes will // propagate to all the structures that use the macro. // #define OSL_PCDP_NEWTYPE_ENTRY_HEADER \ UINT8 Type; \ UINT8 PrimaryConsole; \ UINT16 EntryLength; \ UINT16 ConDevIndex; // ------------------------------------- // OSL_PCDP_NEWTYPE_ENTRY_HEADER_OVERLAY // ------------------------------------- // This structure is used in union with all the other PCDP descriptor types // so that the header fields may be accessed before knowing which descriptor // type is being examined, most importantly, to access the Type field in order // to determine the type. // typedef struct { OSL_PCDP_NEWTYPE_ENTRY_HEADER } OSL_PCDP_NEWTYPE_ENTRY_HEADER_OVERLAY; typedef struct { // PCDP UART descriptor UINT8 Type; // 0 = UART Desc, 1 = DEBUGPORT Desc UINT8 NumDataBits; UINT8 Parity; UINT8 StopBits; UINT8 PciSegNum; // If UART is a PCI device UINT8 PciBusNum; // If UART is a PCI device UINT8 PciDeviceNum; // If UART is a PCI device struct { unsigned PciFunctionNum : 3; unsigned Rsvd : 5; } PciFunctionFields; UINT64 Baud; UINT8 AddressSpaceID; // 38 UINT8 RegisterBitWidth; UINT8 RegisterBitOffset; UINT8 Fill1; UINT64 BaseAddress; // 3C UINT16 DeviceID; UINT16 VendorID; UINT32 GlobalSystemInterrupt; UINT32 PseudoClockRate; UINT8 PciClass; // Same as HCDP down to this point struct { unsigned InterruptMode : 1; unsigned InterruptPolarity : 1; unsigned Primary : 1; unsigned Rsvd : 3; unsigned InterruptFlag : 1; unsigned PciDeviceFlag : 1; } Flags; UINT16 ConDevIndex; UINT8 Rsvd[4]; } OSL_PCDP_TYPE_0_1_ENTRY; typedef struct { // PCDP fPars Virtual Console descriptor OSL_PCDP_NEWTYPE_ENTRY_HEADER UINT32 MinPollMsec; UINT32 SuggestedPollMsec; char ESITguid[16]; } OSL_PCDP_TYPE_130_ENTRY; // ---------------- // VGA_EXTADDR_DESC // ---------------- // X-49 TLC 20060804 VGA Console Support // // See "DIG64 Descriptions for Primary Console & Debug Port Devices" // Tables 2-4 and 2-5 // // The VGA Extended Address Space Descriptor in the PCDP_ENTRY for the VGA // device consists of 56 bytes as defined in the ACPI 3.0 Specification. // There can be any number of these in the PCDP_ENTRY for the VGA console // device, so we declare a data type as the first element in a possible // array of these data types in the PCDP_ENTRY for the VGA console device. // typedef struct { UINT8 VgaExtAddrDesc[56]; } VGA_EXTADDR_DESC; // ---------------------- // OSL_PCDP_TYPE_10_ENTRY // ---------------------- // X-49 TLC 20060804 VGA Console Support // // See "DIG64 Descriptions for Primary Console & Debug Port Devices" // Tables 2-4 and 2-5 // // The OSL_PCDP_TYPE_10_ENTRY data structure defined below will be used by // acpi$osl_console_config() when it discovers a VGA console entry in the PCDP. // This new structure will be included in the OSL_PCDP_ENTRY union defined // below in this file. // typedef struct { OSL_PCDP_NEWTYPE_ENTRY_HEADER INTERCONNECT Interconnect; UINT8 DescCount; // Num of descriptors } OSL_PCDP_TYPE_10_ENTRY; // VGA Entry Type typedef union { // Add any new device descriptors to this union OSL_PCDP_NEWTYPE_ENTRY_HEADER_OVERLAY DevX; OSL_PCDP_TYPE_0_1_ENTRY Dev0_1; OSL_PCDP_TYPE_130_ENTRY Dev130; OSL_PCDP_TYPE_10_ENTRY Dev10; } OSL_PCDP_ENTRY; // SPCR - Serial Port Configuration Register (Console when HCDP is not present) typedef struct // Watch for this structure to appear in later code drops { ACPI_TABLE_HEADER Header; UINT8 InterfaceType; UINT8 Reserved[3]; UINT8 AddressSpaceID; UINT8 RegisterBitWidth; UINT8 RegisterBitOffset; UINT8 Fill1; UINT64 BaseAddress; UINT8 InterruptType; UINT8 IRQ; UINT8 GlobalSystemInterrupt[4]; UINT8 BaudRate; UINT8 Parity; UINT8 StopBits; UINT8 FlowControl; UINT8 TerminalType; UINT8 Language; UINT16 PCIDeviceID; UINT16 PCIVendorID; UINT8 PCIBusNumber; UINT8 PCIDeviceNumber; UINT8 PCIFunctionNumber; UINT8 PCIFlags[4]; UINT8 PCISegment; UINT8 Reserved2[4]; } OSL_SPCR; #pragma __member_alignment __restore #endif // _ACPI_OSL_EXTENSION_STRUCTURES