xref: /freebsd-src/sys/contrib/dev/acpica/include/platform/acenv.h (revision 92f570c32e9b9b9b4db9b6921c4ab79be686a498)
1a9f12690SJung-uk Kim /******************************************************************************
2a9f12690SJung-uk Kim  *
3a9f12690SJung-uk Kim  * Name: acenv.h - Host and compiler configuration
4a9f12690SJung-uk Kim  *
5a9f12690SJung-uk Kim  *****************************************************************************/
6a9f12690SJung-uk Kim 
70d84335fSJung-uk Kim /******************************************************************************
80d84335fSJung-uk Kim  *
90d84335fSJung-uk Kim  * 1. Copyright Notice
100d84335fSJung-uk Kim  *
11804fe266SJung-uk Kim  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
12a9f12690SJung-uk Kim  * All rights reserved.
13a9f12690SJung-uk Kim  *
140d84335fSJung-uk Kim  * 2. License
150d84335fSJung-uk Kim  *
160d84335fSJung-uk Kim  * 2.1. This is your license from Intel Corp. under its intellectual property
170d84335fSJung-uk Kim  * rights. You may have additional license terms from the party that provided
180d84335fSJung-uk Kim  * you this software, covering your right to use that party's intellectual
190d84335fSJung-uk Kim  * property rights.
200d84335fSJung-uk Kim  *
210d84335fSJung-uk Kim  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
220d84335fSJung-uk Kim  * copy of the source code appearing in this file ("Covered Code") an
230d84335fSJung-uk Kim  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
240d84335fSJung-uk Kim  * base code distributed originally by Intel ("Original Intel Code") to copy,
250d84335fSJung-uk Kim  * make derivatives, distribute, use and display any portion of the Covered
260d84335fSJung-uk Kim  * Code in any form, with the right to sublicense such rights; and
270d84335fSJung-uk Kim  *
280d84335fSJung-uk Kim  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
290d84335fSJung-uk Kim  * license (with the right to sublicense), under only those claims of Intel
300d84335fSJung-uk Kim  * patents that are infringed by the Original Intel Code, to make, use, sell,
310d84335fSJung-uk Kim  * offer to sell, and import the Covered Code and derivative works thereof
320d84335fSJung-uk Kim  * solely to the minimum extent necessary to exercise the above copyright
330d84335fSJung-uk Kim  * license, and in no event shall the patent license extend to any additions
340d84335fSJung-uk Kim  * to or modifications of the Original Intel Code. No other license or right
350d84335fSJung-uk Kim  * is granted directly or by implication, estoppel or otherwise;
360d84335fSJung-uk Kim  *
370d84335fSJung-uk Kim  * The above copyright and patent license is granted only if the following
380d84335fSJung-uk Kim  * conditions are met:
390d84335fSJung-uk Kim  *
400d84335fSJung-uk Kim  * 3. Conditions
410d84335fSJung-uk Kim  *
420d84335fSJung-uk Kim  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
430d84335fSJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
440d84335fSJung-uk Kim  * Code or modification with rights to further distribute source must include
450d84335fSJung-uk Kim  * the above Copyright Notice, the above License, this list of Conditions,
460d84335fSJung-uk Kim  * and the following Disclaimer and Export Compliance provision. In addition,
470d84335fSJung-uk Kim  * Licensee must cause all Covered Code to which Licensee contributes to
480d84335fSJung-uk Kim  * contain a file documenting the changes Licensee made to create that Covered
490d84335fSJung-uk Kim  * Code and the date of any change. Licensee must include in that file the
500d84335fSJung-uk Kim  * documentation of any changes made by any predecessor Licensee. Licensee
510d84335fSJung-uk Kim  * must include a prominent statement that the modification is derived,
520d84335fSJung-uk Kim  * directly or indirectly, from Original Intel Code.
530d84335fSJung-uk Kim  *
540d84335fSJung-uk Kim  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
550d84335fSJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
560d84335fSJung-uk Kim  * Code or modification without rights to further distribute source must
570d84335fSJung-uk Kim  * include the following Disclaimer and Export Compliance provision in the
580d84335fSJung-uk Kim  * documentation and/or other materials provided with distribution. In
590d84335fSJung-uk Kim  * addition, Licensee may not authorize further sublicense of source of any
600d84335fSJung-uk Kim  * portion of the Covered Code, and must include terms to the effect that the
610d84335fSJung-uk Kim  * license from Licensee to its licensee is limited to the intellectual
620d84335fSJung-uk Kim  * property embodied in the software Licensee provides to its licensee, and
630d84335fSJung-uk Kim  * not to intellectual property embodied in modifications its licensee may
640d84335fSJung-uk Kim  * make.
650d84335fSJung-uk Kim  *
660d84335fSJung-uk Kim  * 3.3. Redistribution of Executable. Redistribution in executable form of any
670d84335fSJung-uk Kim  * substantial portion of the Covered Code or modification must reproduce the
680d84335fSJung-uk Kim  * above Copyright Notice, and the following Disclaimer and Export Compliance
690d84335fSJung-uk Kim  * provision in the documentation and/or other materials provided with the
700d84335fSJung-uk Kim  * distribution.
710d84335fSJung-uk Kim  *
720d84335fSJung-uk Kim  * 3.4. Intel retains all right, title, and interest in and to the Original
730d84335fSJung-uk Kim  * Intel Code.
740d84335fSJung-uk Kim  *
750d84335fSJung-uk Kim  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
760d84335fSJung-uk Kim  * Intel shall be used in advertising or otherwise to promote the sale, use or
770d84335fSJung-uk Kim  * other dealings in products derived from or relating to the Covered Code
780d84335fSJung-uk Kim  * without prior written authorization from Intel.
790d84335fSJung-uk Kim  *
800d84335fSJung-uk Kim  * 4. Disclaimer and Export Compliance
810d84335fSJung-uk Kim  *
820d84335fSJung-uk Kim  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
830d84335fSJung-uk Kim  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
840d84335fSJung-uk Kim  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
850d84335fSJung-uk Kim  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
860d84335fSJung-uk Kim  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
870d84335fSJung-uk Kim  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
880d84335fSJung-uk Kim  * PARTICULAR PURPOSE.
890d84335fSJung-uk Kim  *
900d84335fSJung-uk Kim  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
910d84335fSJung-uk Kim  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
920d84335fSJung-uk Kim  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
930d84335fSJung-uk Kim  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
940d84335fSJung-uk Kim  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
950d84335fSJung-uk Kim  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
960d84335fSJung-uk Kim  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
970d84335fSJung-uk Kim  * LIMITED REMEDY.
980d84335fSJung-uk Kim  *
990d84335fSJung-uk Kim  * 4.3. Licensee shall not export, either directly or indirectly, any of this
1000d84335fSJung-uk Kim  * software or system incorporating such software without first obtaining any
1010d84335fSJung-uk Kim  * required license or other approval from the U. S. Department of Commerce or
1020d84335fSJung-uk Kim  * any other agency or department of the United States Government. In the
1030d84335fSJung-uk Kim  * event Licensee exports any such software from the United States or
1040d84335fSJung-uk Kim  * re-exports any such software from a foreign destination, Licensee shall
1050d84335fSJung-uk Kim  * ensure that the distribution and export/re-export of the software is in
1060d84335fSJung-uk Kim  * compliance with all laws, regulations, orders, or other restrictions of the
1070d84335fSJung-uk Kim  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1080d84335fSJung-uk Kim  * any of its subsidiaries will export/re-export any technical data, process,
1090d84335fSJung-uk Kim  * software, or service, directly or indirectly, to any country for which the
1100d84335fSJung-uk Kim  * United States government or any agency thereof requires an export license,
1110d84335fSJung-uk Kim  * other governmental approval, or letter of assurance, without first obtaining
1120d84335fSJung-uk Kim  * such license, approval or letter.
1130d84335fSJung-uk Kim  *
1140d84335fSJung-uk Kim  *****************************************************************************
1150d84335fSJung-uk Kim  *
1160d84335fSJung-uk Kim  * Alternatively, you may choose to be licensed under the terms of the
1170d84335fSJung-uk Kim  * following license:
1180d84335fSJung-uk Kim  *
119d244b227SJung-uk Kim  * Redistribution and use in source and binary forms, with or without
120d244b227SJung-uk Kim  * modification, are permitted provided that the following conditions
121d244b227SJung-uk Kim  * are met:
122d244b227SJung-uk Kim  * 1. Redistributions of source code must retain the above copyright
123d244b227SJung-uk Kim  *    notice, this list of conditions, and the following disclaimer,
124d244b227SJung-uk Kim  *    without modification.
125d244b227SJung-uk Kim  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126d244b227SJung-uk Kim  *    substantially similar to the "NO WARRANTY" disclaimer below
127d244b227SJung-uk Kim  *    ("Disclaimer") and any redistribution must be conditioned upon
128d244b227SJung-uk Kim  *    including a substantially similar Disclaimer requirement for further
129d244b227SJung-uk Kim  *    binary redistribution.
130d244b227SJung-uk Kim  * 3. Neither the names of the above-listed copyright holders nor the names
131d244b227SJung-uk Kim  *    of any contributors may be used to endorse or promote products derived
132d244b227SJung-uk Kim  *    from this software without specific prior written permission.
133a9f12690SJung-uk Kim  *
1340d84335fSJung-uk Kim  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1350d84335fSJung-uk Kim  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1360d84335fSJung-uk Kim  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1370d84335fSJung-uk Kim  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1380d84335fSJung-uk Kim  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1390d84335fSJung-uk Kim  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1400d84335fSJung-uk Kim  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1410d84335fSJung-uk Kim  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1420d84335fSJung-uk Kim  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1430d84335fSJung-uk Kim  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1440d84335fSJung-uk Kim  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1450d84335fSJung-uk Kim  *
1460d84335fSJung-uk Kim  * Alternatively, you may choose to be licensed under the terms of the
147d244b227SJung-uk Kim  * GNU General Public License ("GPL") version 2 as published by the Free
148d244b227SJung-uk Kim  * Software Foundation.
149a9f12690SJung-uk Kim  *
1500d84335fSJung-uk Kim  *****************************************************************************/
151a9f12690SJung-uk Kim 
152a9f12690SJung-uk Kim #ifndef __ACENV_H__
153a9f12690SJung-uk Kim #define __ACENV_H__
154a9f12690SJung-uk Kim 
155a9f12690SJung-uk Kim /*
156a9f12690SJung-uk Kim  * Environment configuration. The purpose of this file is to interface ACPICA
157a9f12690SJung-uk Kim  * to the local environment. This includes compiler-specific, OS-specific,
158a9f12690SJung-uk Kim  * and machine-specific configuration.
159a9f12690SJung-uk Kim  */
160a9f12690SJung-uk Kim 
161a9f12690SJung-uk Kim /* Types for ACPI_MUTEX_TYPE */
162a9f12690SJung-uk Kim 
163a9f12690SJung-uk Kim #define ACPI_BINARY_SEMAPHORE       0
164a9f12690SJung-uk Kim #define ACPI_OSL_MUTEX              1
165a9f12690SJung-uk Kim 
166a9f12690SJung-uk Kim /* Types for DEBUGGER_THREADING */
167a9f12690SJung-uk Kim 
168a9f12690SJung-uk Kim #define DEBUGGER_SINGLE_THREADED    0
169a9f12690SJung-uk Kim #define DEBUGGER_MULTI_THREADED     1
170a9f12690SJung-uk Kim 
171a9f12690SJung-uk Kim 
172a9f12690SJung-uk Kim /******************************************************************************
173a9f12690SJung-uk Kim  *
174a9f12690SJung-uk Kim  * Configuration for ACPI tools and utilities
175a9f12690SJung-uk Kim  *
176a9f12690SJung-uk Kim  *****************************************************************************/
177a9f12690SJung-uk Kim 
178f8146b88SJung-uk Kim /* Common application configuration. All single threaded except for AcpiExec. */
179f8146b88SJung-uk Kim 
180f8146b88SJung-uk Kim #if (defined ACPI_ASL_COMPILER) || \
181f8146b88SJung-uk Kim     (defined ACPI_BIN_APP)      || \
182f8146b88SJung-uk Kim     (defined ACPI_DUMP_APP)     || \
183f8146b88SJung-uk Kim     (defined ACPI_HELP_APP)     || \
184f8146b88SJung-uk Kim     (defined ACPI_NAMES_APP)    || \
185f8146b88SJung-uk Kim     (defined ACPI_SRC_APP)      || \
186f8146b88SJung-uk Kim     (defined ACPI_XTRACT_APP)   || \
18728482948SJung-uk Kim     (defined ACPI_EXAMPLE_APP)  || \
18828482948SJung-uk Kim     (defined ACPI_EFI_HELLO)
189f8146b88SJung-uk Kim #define ACPI_APPLICATION
190f8146b88SJung-uk Kim #define ACPI_SINGLE_THREADED
191493deb39SJung-uk Kim #define USE_NATIVE_ALLOCATE_ZEROED
192f8146b88SJung-uk Kim #endif
193f8146b88SJung-uk Kim 
194a9f12690SJung-uk Kim /* iASL configuration */
195a9f12690SJung-uk Kim 
196a9f12690SJung-uk Kim #ifdef ACPI_ASL_COMPILER
197a9f12690SJung-uk Kim #define ACPI_DEBUG_OUTPUT
198a9f12690SJung-uk Kim #define ACPI_CONSTANT_EVAL_ONLY
199a9f12690SJung-uk Kim #define ACPI_LARGE_NAMESPACE_NODE
200a9f12690SJung-uk Kim #define ACPI_DATA_TABLE_DISASSEMBLY
2017cf3e94aSJung-uk Kim #define ACPI_32BIT_PHYSICAL_ADDRESS
20270e6ab8fSJung-uk Kim #define ACPI_DISASSEMBLER 1
203a9f12690SJung-uk Kim #endif
204a9f12690SJung-uk Kim 
2053f0275a0SJung-uk Kim /* AcpiExec configuration. Multithreaded with full AML debugger */
206a9f12690SJung-uk Kim 
207a9f12690SJung-uk Kim #ifdef ACPI_EXEC_APP
208a9f12690SJung-uk Kim #define ACPI_APPLICATION
209a9f12690SJung-uk Kim #define ACPI_FULL_DEBUG
210a9f12690SJung-uk Kim #define ACPI_MUTEX_DEBUG
211a9f12690SJung-uk Kim #define ACPI_DBG_TRACK_ALLOCATIONS
212a9f12690SJung-uk Kim #endif
213a9f12690SJung-uk Kim 
214313a0c13SJung-uk Kim /* AcpiHelp configuration. Error messages disabled. */
215313a0c13SJung-uk Kim 
2163f0275a0SJung-uk Kim #ifdef ACPI_HELP_APP
217e8241eabSJung-uk Kim #define ACPI_NO_ERROR_MESSAGES
2183c1812acSJung-uk Kim #endif
2193c1812acSJung-uk Kim 
220313a0c13SJung-uk Kim /* AcpiNames configuration. Debug output enabled. */
221313a0c13SJung-uk Kim 
222313a0c13SJung-uk Kim #ifdef ACPI_NAMES_APP
223313a0c13SJung-uk Kim #define ACPI_DEBUG_OUTPUT
224313a0c13SJung-uk Kim #endif
225313a0c13SJung-uk Kim 
226313a0c13SJung-uk Kim /* AcpiExec/AcpiNames/Example configuration. Native RSDP used. */
227313a0c13SJung-uk Kim 
228313a0c13SJung-uk Kim #if (defined ACPI_EXEC_APP)     || \
229313a0c13SJung-uk Kim     (defined ACPI_EXAMPLE_APP)  || \
230313a0c13SJung-uk Kim     (defined ACPI_NAMES_APP)
231313a0c13SJung-uk Kim #define ACPI_USE_NATIVE_RSDP_POINTER
232313a0c13SJung-uk Kim #endif
233313a0c13SJung-uk Kim 
23470e6ab8fSJung-uk Kim /* AcpiDump configuration. Native mapping used if provided by the host */
235313a0c13SJung-uk Kim 
236313a0c13SJung-uk Kim #ifdef ACPI_DUMP_APP
237313a0c13SJung-uk Kim #define ACPI_USE_NATIVE_MEMORY_MAPPING
238313a0c13SJung-uk Kim #endif
239313a0c13SJung-uk Kim 
240313a0c13SJung-uk Kim /* AcpiNames/Example configuration. Hardware disabled */
241313a0c13SJung-uk Kim 
242313a0c13SJung-uk Kim #if (defined ACPI_EXAMPLE_APP)  || \
243313a0c13SJung-uk Kim     (defined ACPI_NAMES_APP)
244313a0c13SJung-uk Kim #define ACPI_REDUCED_HARDWARE 1
245313a0c13SJung-uk Kim #endif
246313a0c13SJung-uk Kim 
247f8146b88SJung-uk Kim /* Linkable ACPICA library. Two versions, one with full debug. */
248a9f12690SJung-uk Kim 
249a9f12690SJung-uk Kim #ifdef ACPI_LIBRARY
250a9f12690SJung-uk Kim #define ACPI_USE_LOCAL_CACHE
251f8146b88SJung-uk Kim #define ACPI_DEBUGGER 1
252f8146b88SJung-uk Kim #define ACPI_DISASSEMBLER 1
253f8146b88SJung-uk Kim 
254f8146b88SJung-uk Kim #ifdef _DEBUG
255f8146b88SJung-uk Kim #define ACPI_DEBUG_OUTPUT
256f8146b88SJung-uk Kim #endif
257a9f12690SJung-uk Kim #endif
258a9f12690SJung-uk Kim 
259a9f12690SJung-uk Kim /* Common for all ACPICA applications */
260a9f12690SJung-uk Kim 
261a9f12690SJung-uk Kim #ifdef ACPI_APPLICATION
262a9f12690SJung-uk Kim #define ACPI_USE_LOCAL_CACHE
263a9f12690SJung-uk Kim #endif
264a9f12690SJung-uk Kim 
26570e6ab8fSJung-uk Kim /* Common debug/disassembler support */
266a9f12690SJung-uk Kim 
267a9f12690SJung-uk Kim #ifdef ACPI_FULL_DEBUG
268a9f12690SJung-uk Kim #define ACPI_DEBUG_OUTPUT
26970e6ab8fSJung-uk Kim #define ACPI_DEBUGGER 1
27070e6ab8fSJung-uk Kim #define ACPI_DISASSEMBLER 1
271a9f12690SJung-uk Kim #endif
272a9f12690SJung-uk Kim 
273f9a6772eSJung-uk Kim /*
274f9a6772eSJung-uk Kim  * acpisrc CR\LF support
275f9a6772eSJung-uk Kim  * Unix file line endings do not include the carriage return.
276f9a6772eSJung-uk Kim  * If the acpisrc utility is being built using a microsoft compiler, it means
277f9a6772eSJung-uk Kim  * that it will be running on a windows machine which means that the output is
278f9a6772eSJung-uk Kim  * expected to have CR/LF newlines. If the acpisrc utility is built with
279f9a6772eSJung-uk Kim  * anything else, it will likely run on a system with LF newlines. This flag
280f9a6772eSJung-uk Kim  * tells the acpisrc utility that newlines will be in the LF format.
281f9a6772eSJung-uk Kim  */
282f9a6772eSJung-uk Kim #if defined(ACPI_SRC_APP) && !defined(_MSC_VER)
283f9a6772eSJung-uk Kim #define ACPI_SRC_OS_LF_ONLY 1
284f9a6772eSJung-uk Kim #else
285f9a6772eSJung-uk Kim #define ACPI_SRC_OS_LF_ONLY 0
286f9a6772eSJung-uk Kim #endif
287f9a6772eSJung-uk Kim 
288a9f12690SJung-uk Kim /*! [Begin] no source code translation */
289a9f12690SJung-uk Kim 
290a9f12690SJung-uk Kim /******************************************************************************
291a9f12690SJung-uk Kim  *
292a9f12690SJung-uk Kim  * Host configuration files. The compiler configuration files are included
293493deb39SJung-uk Kim  * first.
294a9f12690SJung-uk Kim  *
295a9f12690SJung-uk Kim  *****************************************************************************/
296a9f12690SJung-uk Kim 
297493deb39SJung-uk Kim #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
298493deb39SJung-uk Kim #include <contrib/dev/acpica/include/platform/acgcc.h>
299493deb39SJung-uk Kim 
300493deb39SJung-uk Kim #elif defined(_MSC_VER)
301493deb39SJung-uk Kim #include "acmsvc.h"
302493deb39SJung-uk Kim 
303493deb39SJung-uk Kim #elif defined(__INTEL_COMPILER)
304493deb39SJung-uk Kim #include "acintel.h"
305493deb39SJung-uk Kim 
306493deb39SJung-uk Kim #endif
307493deb39SJung-uk Kim 
308a9f12690SJung-uk Kim #if defined(_LINUX) || defined(__linux__)
309a9f12690SJung-uk Kim #include "aclinux.h"
310a9f12690SJung-uk Kim 
311a9d8d09cSJung-uk Kim #elif defined(_APPLE) || defined(__APPLE__)
312a9d8d09cSJung-uk Kim #include "acmacosx.h"
313a9d8d09cSJung-uk Kim 
314a371a5fdSJung-uk Kim #elif defined(__DragonFly__)
315a371a5fdSJung-uk Kim #include "acdragonfly.h"
316a371a5fdSJung-uk Kim 
317a9f12690SJung-uk Kim #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
318ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/platform/acfreebsd.h>
319a9f12690SJung-uk Kim 
320a9f12690SJung-uk Kim #elif defined(__NetBSD__)
321a9f12690SJung-uk Kim #include "acnetbsd.h"
322a9f12690SJung-uk Kim 
323a9f12690SJung-uk Kim #elif defined(__sun)
324a9f12690SJung-uk Kim #include "acsolaris.h"
325a9f12690SJung-uk Kim 
326a9f12690SJung-uk Kim #elif defined(MODESTO)
327a9f12690SJung-uk Kim #include "acmodesto.h"
328a9f12690SJung-uk Kim 
329a9f12690SJung-uk Kim #elif defined(NETWARE)
330a9f12690SJung-uk Kim #include "acnetware.h"
331a9f12690SJung-uk Kim 
332a9f12690SJung-uk Kim #elif defined(_CYGWIN)
333a9f12690SJung-uk Kim #include "accygwin.h"
334a9f12690SJung-uk Kim 
335a9f12690SJung-uk Kim #elif defined(WIN32)
336a9f12690SJung-uk Kim #include "acwin.h"
337a9f12690SJung-uk Kim 
338a9f12690SJung-uk Kim #elif defined(WIN64)
339a9f12690SJung-uk Kim #include "acwin64.h"
340a9f12690SJung-uk Kim 
341a9f12690SJung-uk Kim #elif defined(_WRS_LIB_BUILD)
342a9f12690SJung-uk Kim #include "acvxworks.h"
343a9f12690SJung-uk Kim 
344a9f12690SJung-uk Kim #elif defined(__OS2__)
345a9f12690SJung-uk Kim #include "acos2.h"
346a9f12690SJung-uk Kim 
3471df130f1SJung-uk Kim #elif defined(__HAIKU__)
3481df130f1SJung-uk Kim #include "achaiku.h"
3491df130f1SJung-uk Kim 
350f8146b88SJung-uk Kim #elif defined(__QNX__)
351f8146b88SJung-uk Kim #include "acqnx.h"
352f8146b88SJung-uk Kim 
353493deb39SJung-uk Kim /*
354493deb39SJung-uk Kim  * EFI applications can be built with -nostdlib, in this case, it must be
355493deb39SJung-uk Kim  * included after including all other host environmental definitions, in
356493deb39SJung-uk Kim  * order to override the definitions.
357493deb39SJung-uk Kim  */
358493deb39SJung-uk Kim #elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
359493deb39SJung-uk Kim #include "acefi.h"
360493deb39SJung-uk Kim 
361722b1667SJung-uk Kim #elif defined(__ZEPHYR__)
362722b1667SJung-uk Kim #include "aczephyr.h"
363a9f12690SJung-uk Kim #else
364a9f12690SJung-uk Kim 
365a9f12690SJung-uk Kim /* Unknown environment */
366a9f12690SJung-uk Kim 
367a9f12690SJung-uk Kim #error Unknown target environment
368a9f12690SJung-uk Kim #endif
369a9f12690SJung-uk Kim 
370a9f12690SJung-uk Kim /*! [End] no source code translation !*/
371a9f12690SJung-uk Kim 
372a9f12690SJung-uk Kim 
373a9f12690SJung-uk Kim /******************************************************************************
374a9f12690SJung-uk Kim  *
375a9f12690SJung-uk Kim  * Setup defaults for the required symbols that were not defined in one of
376a9f12690SJung-uk Kim  * the host/compiler files above.
377a9f12690SJung-uk Kim  *
378a9f12690SJung-uk Kim  *****************************************************************************/
379a9f12690SJung-uk Kim 
380a9f12690SJung-uk Kim /* 64-bit data types */
381a9f12690SJung-uk Kim 
382a9f12690SJung-uk Kim #ifndef COMPILER_DEPENDENT_INT64
383a9f12690SJung-uk Kim #define COMPILER_DEPENDENT_INT64   long long
384a9f12690SJung-uk Kim #endif
385a9f12690SJung-uk Kim 
386a9f12690SJung-uk Kim #ifndef COMPILER_DEPENDENT_UINT64
387a9f12690SJung-uk Kim #define COMPILER_DEPENDENT_UINT64  unsigned long long
388a9f12690SJung-uk Kim #endif
389a9f12690SJung-uk Kim 
390a9f12690SJung-uk Kim /* Type of mutex supported by host. Default is binary semaphores. */
391a9f12690SJung-uk Kim 
392a9f12690SJung-uk Kim #ifndef ACPI_MUTEX_TYPE
393a9f12690SJung-uk Kim #define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
394a9f12690SJung-uk Kim #endif
395a9f12690SJung-uk Kim 
396a9f12690SJung-uk Kim /* Global Lock acquire/release */
397a9f12690SJung-uk Kim 
398a9f12690SJung-uk Kim #ifndef ACPI_ACQUIRE_GLOBAL_LOCK
3999a179dd8SJung-uk Kim #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = 1
400a9f12690SJung-uk Kim #endif
401a9f12690SJung-uk Kim 
402a9f12690SJung-uk Kim #ifndef ACPI_RELEASE_GLOBAL_LOCK
4039a179dd8SJung-uk Kim #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0
404a9f12690SJung-uk Kim #endif
405a9f12690SJung-uk Kim 
406*92f570c3SJung-uk Kim /* NULL/invalid value to use for destroyed or not-yet-created semaphores. */
407*92f570c3SJung-uk Kim 
408*92f570c3SJung-uk Kim #ifndef ACPI_SEMAPHORE_NULL
409*92f570c3SJung-uk Kim #define ACPI_SEMAPHORE_NULL NULL
410*92f570c3SJung-uk Kim #endif
411*92f570c3SJung-uk Kim 
412a9f12690SJung-uk Kim /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
413a9f12690SJung-uk Kim 
414a9f12690SJung-uk Kim #ifndef ACPI_FLUSH_CPU_CACHE
415a9f12690SJung-uk Kim #define ACPI_FLUSH_CPU_CACHE()
416a9f12690SJung-uk Kim #endif
417a9f12690SJung-uk Kim 
41842fecd12SJung-uk Kim /* "inline" keywords - configurable since inline is not standardized */
41942fecd12SJung-uk Kim 
42042fecd12SJung-uk Kim #ifndef ACPI_INLINE
42142fecd12SJung-uk Kim #define ACPI_INLINE
42242fecd12SJung-uk Kim #endif
42342fecd12SJung-uk Kim 
4245f9b24faSJung-uk Kim /* Use ordered initialization if compiler doesn't support designated. */
4255f9b24faSJung-uk Kim #ifndef ACPI_STRUCT_INIT
4265f9b24faSJung-uk Kim #define ACPI_STRUCT_INIT(field, value)  value
4275f9b24faSJung-uk Kim #endif
4285f9b24faSJung-uk Kim 
429a9f12690SJung-uk Kim /*
430a9f12690SJung-uk Kim  * Configurable calling conventions:
431a9f12690SJung-uk Kim  *
432a9f12690SJung-uk Kim  * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
433a9f12690SJung-uk Kim  * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
434a9f12690SJung-uk Kim  * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
435a9f12690SJung-uk Kim  * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
436a9f12690SJung-uk Kim  */
437a9f12690SJung-uk Kim #ifndef ACPI_SYSTEM_XFACE
438a9f12690SJung-uk Kim #define ACPI_SYSTEM_XFACE
439a9f12690SJung-uk Kim #endif
440a9f12690SJung-uk Kim 
441a9f12690SJung-uk Kim #ifndef ACPI_EXTERNAL_XFACE
442a9f12690SJung-uk Kim #define ACPI_EXTERNAL_XFACE
443a9f12690SJung-uk Kim #endif
444a9f12690SJung-uk Kim 
445a9f12690SJung-uk Kim #ifndef ACPI_INTERNAL_XFACE
446a9f12690SJung-uk Kim #define ACPI_INTERNAL_XFACE
447a9f12690SJung-uk Kim #endif
448a9f12690SJung-uk Kim 
449a9f12690SJung-uk Kim #ifndef ACPI_INTERNAL_VAR_XFACE
450a9f12690SJung-uk Kim #define ACPI_INTERNAL_VAR_XFACE
451a9f12690SJung-uk Kim #endif
452a9f12690SJung-uk Kim 
453f8146b88SJung-uk Kim 
454a9f12690SJung-uk Kim /*
455a9f12690SJung-uk Kim  * Debugger threading model
456a9f12690SJung-uk Kim  * Use single threaded if the entire subsystem is contained in an application
457a9f12690SJung-uk Kim  * Use multiple threaded when the subsystem is running in the kernel.
458a9f12690SJung-uk Kim  *
459a9f12690SJung-uk Kim  * By default the model is single threaded if ACPI_APPLICATION is set,
460a9f12690SJung-uk Kim  * multi-threaded if ACPI_APPLICATION is not set.
461a9f12690SJung-uk Kim  */
462a9f12690SJung-uk Kim #ifndef DEBUGGER_THREADING
463f8146b88SJung-uk Kim #if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
464f8146b88SJung-uk Kim #define DEBUGGER_THREADING          DEBUGGER_MULTI_THREADED
465a9f12690SJung-uk Kim 
466a9f12690SJung-uk Kim #else
467f8146b88SJung-uk Kim #define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
468a9f12690SJung-uk Kim #endif
469a9f12690SJung-uk Kim #endif /* !DEBUGGER_THREADING */
470a9f12690SJung-uk Kim 
471a9f12690SJung-uk Kim 
472a9f12690SJung-uk Kim /******************************************************************************
473a9f12690SJung-uk Kim  *
474a9f12690SJung-uk Kim  * C library configuration
475a9f12690SJung-uk Kim  *
476a9f12690SJung-uk Kim  *****************************************************************************/
477a9f12690SJung-uk Kim 
478a9f12690SJung-uk Kim /*
479a9f12690SJung-uk Kim  * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
480a9f12690SJung-uk Kim  *      Otherwise, local versions of string/memory functions will be used.
481a9f12690SJung-uk Kim  * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
482493deb39SJung-uk Kim  *      the standard header files may be used. Defining this implies that
483493deb39SJung-uk Kim  *      ACPI_USE_SYSTEM_CLIBRARY has been defined.
484a9f12690SJung-uk Kim  *
48570e6ab8fSJung-uk Kim  * The ACPICA subsystem only uses low level C library functions that do not
48670e6ab8fSJung-uk Kim  * call operating system services and may therefore be inlined in the code.
487a9f12690SJung-uk Kim  *
488a9f12690SJung-uk Kim  * It may be necessary to tailor these include files to the target
489a9f12690SJung-uk Kim  * generation environment.
490a9f12690SJung-uk Kim  */
491a9f12690SJung-uk Kim 
492efcc2a30SJung-uk Kim /* Use the standard C library headers. We want to keep these to a minimum. */
493a9f12690SJung-uk Kim 
494a9f12690SJung-uk Kim #ifdef ACPI_USE_STANDARD_HEADERS
495a9f12690SJung-uk Kim 
496a9f12690SJung-uk Kim /* Use the standard headers from the standard locations */
497a9f12690SJung-uk Kim 
498a9f12690SJung-uk Kim #include <stdlib.h>
499a9f12690SJung-uk Kim #include <string.h>
500a9f12690SJung-uk Kim #include <ctype.h>
50128482948SJung-uk Kim #if defined (ACPI_APPLICATION) || defined(ACPI_LIBRARY)
502493deb39SJung-uk Kim #include <stdio.h>
503493deb39SJung-uk Kim #include <fcntl.h>
504493deb39SJung-uk Kim #include <errno.h>
505493deb39SJung-uk Kim #include <time.h>
506493deb39SJung-uk Kim #include <signal.h>
507493deb39SJung-uk Kim #endif
508a9f12690SJung-uk Kim 
509a9f12690SJung-uk Kim #endif /* ACPI_USE_STANDARD_HEADERS */
510a9f12690SJung-uk Kim 
511313a0c13SJung-uk Kim #ifdef ACPI_APPLICATION
512313a0c13SJung-uk Kim #define ACPI_FILE              FILE *
513313a0c13SJung-uk Kim #define ACPI_FILE_OUT          stdout
514313a0c13SJung-uk Kim #define ACPI_FILE_ERR          stderr
515313a0c13SJung-uk Kim #else
516313a0c13SJung-uk Kim #define ACPI_FILE              void *
517313a0c13SJung-uk Kim #define ACPI_FILE_OUT          NULL
518313a0c13SJung-uk Kim #define ACPI_FILE_ERR          NULL
519313a0c13SJung-uk Kim #endif /* ACPI_APPLICATION */
520493deb39SJung-uk Kim 
521493deb39SJung-uk Kim #ifndef ACPI_INIT_FUNCTION
522493deb39SJung-uk Kim #define ACPI_INIT_FUNCTION
523493deb39SJung-uk Kim #endif
524313a0c13SJung-uk Kim 
525a9f12690SJung-uk Kim #endif /* __ACENV_H__ */
526