xref: /minix3/minix/drivers/power/acpi/include/platform/acos2.h (revision 29492bb71c7148a089a5afafa0c99409161218df)
1433d6423SLionel Sambuc /******************************************************************************
2433d6423SLionel Sambuc  *
3433d6423SLionel Sambuc  * Name: acos2.h - OS/2 specific defines, etc.
4433d6423SLionel Sambuc  *
5433d6423SLionel Sambuc  *****************************************************************************/
6433d6423SLionel Sambuc 
7*29492bb7SDavid van Moolenbroek /*
8*29492bb7SDavid van Moolenbroek  * Copyright (C) 2000 - 2014, Intel Corp.
9433d6423SLionel Sambuc  * All rights reserved.
10433d6423SLionel Sambuc  *
11*29492bb7SDavid van Moolenbroek  * Redistribution and use in source and binary forms, with or without
12*29492bb7SDavid van Moolenbroek  * modification, are permitted provided that the following conditions
13*29492bb7SDavid van Moolenbroek  * are met:
14*29492bb7SDavid van Moolenbroek  * 1. Redistributions of source code must retain the above copyright
15*29492bb7SDavid van Moolenbroek  *    notice, this list of conditions, and the following disclaimer,
16*29492bb7SDavid van Moolenbroek  *    without modification.
17*29492bb7SDavid van Moolenbroek  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*29492bb7SDavid van Moolenbroek  *    substantially similar to the "NO WARRANTY" disclaimer below
19*29492bb7SDavid van Moolenbroek  *    ("Disclaimer") and any redistribution must be conditioned upon
20*29492bb7SDavid van Moolenbroek  *    including a substantially similar Disclaimer requirement for further
21*29492bb7SDavid van Moolenbroek  *    binary redistribution.
22*29492bb7SDavid van Moolenbroek  * 3. Neither the names of the above-listed copyright holders nor the names
23*29492bb7SDavid van Moolenbroek  *    of any contributors may be used to endorse or promote products derived
24*29492bb7SDavid van Moolenbroek  *    from this software without specific prior written permission.
25433d6423SLionel Sambuc  *
26*29492bb7SDavid van Moolenbroek  * Alternatively, this software may be distributed under the terms of the
27*29492bb7SDavid van Moolenbroek  * GNU General Public License ("GPL") version 2 as published by the Free
28*29492bb7SDavid van Moolenbroek  * Software Foundation.
29433d6423SLionel Sambuc  *
30*29492bb7SDavid van Moolenbroek  * NO WARRANTY
31*29492bb7SDavid van Moolenbroek  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*29492bb7SDavid van Moolenbroek  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*29492bb7SDavid van Moolenbroek  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*29492bb7SDavid van Moolenbroek  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*29492bb7SDavid van Moolenbroek  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*29492bb7SDavid van Moolenbroek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*29492bb7SDavid van Moolenbroek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*29492bb7SDavid van Moolenbroek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*29492bb7SDavid van Moolenbroek  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*29492bb7SDavid van Moolenbroek  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*29492bb7SDavid van Moolenbroek  * POSSIBILITY OF SUCH DAMAGES.
42*29492bb7SDavid van Moolenbroek  */
43433d6423SLionel Sambuc 
44433d6423SLionel Sambuc #ifndef __ACOS2_H__
45433d6423SLionel Sambuc #define __ACOS2_H__
46433d6423SLionel Sambuc #define INCL_LONGLONG
47433d6423SLionel Sambuc #include <os2.h>
48433d6423SLionel Sambuc 
49433d6423SLionel Sambuc 
50433d6423SLionel Sambuc #define ACPI_MACHINE_WIDTH          32
51433d6423SLionel Sambuc 
52433d6423SLionel Sambuc #define COMPILER_DEPENDENT_INT64    long long
53433d6423SLionel Sambuc #define COMPILER_DEPENDENT_UINT64   unsigned long long
54433d6423SLionel Sambuc #define ACPI_USE_NATIVE_DIVIDE
55433d6423SLionel Sambuc 
56433d6423SLionel Sambuc #define ACPI_SYSTEM_XFACE           APIENTRY
57433d6423SLionel Sambuc #define ACPI_EXTERNAL_XFACE         APIENTRY
58433d6423SLionel Sambuc #define ACPI_INTERNAL_XFACE         APIENTRY
59433d6423SLionel Sambuc #define ACPI_INTERNAL_VAR_XFACE     APIENTRY
60433d6423SLionel Sambuc 
61433d6423SLionel Sambuc /*
62433d6423SLionel Sambuc  * Some compilers complain about unused variables. Sometimes we don't want to
63433d6423SLionel Sambuc  * use all the variables (most specifically for _THIS_MODULE). This allow us
64433d6423SLionel Sambuc  * to to tell the compiler warning in a per-variable manner that a variable
65433d6423SLionel Sambuc  * is unused.
66433d6423SLionel Sambuc  */
67433d6423SLionel Sambuc #define ACPI_UNUSED_VAR
68433d6423SLionel Sambuc 
69433d6423SLionel Sambuc #define ACPI_USE_STANDARD_HEADERS
70433d6423SLionel Sambuc #include <io.h>
71433d6423SLionel Sambuc 
72433d6423SLionel Sambuc #define ACPI_FLUSH_CPU_CACHE() Wbinvd()
73433d6423SLionel Sambuc void Wbinvd(void);
74433d6423SLionel Sambuc 
75433d6423SLionel Sambuc #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)       Acq = OSPMAcquireGlobalLock(GLptr)
76433d6423SLionel Sambuc #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pnd)       Pnd = OSPMReleaseGlobalLock(GLptr)
77433d6423SLionel Sambuc unsigned short OSPMAcquireGlobalLock (void *);
78433d6423SLionel Sambuc unsigned short OSPMReleaseGlobalLock (void *);
79433d6423SLionel Sambuc 
80433d6423SLionel Sambuc #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
81433d6423SLionel Sambuc { \
82433d6423SLionel Sambuc     unsigned long long val = 0LL; \
83433d6423SLionel Sambuc     val = n_lo | ( ((unsigned long long)h_hi) << 32 ); \
84433d6423SLionel Sambuc     __llrotr (val,1); \
85433d6423SLionel Sambuc     n_hi = (unsigned long)((val >> 32 ) & 0xffffffff ); \
86433d6423SLionel Sambuc     n_lo = (unsigned long)(val & 0xffffffff); \
87433d6423SLionel Sambuc }
88433d6423SLionel Sambuc 
89433d6423SLionel Sambuc #ifndef ACPI_ASL_COMPILER
90433d6423SLionel Sambuc #define ACPI_USE_LOCAL_CACHE
91433d6423SLionel Sambuc #undef ACPI_DEBUGGER
92433d6423SLionel Sambuc #endif
93433d6423SLionel Sambuc 
94433d6423SLionel Sambuc #endif /* __ACOS2_H__ */
95