acos2.h revision aa2aa9a662539940ddbc8610da5a3a874ebd7503
fa9e4066f08beec538e775443c5be79dd423fcabahrens/******************************************************************************
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Name: acos2.h - OS/2 specific defines, etc.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
441d80aa4f613b6298fc8bd3151f4be02dbf84fclling *****************************************************************************/
441d80aa4f613b6298fc8bd3151f4be02dbf84fclling
fa9e4066f08beec538e775443c5be79dd423fcabahrens/******************************************************************************
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 1. Copyright Notice
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 2. License
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 2.1. This is your license from Intel Corp. under its intellectual property
fa9e4066f08beec538e775443c5be79dd423fcabahrens * rights. You may have additional license terms from the party that provided
fa9e4066f08beec538e775443c5be79dd423fcabahrens * you this software, covering your right to use that party's intellectual
fa9e4066f08beec538e775443c5be79dd423fcabahrens * property rights.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
99653d4ee642c6528e88224f12409a5f23060994eschrock * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
fa9e4066f08beec538e775443c5be79dd423fcabahrens * copy of the source code appearing in this file ("Covered Code") an
98d1cbfec254295273b6a761bc1861c0374bdf02George Wilson * irrevocable, perpetual, worldwide license under Intel's copyrights in the
81cd5c555f505484180a62ca5a2fbb00d70c57d6Matthew Ahrens * base code distributed originally by Intel ("Original Intel Code") to copy,
1a902ef8628b0dffd6df5442354ab59bb8530962Hans Rosenfeld * make derivatives, distribute, use and display any portion of the Covered
c3d26abc9ee97b4f60233556aadeb57e0bd30bb9Matthew Ahrens * Code in any form, with the right to sublicense such rights; and
c8811bd3e2427dddbac6c05a59cfe117d8fea370Toomas Soome *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
fa9e4066f08beec538e775443c5be79dd423fcabahrens * license (with the right to sublicense), under only those claims of Intel
fa9e4066f08beec538e775443c5be79dd423fcabahrens * patents that are infringed by the Original Intel Code, to make, use, sell,
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * offer to sell, and import the Covered Code and derivative works thereof
fa9e4066f08beec538e775443c5be79dd423fcabahrens * solely to the minimum extent necessary to exercise the above copyright
fa9e4066f08beec538e775443c5be79dd423fcabahrens * license, and in no event shall the patent license extend to any additions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * to or modifications of the Original Intel Code. No other license or right
fa9e4066f08beec538e775443c5be79dd423fcabahrens * is granted directly or by implication, estoppel or otherwise;
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The above copyright and patent license is granted only if the following
fa9e4066f08beec538e775443c5be79dd423fcabahrens * conditions are met:
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 3. Conditions
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 3.1. Redistribution of Source with Rights to Further Distribute Source.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Redistribution of source code of any substantial portion of the Covered
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Code or modification with rights to further distribute source must include
c5904d138f3bdf0762dbf452a43d5a5c387ea6a8eschrock * the above Copyright Notice, the above License, this list of Conditions,
e6ca193ded880d478cc39e34ef82d4be36e4445dGeorge Wilson * and the following Disclaimer and Export Compliance provision. In addition,
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling * Licensee must cause all Covered Code to which Licensee contributes to
fa9e4066f08beec538e775443c5be79dd423fcabahrens * contain a file documenting the changes Licensee made to create that Covered
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Code and the date of any change. Licensee must include in that file the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * documentation of any changes made by any predecessor Licensee. Licensee
fa9e4066f08beec538e775443c5be79dd423fcabahrens * must include a prominent statement that the modification is derived,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * directly or indirectly, from Original Intel Code.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Redistribution of source code of any substantial portion of the Covered
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Code or modification without rights to further distribute source must
fa9e4066f08beec538e775443c5be79dd423fcabahrens * include the following Disclaimer and Export Compliance provision in the
99653d4ee642c6528e88224f12409a5f23060994eschrock * documentation and/or other materials provided with distribution. In
fa9e4066f08beec538e775443c5be79dd423fcabahrens * addition, Licensee may not authorize further sublicense of source of any
fa9e4066f08beec538e775443c5be79dd423fcabahrens * portion of the Covered Code, and must include terms to the effect that the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * license from Licensee to its licensee is limited to the intellectual
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson * property embodied in the software Licensee provides to its licensee, and
fa9e4066f08beec538e775443c5be79dd423fcabahrens * not to intellectual property embodied in modifications its licensee may
fa9e4066f08beec538e775443c5be79dd423fcabahrens * make.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
088f389458728c464569a5506b58070254fa4f7dahrens * 3.3. Redistribution of Executable. Redistribution in executable form of any
088f389458728c464569a5506b58070254fa4f7dahrens * substantial portion of the Covered Code or modification must reproduce the
05b2b3b80d84f3c379ea0df61a0f73fd87db2748mishra * above Copyright Notice, and the following Disclaimer and Export Compliance
bf3e216c7efa56332b456f4cf19d208e21d63839Matthew Ahrens * provision in the documentation and/or other materials provided with the
bf3e216c7efa56332b456f4cf19d208e21d63839Matthew Ahrens * distribution.
bf3e216c7efa56332b456f4cf19d208e21d63839Matthew Ahrens *
bf3e216c7efa56332b456f4cf19d208e21d63839Matthew Ahrens * 3.4. Intel retains all right, title, and interest in and to the Original
bf3e216c7efa56332b456f4cf19d208e21d63839Matthew Ahrens * Intel Code.
bf3e216c7efa56332b456f4cf19d208e21d63839Matthew Ahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 3.5. Neither the name Intel nor any other trademark owned or controlled by
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Intel shall be used in advertising or otherwise to promote the sale, use or
fa9e4066f08beec538e775443c5be79dd423fcabahrens * other dealings in products derived from or relating to the Covered Code
fa9e4066f08beec538e775443c5be79dd423fcabahrens * without prior written authorization from Intel.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 4. Disclaimer and Export Compliance
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
fa9e4066f08beec538e775443c5be79dd423fcabahrens * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
fa9e4066f08beec538e775443c5be79dd423fcabahrens * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
fa9e4066f08beec538e775443c5be79dd423fcabahrens * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
fa9e4066f08beec538e775443c5be79dd423fcabahrens * PARTICULAR PURPOSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
fa9e4066f08beec538e775443c5be79dd423fcabahrens * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
fa9e4066f08beec538e775443c5be79dd423fcabahrens * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
fa9e4066f08beec538e775443c5be79dd423fcabahrens * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
fa9e4066f08beec538e775443c5be79dd423fcabahrens * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick * LIMITED REMEDY.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 4.3. Licensee shall not export, either directly or indirectly, any of this
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * software or system incorporating such software without first obtaining any
fa9e4066f08beec538e775443c5be79dd423fcabahrens * required license or other approval from the U. S. Department of Commerce or
fa9e4066f08beec538e775443c5be79dd423fcabahrens * any other agency or department of the United States Government. In the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * event Licensee exports any such software from the United States or
fa9e4066f08beec538e775443c5be79dd423fcabahrens * re-exports any such software from a foreign destination, Licensee shall
fa9e4066f08beec538e775443c5be79dd423fcabahrens * ensure that the distribution and export/re-export of the software is in
fa9e4066f08beec538e775443c5be79dd423fcabahrens * compliance with all laws, regulations, orders, or other restrictions of the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * U.S. Export Administration Regulations. Licensee agrees that neither it nor
2a79c5fee1dab68e30266ba4356cf60b871aabcflling * any of its subsidiaries will export/re-export any technical data, process,
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * software, or service, directly or indirectly, to any country for which the
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * United States government or any agency thereof requires an export license,
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * other governmental approval, or letter of assurance, without first obtaining
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * such license, approval or letter.
2a79c5fee1dab68e30266ba4356cf60b871aabcflling *
2a79c5fee1dab68e30266ba4356cf60b871aabcflling *****************************************************************************/
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#ifndef __ACOS2_H__
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define __ACOS2_H__
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#define INCL_LONGLONG
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#include <os2.h>
4263d13f00c9691fa14620eff82abef795be0693George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_MACHINE_WIDTH 32
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define COMPILER_DEPENDENT_INT64 long long
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#define COMPILER_DEPENDENT_UINT64 unsigned long long
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#define ACPI_USE_NATIVE_DIVIDE
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_SYSTEM_XFACE APIENTRY
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#define ACPI_EXTERNAL_XFACE APIENTRY
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_INTERNAL_XFACE APIENTRY
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_INTERNAL_VAR_XFACE APIENTRY
2a79c5fee1dab68e30266ba4356cf60b871aabcflling
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson/*
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * Some compilers complain about unused variables. Sometimes we don't want to
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * use all the variables (most specifically for _THIS_MODULE). This allow us
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * to to tell the compiler warning in a per-variable manner that a variable
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson * is unused.
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson */
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#define ACPI_UNUSED_VAR
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_USE_STANDARD_HEADERS
2a79c5fee1dab68e30266ba4356cf60b871aabcflling#include <io.h>
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_FLUSH_CPU_CACHE() Wbinvd()
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilsonvoid Wbinvd(void);
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) Acq = OSPMAcquireGlobalLock(GLptr)
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilson#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pnd) Pnd = OSPMReleaseGlobalLock(GLptr)
573ca77e53dd31dcaebef023e7eb41969e6896c1George Wilsonunsigned short OSPMAcquireGlobalLock (void *);
2a79c5fee1dab68e30266ba4356cf60b871aabcfllingunsigned short OSPMReleaseGlobalLock (void *);
2a79c5fee1dab68e30266ba4356cf60b871aabcflling
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
fa9e4066f08beec538e775443c5be79dd423fcabahrens{ \
fa9e4066f08beec538e775443c5be79dd423fcabahrens unsigned long long val = 0LL; \
fa9e4066f08beec538e775443c5be79dd423fcabahrens val = n_lo | ( ((unsigned long long)h_hi) << 32 ); \
fa9e4066f08beec538e775443c5be79dd423fcabahrens __llrotr (val,1); \
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick n_hi = (unsigned long)((val >> 32 ) & 0xffffffff ); \
e05725b117836db173257fae43fb0746eb857fb5bonwick n_lo = (unsigned long)(val & 0xffffffff); \
088f389458728c464569a5506b58070254fa4f7dahrens}
088f389458728c464569a5506b58070254fa4f7dahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* IBM VAC does not have inline */
088f389458728c464569a5506b58070254fa4f7dahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#if __IBMC__ || __IBMCPP__
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define inline
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifndef ACPI_ASL_COMPILER
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define ACPI_USE_LOCAL_CACHE
fa9e4066f08beec538e775443c5be79dd423fcabahrens#undef ACPI_DEBUGGER
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0e34b6a7bff4918432f0aa6b1dfaf73ac9df45b1bonwick#endif /* __ACOS2_H__ */
fa9e4066f08beec538e775443c5be79dd423fcabahrens