xref: /onnv-gate/usr/src/uts/intel/sys/acpi/platform/accygwin.h (revision 9980:13d7f3eec672)
1*9980SDana.Myers@Sun.COM /******************************************************************************
2*9980SDana.Myers@Sun.COM  *
3*9980SDana.Myers@Sun.COM  * Name: accygwin.h - OS specific defines, etc. for cygwin environment
4*9980SDana.Myers@Sun.COM  *
5*9980SDana.Myers@Sun.COM  *****************************************************************************/
6*9980SDana.Myers@Sun.COM 
7*9980SDana.Myers@Sun.COM /******************************************************************************
8*9980SDana.Myers@Sun.COM  *
9*9980SDana.Myers@Sun.COM  * 1. Copyright Notice
10*9980SDana.Myers@Sun.COM  *
11*9980SDana.Myers@Sun.COM  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
12*9980SDana.Myers@Sun.COM  * All rights reserved.
13*9980SDana.Myers@Sun.COM  *
14*9980SDana.Myers@Sun.COM  * 2. License
15*9980SDana.Myers@Sun.COM  *
16*9980SDana.Myers@Sun.COM  * 2.1. This is your license from Intel Corp. under its intellectual property
17*9980SDana.Myers@Sun.COM  * rights.  You may have additional license terms from the party that provided
18*9980SDana.Myers@Sun.COM  * you this software, covering your right to use that party's intellectual
19*9980SDana.Myers@Sun.COM  * property rights.
20*9980SDana.Myers@Sun.COM  *
21*9980SDana.Myers@Sun.COM  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22*9980SDana.Myers@Sun.COM  * copy of the source code appearing in this file ("Covered Code") an
23*9980SDana.Myers@Sun.COM  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24*9980SDana.Myers@Sun.COM  * base code distributed originally by Intel ("Original Intel Code") to copy,
25*9980SDana.Myers@Sun.COM  * make derivatives, distribute, use and display any portion of the Covered
26*9980SDana.Myers@Sun.COM  * Code in any form, with the right to sublicense such rights; and
27*9980SDana.Myers@Sun.COM  *
28*9980SDana.Myers@Sun.COM  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29*9980SDana.Myers@Sun.COM  * license (with the right to sublicense), under only those claims of Intel
30*9980SDana.Myers@Sun.COM  * patents that are infringed by the Original Intel Code, to make, use, sell,
31*9980SDana.Myers@Sun.COM  * offer to sell, and import the Covered Code and derivative works thereof
32*9980SDana.Myers@Sun.COM  * solely to the minimum extent necessary to exercise the above copyright
33*9980SDana.Myers@Sun.COM  * license, and in no event shall the patent license extend to any additions
34*9980SDana.Myers@Sun.COM  * to or modifications of the Original Intel Code.  No other license or right
35*9980SDana.Myers@Sun.COM  * is granted directly or by implication, estoppel or otherwise;
36*9980SDana.Myers@Sun.COM  *
37*9980SDana.Myers@Sun.COM  * The above copyright and patent license is granted only if the following
38*9980SDana.Myers@Sun.COM  * conditions are met:
39*9980SDana.Myers@Sun.COM  *
40*9980SDana.Myers@Sun.COM  * 3. Conditions
41*9980SDana.Myers@Sun.COM  *
42*9980SDana.Myers@Sun.COM  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43*9980SDana.Myers@Sun.COM  * Redistribution of source code of any substantial portion of the Covered
44*9980SDana.Myers@Sun.COM  * Code or modification with rights to further distribute source must include
45*9980SDana.Myers@Sun.COM  * the above Copyright Notice, the above License, this list of Conditions,
46*9980SDana.Myers@Sun.COM  * and the following Disclaimer and Export Compliance provision.  In addition,
47*9980SDana.Myers@Sun.COM  * Licensee must cause all Covered Code to which Licensee contributes to
48*9980SDana.Myers@Sun.COM  * contain a file documenting the changes Licensee made to create that Covered
49*9980SDana.Myers@Sun.COM  * Code and the date of any change.  Licensee must include in that file the
50*9980SDana.Myers@Sun.COM  * documentation of any changes made by any predecessor Licensee.  Licensee
51*9980SDana.Myers@Sun.COM  * must include a prominent statement that the modification is derived,
52*9980SDana.Myers@Sun.COM  * directly or indirectly, from Original Intel Code.
53*9980SDana.Myers@Sun.COM  *
54*9980SDana.Myers@Sun.COM  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55*9980SDana.Myers@Sun.COM  * Redistribution of source code of any substantial portion of the Covered
56*9980SDana.Myers@Sun.COM  * Code or modification without rights to further distribute source must
57*9980SDana.Myers@Sun.COM  * include the following Disclaimer and Export Compliance provision in the
58*9980SDana.Myers@Sun.COM  * documentation and/or other materials provided with distribution.  In
59*9980SDana.Myers@Sun.COM  * addition, Licensee may not authorize further sublicense of source of any
60*9980SDana.Myers@Sun.COM  * portion of the Covered Code, and must include terms to the effect that the
61*9980SDana.Myers@Sun.COM  * license from Licensee to its licensee is limited to the intellectual
62*9980SDana.Myers@Sun.COM  * property embodied in the software Licensee provides to its licensee, and
63*9980SDana.Myers@Sun.COM  * not to intellectual property embodied in modifications its licensee may
64*9980SDana.Myers@Sun.COM  * make.
65*9980SDana.Myers@Sun.COM  *
66*9980SDana.Myers@Sun.COM  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67*9980SDana.Myers@Sun.COM  * substantial portion of the Covered Code or modification must reproduce the
68*9980SDana.Myers@Sun.COM  * above Copyright Notice, and the following Disclaimer and Export Compliance
69*9980SDana.Myers@Sun.COM  * provision in the documentation and/or other materials provided with the
70*9980SDana.Myers@Sun.COM  * distribution.
71*9980SDana.Myers@Sun.COM  *
72*9980SDana.Myers@Sun.COM  * 3.4. Intel retains all right, title, and interest in and to the Original
73*9980SDana.Myers@Sun.COM  * Intel Code.
74*9980SDana.Myers@Sun.COM  *
75*9980SDana.Myers@Sun.COM  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76*9980SDana.Myers@Sun.COM  * Intel shall be used in advertising or otherwise to promote the sale, use or
77*9980SDana.Myers@Sun.COM  * other dealings in products derived from or relating to the Covered Code
78*9980SDana.Myers@Sun.COM  * without prior written authorization from Intel.
79*9980SDana.Myers@Sun.COM  *
80*9980SDana.Myers@Sun.COM  * 4. Disclaimer and Export Compliance
81*9980SDana.Myers@Sun.COM  *
82*9980SDana.Myers@Sun.COM  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83*9980SDana.Myers@Sun.COM  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84*9980SDana.Myers@Sun.COM  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
85*9980SDana.Myers@Sun.COM  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
86*9980SDana.Myers@Sun.COM  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
87*9980SDana.Myers@Sun.COM  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88*9980SDana.Myers@Sun.COM  * PARTICULAR PURPOSE.
89*9980SDana.Myers@Sun.COM  *
90*9980SDana.Myers@Sun.COM  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91*9980SDana.Myers@Sun.COM  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92*9980SDana.Myers@Sun.COM  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93*9980SDana.Myers@Sun.COM  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94*9980SDana.Myers@Sun.COM  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95*9980SDana.Myers@Sun.COM  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
96*9980SDana.Myers@Sun.COM  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97*9980SDana.Myers@Sun.COM  * LIMITED REMEDY.
98*9980SDana.Myers@Sun.COM  *
99*9980SDana.Myers@Sun.COM  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100*9980SDana.Myers@Sun.COM  * software or system incorporating such software without first obtaining any
101*9980SDana.Myers@Sun.COM  * required license or other approval from the U. S. Department of Commerce or
102*9980SDana.Myers@Sun.COM  * any other agency or department of the United States Government.  In the
103*9980SDana.Myers@Sun.COM  * event Licensee exports any such software from the United States or
104*9980SDana.Myers@Sun.COM  * re-exports any such software from a foreign destination, Licensee shall
105*9980SDana.Myers@Sun.COM  * ensure that the distribution and export/re-export of the software is in
106*9980SDana.Myers@Sun.COM  * compliance with all laws, regulations, orders, or other restrictions of the
107*9980SDana.Myers@Sun.COM  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108*9980SDana.Myers@Sun.COM  * any of its subsidiaries will export/re-export any technical data, process,
109*9980SDana.Myers@Sun.COM  * software, or service, directly or indirectly, to any country for which the
110*9980SDana.Myers@Sun.COM  * United States government or any agency thereof requires an export license,
111*9980SDana.Myers@Sun.COM  * other governmental approval, or letter of assurance, without first obtaining
112*9980SDana.Myers@Sun.COM  * such license, approval or letter.
113*9980SDana.Myers@Sun.COM  *
114*9980SDana.Myers@Sun.COM  *****************************************************************************/
115*9980SDana.Myers@Sun.COM 
116*9980SDana.Myers@Sun.COM #ifndef __ACCYGWIN_H__
117*9980SDana.Myers@Sun.COM #define __ACCYGWIN_H__
118*9980SDana.Myers@Sun.COM 
119*9980SDana.Myers@Sun.COM /*
120*9980SDana.Myers@Sun.COM  * ACPICA configuration
121*9980SDana.Myers@Sun.COM  */
122*9980SDana.Myers@Sun.COM #define ACPI_USE_SYSTEM_CLIBRARY
123*9980SDana.Myers@Sun.COM #define ACPI_USE_DO_WHILE_0
124*9980SDana.Myers@Sun.COM #define ACPI_THREAD_ID              pthread_t
125*9980SDana.Myers@Sun.COM #define ACPI_FLUSH_CPU_CACHE()
126*9980SDana.Myers@Sun.COM /*
127*9980SDana.Myers@Sun.COM  * This is needed since sem_timedwait does not appear to work properly
128*9980SDana.Myers@Sun.COM  * on cygwin (always hangs forever).
129*9980SDana.Myers@Sun.COM  */
130*9980SDana.Myers@Sun.COM #define ACPI_USE_ALTERNATE_TIMEOUT
131*9980SDana.Myers@Sun.COM 
132*9980SDana.Myers@Sun.COM 
133*9980SDana.Myers@Sun.COM #include <stdarg.h>
134*9980SDana.Myers@Sun.COM #include <string.h>
135*9980SDana.Myers@Sun.COM #include <stdlib.h>
136*9980SDana.Myers@Sun.COM #include <ctype.h>
137*9980SDana.Myers@Sun.COM #include <unistd.h>
138*9980SDana.Myers@Sun.COM 
139*9980SDana.Myers@Sun.COM #if defined(__ia64__) || defined(__x86_64__)
140*9980SDana.Myers@Sun.COM #define ACPI_MACHINE_WIDTH          64
141*9980SDana.Myers@Sun.COM #define COMPILER_DEPENDENT_INT64    long
142*9980SDana.Myers@Sun.COM #define COMPILER_DEPENDENT_UINT64   unsigned long
143*9980SDana.Myers@Sun.COM #else
144*9980SDana.Myers@Sun.COM #define ACPI_MACHINE_WIDTH          32
145*9980SDana.Myers@Sun.COM #define COMPILER_DEPENDENT_INT64    long long
146*9980SDana.Myers@Sun.COM #define COMPILER_DEPENDENT_UINT64   unsigned long long
147*9980SDana.Myers@Sun.COM #define ACPI_USE_NATIVE_DIVIDE
148*9980SDana.Myers@Sun.COM #endif
149*9980SDana.Myers@Sun.COM 
150*9980SDana.Myers@Sun.COM #ifndef __cdecl
151*9980SDana.Myers@Sun.COM #define __cdecl
152*9980SDana.Myers@Sun.COM #endif
153*9980SDana.Myers@Sun.COM 
154*9980SDana.Myers@Sun.COM #ifdef _ANSI
155*9980SDana.Myers@Sun.COM #define inline
156*9980SDana.Myers@Sun.COM #endif
157*9980SDana.Myers@Sun.COM 
158*9980SDana.Myers@Sun.COM 
159*9980SDana.Myers@Sun.COM /* Cygwin uses GCC */
160*9980SDana.Myers@Sun.COM 
161*9980SDana.Myers@Sun.COM #include "acgcc.h"
162*9980SDana.Myers@Sun.COM 
163*9980SDana.Myers@Sun.COM #endif /* __ACCYGWIN_H__ */
164