xref: /onnv-gate/usr/src/uts/intel/sys/acpi/platform/acos2.h (revision 9980:13d7f3eec672)
17851SDana.Myers@Sun.COM /******************************************************************************
27851SDana.Myers@Sun.COM  *
37851SDana.Myers@Sun.COM  * Name: acos2.h - OS/2 specific defines, etc.
47851SDana.Myers@Sun.COM  *
57851SDana.Myers@Sun.COM  *****************************************************************************/
67851SDana.Myers@Sun.COM 
77851SDana.Myers@Sun.COM /******************************************************************************
87851SDana.Myers@Sun.COM  *
97851SDana.Myers@Sun.COM  * 1. Copyright Notice
107851SDana.Myers@Sun.COM  *
11*9980SDana.Myers@Sun.COM  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
127851SDana.Myers@Sun.COM  * All rights reserved.
137851SDana.Myers@Sun.COM  *
147851SDana.Myers@Sun.COM  * 2. License
157851SDana.Myers@Sun.COM  *
167851SDana.Myers@Sun.COM  * 2.1. This is your license from Intel Corp. under its intellectual property
177851SDana.Myers@Sun.COM  * rights.  You may have additional license terms from the party that provided
187851SDana.Myers@Sun.COM  * you this software, covering your right to use that party's intellectual
197851SDana.Myers@Sun.COM  * property rights.
207851SDana.Myers@Sun.COM  *
217851SDana.Myers@Sun.COM  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
227851SDana.Myers@Sun.COM  * copy of the source code appearing in this file ("Covered Code") an
237851SDana.Myers@Sun.COM  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
247851SDana.Myers@Sun.COM  * base code distributed originally by Intel ("Original Intel Code") to copy,
257851SDana.Myers@Sun.COM  * make derivatives, distribute, use and display any portion of the Covered
267851SDana.Myers@Sun.COM  * Code in any form, with the right to sublicense such rights; and
277851SDana.Myers@Sun.COM  *
287851SDana.Myers@Sun.COM  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
297851SDana.Myers@Sun.COM  * license (with the right to sublicense), under only those claims of Intel
307851SDana.Myers@Sun.COM  * patents that are infringed by the Original Intel Code, to make, use, sell,
317851SDana.Myers@Sun.COM  * offer to sell, and import the Covered Code and derivative works thereof
327851SDana.Myers@Sun.COM  * solely to the minimum extent necessary to exercise the above copyright
337851SDana.Myers@Sun.COM  * license, and in no event shall the patent license extend to any additions
347851SDana.Myers@Sun.COM  * to or modifications of the Original Intel Code.  No other license or right
357851SDana.Myers@Sun.COM  * is granted directly or by implication, estoppel or otherwise;
367851SDana.Myers@Sun.COM  *
377851SDana.Myers@Sun.COM  * The above copyright and patent license is granted only if the following
387851SDana.Myers@Sun.COM  * conditions are met:
397851SDana.Myers@Sun.COM  *
407851SDana.Myers@Sun.COM  * 3. Conditions
417851SDana.Myers@Sun.COM  *
427851SDana.Myers@Sun.COM  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
437851SDana.Myers@Sun.COM  * Redistribution of source code of any substantial portion of the Covered
447851SDana.Myers@Sun.COM  * Code or modification with rights to further distribute source must include
457851SDana.Myers@Sun.COM  * the above Copyright Notice, the above License, this list of Conditions,
467851SDana.Myers@Sun.COM  * and the following Disclaimer and Export Compliance provision.  In addition,
477851SDana.Myers@Sun.COM  * Licensee must cause all Covered Code to which Licensee contributes to
487851SDana.Myers@Sun.COM  * contain a file documenting the changes Licensee made to create that Covered
497851SDana.Myers@Sun.COM  * Code and the date of any change.  Licensee must include in that file the
507851SDana.Myers@Sun.COM  * documentation of any changes made by any predecessor Licensee.  Licensee
517851SDana.Myers@Sun.COM  * must include a prominent statement that the modification is derived,
527851SDana.Myers@Sun.COM  * directly or indirectly, from Original Intel Code.
537851SDana.Myers@Sun.COM  *
547851SDana.Myers@Sun.COM  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
557851SDana.Myers@Sun.COM  * Redistribution of source code of any substantial portion of the Covered
567851SDana.Myers@Sun.COM  * Code or modification without rights to further distribute source must
577851SDana.Myers@Sun.COM  * include the following Disclaimer and Export Compliance provision in the
587851SDana.Myers@Sun.COM  * documentation and/or other materials provided with distribution.  In
597851SDana.Myers@Sun.COM  * addition, Licensee may not authorize further sublicense of source of any
607851SDana.Myers@Sun.COM  * portion of the Covered Code, and must include terms to the effect that the
617851SDana.Myers@Sun.COM  * license from Licensee to its licensee is limited to the intellectual
627851SDana.Myers@Sun.COM  * property embodied in the software Licensee provides to its licensee, and
637851SDana.Myers@Sun.COM  * not to intellectual property embodied in modifications its licensee may
647851SDana.Myers@Sun.COM  * make.
657851SDana.Myers@Sun.COM  *
667851SDana.Myers@Sun.COM  * 3.3. Redistribution of Executable. Redistribution in executable form of any
677851SDana.Myers@Sun.COM  * substantial portion of the Covered Code or modification must reproduce the
687851SDana.Myers@Sun.COM  * above Copyright Notice, and the following Disclaimer and Export Compliance
697851SDana.Myers@Sun.COM  * provision in the documentation and/or other materials provided with the
707851SDana.Myers@Sun.COM  * distribution.
717851SDana.Myers@Sun.COM  *
727851SDana.Myers@Sun.COM  * 3.4. Intel retains all right, title, and interest in and to the Original
737851SDana.Myers@Sun.COM  * Intel Code.
747851SDana.Myers@Sun.COM  *
757851SDana.Myers@Sun.COM  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
767851SDana.Myers@Sun.COM  * Intel shall be used in advertising or otherwise to promote the sale, use or
777851SDana.Myers@Sun.COM  * other dealings in products derived from or relating to the Covered Code
787851SDana.Myers@Sun.COM  * without prior written authorization from Intel.
797851SDana.Myers@Sun.COM  *
807851SDana.Myers@Sun.COM  * 4. Disclaimer and Export Compliance
817851SDana.Myers@Sun.COM  *
827851SDana.Myers@Sun.COM  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
837851SDana.Myers@Sun.COM  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
847851SDana.Myers@Sun.COM  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
857851SDana.Myers@Sun.COM  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
867851SDana.Myers@Sun.COM  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
877851SDana.Myers@Sun.COM  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
887851SDana.Myers@Sun.COM  * PARTICULAR PURPOSE.
897851SDana.Myers@Sun.COM  *
907851SDana.Myers@Sun.COM  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
917851SDana.Myers@Sun.COM  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
927851SDana.Myers@Sun.COM  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
937851SDana.Myers@Sun.COM  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
947851SDana.Myers@Sun.COM  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
957851SDana.Myers@Sun.COM  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
967851SDana.Myers@Sun.COM  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
977851SDana.Myers@Sun.COM  * LIMITED REMEDY.
987851SDana.Myers@Sun.COM  *
997851SDana.Myers@Sun.COM  * 4.3. Licensee shall not export, either directly or indirectly, any of this
1007851SDana.Myers@Sun.COM  * software or system incorporating such software without first obtaining any
1017851SDana.Myers@Sun.COM  * required license or other approval from the U. S. Department of Commerce or
1027851SDana.Myers@Sun.COM  * any other agency or department of the United States Government.  In the
1037851SDana.Myers@Sun.COM  * event Licensee exports any such software from the United States or
1047851SDana.Myers@Sun.COM  * re-exports any such software from a foreign destination, Licensee shall
1057851SDana.Myers@Sun.COM  * ensure that the distribution and export/re-export of the software is in
1067851SDana.Myers@Sun.COM  * compliance with all laws, regulations, orders, or other restrictions of the
1077851SDana.Myers@Sun.COM  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1087851SDana.Myers@Sun.COM  * any of its subsidiaries will export/re-export any technical data, process,
1097851SDana.Myers@Sun.COM  * software, or service, directly or indirectly, to any country for which the
1107851SDana.Myers@Sun.COM  * United States government or any agency thereof requires an export license,
1117851SDana.Myers@Sun.COM  * other governmental approval, or letter of assurance, without first obtaining
1127851SDana.Myers@Sun.COM  * such license, approval or letter.
1137851SDana.Myers@Sun.COM  *
1147851SDana.Myers@Sun.COM  *****************************************************************************/
1157851SDana.Myers@Sun.COM 
1167851SDana.Myers@Sun.COM #ifndef __ACOS2_H__
1177851SDana.Myers@Sun.COM #define __ACOS2_H__
1187851SDana.Myers@Sun.COM #define INCL_LONGLONG
1197851SDana.Myers@Sun.COM #include <os2.h>
1207851SDana.Myers@Sun.COM 
1217851SDana.Myers@Sun.COM 
1227851SDana.Myers@Sun.COM #define ACPI_MACHINE_WIDTH          32
1237851SDana.Myers@Sun.COM 
1247851SDana.Myers@Sun.COM #define COMPILER_DEPENDENT_INT64    long long
1257851SDana.Myers@Sun.COM #define COMPILER_DEPENDENT_UINT64   unsigned long long
1267851SDana.Myers@Sun.COM #define ACPI_USE_NATIVE_DIVIDE
1277851SDana.Myers@Sun.COM 
1287851SDana.Myers@Sun.COM #define ACPI_SYSTEM_XFACE           APIENTRY
1297851SDana.Myers@Sun.COM #define ACPI_EXTERNAL_XFACE         APIENTRY
1307851SDana.Myers@Sun.COM #define ACPI_INTERNAL_XFACE         APIENTRY
1317851SDana.Myers@Sun.COM #define ACPI_INTERNAL_VAR_XFACE     APIENTRY
1327851SDana.Myers@Sun.COM 
1337851SDana.Myers@Sun.COM /*
1347851SDana.Myers@Sun.COM  * Some compilers complain about unused variables. Sometimes we don't want to
1357851SDana.Myers@Sun.COM  * use all the variables (most specifically for _THIS_MODULE). This allow us
1367851SDana.Myers@Sun.COM  * to to tell the compiler warning in a per-variable manner that a variable
1377851SDana.Myers@Sun.COM  * is unused.
1387851SDana.Myers@Sun.COM  */
1397851SDana.Myers@Sun.COM #define ACPI_UNUSED_VAR
1407851SDana.Myers@Sun.COM 
1417851SDana.Myers@Sun.COM #define ACPI_USE_STANDARD_HEADERS
1427851SDana.Myers@Sun.COM #include <io.h>
1437851SDana.Myers@Sun.COM 
1447851SDana.Myers@Sun.COM #define ACPI_FLUSH_CPU_CACHE() Wbinvd()
1457851SDana.Myers@Sun.COM void Wbinvd(void);
1467851SDana.Myers@Sun.COM 
1477851SDana.Myers@Sun.COM #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)       Acq = OSPMAcquireGlobalLock(GLptr)
1487851SDana.Myers@Sun.COM #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pnd)       Pnd = OSPMReleaseGlobalLock(GLptr)
1497851SDana.Myers@Sun.COM unsigned short OSPMAcquireGlobalLock (void *);
1507851SDana.Myers@Sun.COM unsigned short OSPMReleaseGlobalLock (void *);
1517851SDana.Myers@Sun.COM 
1527851SDana.Myers@Sun.COM #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
1537851SDana.Myers@Sun.COM { \
1547851SDana.Myers@Sun.COM     unsigned long long val = 0LL; \
1557851SDana.Myers@Sun.COM     val = n_lo | ( ((unsigned long long)h_hi) << 32 ); \
1567851SDana.Myers@Sun.COM     __llrotr (val,1); \
1577851SDana.Myers@Sun.COM     n_hi = (unsigned long)((val >> 32 ) & 0xffffffff ); \
1587851SDana.Myers@Sun.COM     n_lo = (unsigned long)(val & 0xffffffff); \
1597851SDana.Myers@Sun.COM }
1607851SDana.Myers@Sun.COM 
1617851SDana.Myers@Sun.COM /* IBM VAC does not have inline */
1627851SDana.Myers@Sun.COM 
1637851SDana.Myers@Sun.COM #if __IBMC__ || __IBMCPP__
1647851SDana.Myers@Sun.COM #define inline
1657851SDana.Myers@Sun.COM #endif
1667851SDana.Myers@Sun.COM 
1677851SDana.Myers@Sun.COM #ifndef ACPI_ASL_COMPILER
1687851SDana.Myers@Sun.COM #define ACPI_USE_LOCAL_CACHE
1697851SDana.Myers@Sun.COM #undef ACPI_DEBUGGER
1707851SDana.Myers@Sun.COM #endif
1717851SDana.Myers@Sun.COM 
1727851SDana.Myers@Sun.COM #endif /* __ACOS2_H__ */
173