17c478bd9Sstevel@tonic-gate /******************************************************************************
27c478bd9Sstevel@tonic-gate  *
37c478bd9Sstevel@tonic-gate  * Name: acenv.h - Generation environment specific items
4*450d6964Smyers  *       $Revision: 116 $
57c478bd9Sstevel@tonic-gate  *
67c478bd9Sstevel@tonic-gate  *****************************************************************************/
77c478bd9Sstevel@tonic-gate 
87c478bd9Sstevel@tonic-gate /******************************************************************************
97c478bd9Sstevel@tonic-gate  *
107c478bd9Sstevel@tonic-gate  * 1. Copyright Notice
117c478bd9Sstevel@tonic-gate  *
127c478bd9Sstevel@tonic-gate  * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
137c478bd9Sstevel@tonic-gate  * All rights reserved.
147c478bd9Sstevel@tonic-gate  *
157c478bd9Sstevel@tonic-gate  * 2. License
167c478bd9Sstevel@tonic-gate  *
177c478bd9Sstevel@tonic-gate  * 2.1. This is your license from Intel Corp. under its intellectual property
187c478bd9Sstevel@tonic-gate  * rights.  You may have additional license terms from the party that provided
197c478bd9Sstevel@tonic-gate  * you this software, covering your right to use that party's intellectual
207c478bd9Sstevel@tonic-gate  * property rights.
217c478bd9Sstevel@tonic-gate  *
227c478bd9Sstevel@tonic-gate  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
237c478bd9Sstevel@tonic-gate  * copy of the source code appearing in this file ("Covered Code") an
247c478bd9Sstevel@tonic-gate  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
257c478bd9Sstevel@tonic-gate  * base code distributed originally by Intel ("Original Intel Code") to copy,
267c478bd9Sstevel@tonic-gate  * make derivatives, distribute, use and display any portion of the Covered
277c478bd9Sstevel@tonic-gate  * Code in any form, with the right to sublicense such rights; and
287c478bd9Sstevel@tonic-gate  *
297c478bd9Sstevel@tonic-gate  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
307c478bd9Sstevel@tonic-gate  * license (with the right to sublicense), under only those claims of Intel
317c478bd9Sstevel@tonic-gate  * patents that are infringed by the Original Intel Code, to make, use, sell,
327c478bd9Sstevel@tonic-gate  * offer to sell, and import the Covered Code and derivative works thereof
337c478bd9Sstevel@tonic-gate  * solely to the minimum extent necessary to exercise the above copyright
347c478bd9Sstevel@tonic-gate  * license, and in no event shall the patent license extend to any additions
357c478bd9Sstevel@tonic-gate  * to or modifications of the Original Intel Code.  No other license or right
367c478bd9Sstevel@tonic-gate  * is granted directly or by implication, estoppel or otherwise;
377c478bd9Sstevel@tonic-gate  *
387c478bd9Sstevel@tonic-gate  * The above copyright and patent license is granted only if the following
397c478bd9Sstevel@tonic-gate  * conditions are met:
407c478bd9Sstevel@tonic-gate  *
417c478bd9Sstevel@tonic-gate  * 3. Conditions
427c478bd9Sstevel@tonic-gate  *
437c478bd9Sstevel@tonic-gate  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
447c478bd9Sstevel@tonic-gate  * Redistribution of source code of any substantial portion of the Covered
457c478bd9Sstevel@tonic-gate  * Code or modification with rights to further distribute source must include
467c478bd9Sstevel@tonic-gate  * the above Copyright Notice, the above License, this list of Conditions,
477c478bd9Sstevel@tonic-gate  * and the following Disclaimer and Export Compliance provision.  In addition,
487c478bd9Sstevel@tonic-gate  * Licensee must cause all Covered Code to which Licensee contributes to
497c478bd9Sstevel@tonic-gate  * contain a file documenting the changes Licensee made to create that Covered
507c478bd9Sstevel@tonic-gate  * Code and the date of any change.  Licensee must include in that file the
517c478bd9Sstevel@tonic-gate  * documentation of any changes made by any predecessor Licensee.  Licensee
527c478bd9Sstevel@tonic-gate  * must include a prominent statement that the modification is derived,
537c478bd9Sstevel@tonic-gate  * directly or indirectly, from Original Intel Code.
547c478bd9Sstevel@tonic-gate  *
557c478bd9Sstevel@tonic-gate  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
567c478bd9Sstevel@tonic-gate  * Redistribution of source code of any substantial portion of the Covered
577c478bd9Sstevel@tonic-gate  * Code or modification without rights to further distribute source must
587c478bd9Sstevel@tonic-gate  * include the following Disclaimer and Export Compliance provision in the
597c478bd9Sstevel@tonic-gate  * documentation and/or other materials provided with distribution.  In
607c478bd9Sstevel@tonic-gate  * addition, Licensee may not authorize further sublicense of source of any
617c478bd9Sstevel@tonic-gate  * portion of the Covered Code, and must include terms to the effect that the
627c478bd9Sstevel@tonic-gate  * license from Licensee to its licensee is limited to the intellectual
637c478bd9Sstevel@tonic-gate  * property embodied in the software Licensee provides to its licensee, and
647c478bd9Sstevel@tonic-gate  * not to intellectual property embodied in modifications its licensee may
657c478bd9Sstevel@tonic-gate  * make.
667c478bd9Sstevel@tonic-gate  *
677c478bd9Sstevel@tonic-gate  * 3.3. Redistribution of Executable. Redistribution in executable form of any
687c478bd9Sstevel@tonic-gate  * substantial portion of the Covered Code or modification must reproduce the
697c478bd9Sstevel@tonic-gate  * above Copyright Notice, and the following Disclaimer and Export Compliance
707c478bd9Sstevel@tonic-gate  * provision in the documentation and/or other materials provided with the
717c478bd9Sstevel@tonic-gate  * distribution.
727c478bd9Sstevel@tonic-gate  *
737c478bd9Sstevel@tonic-gate  * 3.4. Intel retains all right, title, and interest in and to the Original
747c478bd9Sstevel@tonic-gate  * Intel Code.
757c478bd9Sstevel@tonic-gate  *
767c478bd9Sstevel@tonic-gate  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
777c478bd9Sstevel@tonic-gate  * Intel shall be used in advertising or otherwise to promote the sale, use or
787c478bd9Sstevel@tonic-gate  * other dealings in products derived from or relating to the Covered Code
797c478bd9Sstevel@tonic-gate  * without prior written authorization from Intel.
807c478bd9Sstevel@tonic-gate  *
817c478bd9Sstevel@tonic-gate  * 4. Disclaimer and Export Compliance
827c478bd9Sstevel@tonic-gate  *
837c478bd9Sstevel@tonic-gate  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
847c478bd9Sstevel@tonic-gate  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
857c478bd9Sstevel@tonic-gate  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
867c478bd9Sstevel@tonic-gate  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
877c478bd9Sstevel@tonic-gate  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
887c478bd9Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
897c478bd9Sstevel@tonic-gate  * PARTICULAR PURPOSE.
907c478bd9Sstevel@tonic-gate  *
917c478bd9Sstevel@tonic-gate  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
927c478bd9Sstevel@tonic-gate  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
937c478bd9Sstevel@tonic-gate  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
947c478bd9Sstevel@tonic-gate  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
957c478bd9Sstevel@tonic-gate  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
967c478bd9Sstevel@tonic-gate  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
977c478bd9Sstevel@tonic-gate  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
987c478bd9Sstevel@tonic-gate  * LIMITED REMEDY.
997c478bd9Sstevel@tonic-gate  *
1007c478bd9Sstevel@tonic-gate  * 4.3. Licensee shall not export, either directly or indirectly, any of this
1017c478bd9Sstevel@tonic-gate  * software or system incorporating such software without first obtaining any
1027c478bd9Sstevel@tonic-gate  * required license or other approval from the U. S. Department of Commerce or
1037c478bd9Sstevel@tonic-gate  * any other agency or department of the United States Government.  In the
1047c478bd9Sstevel@tonic-gate  * event Licensee exports any such software from the United States or
1057c478bd9Sstevel@tonic-gate  * re-exports any such software from a foreign destination, Licensee shall
1067c478bd9Sstevel@tonic-gate  * ensure that the distribution and export/re-export of the software is in
1077c478bd9Sstevel@tonic-gate  * compliance with all laws, regulations, orders, or other restrictions of the
1087c478bd9Sstevel@tonic-gate  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1097c478bd9Sstevel@tonic-gate  * any of its subsidiaries will export/re-export any technical data, process,
1107c478bd9Sstevel@tonic-gate  * software, or service, directly or indirectly, to any country for which the
1117c478bd9Sstevel@tonic-gate  * United States government or any agency thereof requires an export license,
1127c478bd9Sstevel@tonic-gate  * other governmental approval, or letter of assurance, without first obtaining
1137c478bd9Sstevel@tonic-gate  * such license, approval or letter.
1147c478bd9Sstevel@tonic-gate  *
1157c478bd9Sstevel@tonic-gate  *****************************************************************************/
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate #ifndef __ACENV_H__
1187c478bd9Sstevel@tonic-gate #define __ACENV_H__
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate /*
1227c478bd9Sstevel@tonic-gate  * Configuration for ACPI tools and utilities
1237c478bd9Sstevel@tonic-gate  */
1247c478bd9Sstevel@tonic-gate 
125*450d6964Smyers #ifdef ACPI_LIBRARY
126*450d6964Smyers #define ACPI_USE_LOCAL_CACHE
127*450d6964Smyers #endif
128*450d6964Smyers 
129*450d6964Smyers #ifdef ACPI_DUMP_APP
1307c478bd9Sstevel@tonic-gate #ifndef MSDOS
1317c478bd9Sstevel@tonic-gate #define ACPI_DEBUG_OUTPUT
1327c478bd9Sstevel@tonic-gate #endif
1337c478bd9Sstevel@tonic-gate #define ACPI_APPLICATION
1347c478bd9Sstevel@tonic-gate #define ACPI_DISASSEMBLER
1357c478bd9Sstevel@tonic-gate #define ACPI_NO_METHOD_EXECUTION
1367c478bd9Sstevel@tonic-gate #endif
1377c478bd9Sstevel@tonic-gate 
138*450d6964Smyers #ifdef ACPI_EXEC_APP
1397c478bd9Sstevel@tonic-gate #undef DEBUGGER_THREADING
1407c478bd9Sstevel@tonic-gate #define DEBUGGER_THREADING      DEBUGGER_SINGLE_THREADED
1417c478bd9Sstevel@tonic-gate #define ACPI_DEBUG_OUTPUT
1427c478bd9Sstevel@tonic-gate #define ACPI_APPLICATION
1437c478bd9Sstevel@tonic-gate #define ACPI_DEBUGGER
1447c478bd9Sstevel@tonic-gate #define ACPI_DISASSEMBLER
1457c478bd9Sstevel@tonic-gate #endif
1467c478bd9Sstevel@tonic-gate 
147*450d6964Smyers #ifdef ACPI_ASL_COMPILER
1487c478bd9Sstevel@tonic-gate #define ACPI_DEBUG_OUTPUT
1497c478bd9Sstevel@tonic-gate #define ACPI_APPLICATION
1507c478bd9Sstevel@tonic-gate #define ACPI_DISASSEMBLER
1517c478bd9Sstevel@tonic-gate #define ACPI_CONSTANT_EVAL_ONLY
152*450d6964Smyers #endif
153*450d6964Smyers 
154*450d6964Smyers #ifdef ACPI_APPLICATION
1557c478bd9Sstevel@tonic-gate #define ACPI_USE_SYSTEM_CLIBRARY
156*450d6964Smyers #define ACPI_USE_LOCAL_CACHE
1577c478bd9Sstevel@tonic-gate #endif
1587c478bd9Sstevel@tonic-gate 
1597c478bd9Sstevel@tonic-gate /*
1607c478bd9Sstevel@tonic-gate  * Environment configuration.  The purpose of this file is to interface to the
1617c478bd9Sstevel@tonic-gate  * local generation environment.
1627c478bd9Sstevel@tonic-gate  *
1637c478bd9Sstevel@tonic-gate  * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
1647c478bd9Sstevel@tonic-gate  *      Otherwise, local versions of string/memory functions will be used.
1657c478bd9Sstevel@tonic-gate  * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
1667c478bd9Sstevel@tonic-gate  *      the standard header files may be used.
1677c478bd9Sstevel@tonic-gate  *
1687c478bd9Sstevel@tonic-gate  * The ACPI subsystem only uses low level C library functions that do not call
1697c478bd9Sstevel@tonic-gate  * operating system services and may therefore be inlined in the code.
1707c478bd9Sstevel@tonic-gate  *
1717c478bd9Sstevel@tonic-gate  * It may be necessary to tailor these include files to the target
1727c478bd9Sstevel@tonic-gate  * generation environment.
1737c478bd9Sstevel@tonic-gate  *
1747c478bd9Sstevel@tonic-gate  *
1757c478bd9Sstevel@tonic-gate  * Functions and constants used from each header:
1767c478bd9Sstevel@tonic-gate  *
1777c478bd9Sstevel@tonic-gate  * string.h:    memcpy
1787c478bd9Sstevel@tonic-gate  *              memset
1797c478bd9Sstevel@tonic-gate  *              strcat
1807c478bd9Sstevel@tonic-gate  *              strcmp
1817c478bd9Sstevel@tonic-gate  *              strcpy
1827c478bd9Sstevel@tonic-gate  *              strlen
1837c478bd9Sstevel@tonic-gate  *              strncmp
1847c478bd9Sstevel@tonic-gate  *              strncat
1857c478bd9Sstevel@tonic-gate  *              strncpy
1867c478bd9Sstevel@tonic-gate  *
1877c478bd9Sstevel@tonic-gate  * stdlib.h:    strtoul
1887c478bd9Sstevel@tonic-gate  *
1897c478bd9Sstevel@tonic-gate  * stdarg.h:    va_list
1907c478bd9Sstevel@tonic-gate  *              va_arg
1917c478bd9Sstevel@tonic-gate  *              va_start
1927c478bd9Sstevel@tonic-gate  *              va_end
1937c478bd9Sstevel@tonic-gate  *
1947c478bd9Sstevel@tonic-gate  */
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate /*! [Begin] no source code translation */
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate #if defined(__linux__)
1997c478bd9Sstevel@tonic-gate #include "aclinux.h"
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate #elif defined(_AED_EFI)
2027c478bd9Sstevel@tonic-gate #include "acefi.h"
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate #elif defined(WIN32)
2057c478bd9Sstevel@tonic-gate #include "acwin.h"
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate #elif defined(WIN64)
2087c478bd9Sstevel@tonic-gate #include "acwin64.h"
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate #elif defined(MSDOS)        /* Must appear after WIN32 and WIN64 check */
2117c478bd9Sstevel@tonic-gate #include "acdos16.h"
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate #elif defined(__FreeBSD__)
2147c478bd9Sstevel@tonic-gate #include "acfreebsd.h"
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate #elif defined(__NetBSD__)
2177c478bd9Sstevel@tonic-gate #include "acnetbsd.h"
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate #elif defined(MODESTO)
2207c478bd9Sstevel@tonic-gate #include "acmodesto.h"
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate #elif defined(NETWARE)
2237c478bd9Sstevel@tonic-gate #include "acnetware.h"
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate #elif defined(__sun)
2267c478bd9Sstevel@tonic-gate #include "acsolaris.h"
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate #else
2297c478bd9Sstevel@tonic-gate 
2307c478bd9Sstevel@tonic-gate /* All other environments */
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate #define ACPI_USE_STANDARD_HEADERS
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate #define COMPILER_DEPENDENT_INT64   long long
2357c478bd9Sstevel@tonic-gate #define COMPILER_DEPENDENT_UINT64  unsigned long long
2367c478bd9Sstevel@tonic-gate 
2377c478bd9Sstevel@tonic-gate /*
2387c478bd9Sstevel@tonic-gate  * This macro is used to tag functions as "printf-like" because
2397c478bd9Sstevel@tonic-gate  * some compilers can catch printf format string problems. MSVC
2407c478bd9Sstevel@tonic-gate  * doesn't, so this is proprocessed away.
2417c478bd9Sstevel@tonic-gate  */
2427c478bd9Sstevel@tonic-gate #define ACPI_PRINTF_LIKE_FUNC
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate #endif
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate /*
2477c478bd9Sstevel@tonic-gate  * Memory allocation tracking.  Used only if
2487c478bd9Sstevel@tonic-gate  * 1) This is the debug version
2497c478bd9Sstevel@tonic-gate  * 2) This is NOT a 16-bit version of the code (not enough real-mode memory)
2507c478bd9Sstevel@tonic-gate  */
2517c478bd9Sstevel@tonic-gate #ifdef ACPI_DEBUG_OUTPUT
2527c478bd9Sstevel@tonic-gate #if ACPI_MACHINE_WIDTH != 16
2537c478bd9Sstevel@tonic-gate #define ACPI_DBG_TRACK_ALLOCATIONS
2547c478bd9Sstevel@tonic-gate #endif
2557c478bd9Sstevel@tonic-gate #endif
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate /*! [End] no source code translation !*/
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate 
2607c478bd9Sstevel@tonic-gate /*
2617c478bd9Sstevel@tonic-gate  * Debugger threading model
2627c478bd9Sstevel@tonic-gate  * Use single threaded if the entire subsystem is contained in an application
2637c478bd9Sstevel@tonic-gate  * Use multiple threaded when the subsystem is running in the kernel.
2647c478bd9Sstevel@tonic-gate  *
2657c478bd9Sstevel@tonic-gate  * By default the model is single threaded if ACPI_APPLICATION is set,
2667c478bd9Sstevel@tonic-gate  * multi-threaded if ACPI_APPLICATION is not set.
2677c478bd9Sstevel@tonic-gate  */
2687c478bd9Sstevel@tonic-gate #define DEBUGGER_SINGLE_THREADED    0
2697c478bd9Sstevel@tonic-gate #define DEBUGGER_MULTI_THREADED     1
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate #ifndef DEBUGGER_THREADING
2727c478bd9Sstevel@tonic-gate #ifdef ACPI_APPLICATION
2737c478bd9Sstevel@tonic-gate #define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate #else
2767c478bd9Sstevel@tonic-gate #define DEBUGGER_THREADING          DEBUGGER_MULTI_THREADED
2777c478bd9Sstevel@tonic-gate #endif
2787c478bd9Sstevel@tonic-gate #endif /* !DEBUGGER_THREADING */
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate /******************************************************************************
2827c478bd9Sstevel@tonic-gate  *
2837c478bd9Sstevel@tonic-gate  * C library configuration
2847c478bd9Sstevel@tonic-gate  *
2857c478bd9Sstevel@tonic-gate  *****************************************************************************/
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate #ifdef ACPI_USE_SYSTEM_CLIBRARY
2887c478bd9Sstevel@tonic-gate /*
2897c478bd9Sstevel@tonic-gate  * Use the standard C library headers.
2907c478bd9Sstevel@tonic-gate  * We want to keep these to a minimum.
2917c478bd9Sstevel@tonic-gate  */
2927c478bd9Sstevel@tonic-gate #ifdef ACPI_USE_STANDARD_HEADERS
2937c478bd9Sstevel@tonic-gate /*
2947c478bd9Sstevel@tonic-gate  * Use the standard headers from the standard locations
2957c478bd9Sstevel@tonic-gate  */
2967c478bd9Sstevel@tonic-gate #include <stdarg.h>
2977c478bd9Sstevel@tonic-gate #include <stdlib.h>
2987c478bd9Sstevel@tonic-gate #include <string.h>
2997c478bd9Sstevel@tonic-gate #include <ctype.h>
3007c478bd9Sstevel@tonic-gate 
3017c478bd9Sstevel@tonic-gate #endif /* ACPI_USE_STANDARD_HEADERS */
3027c478bd9Sstevel@tonic-gate 
3037c478bd9Sstevel@tonic-gate /*
3047c478bd9Sstevel@tonic-gate  * We will be linking to the standard Clib functions
3057c478bd9Sstevel@tonic-gate  */
3067c478bd9Sstevel@tonic-gate #define ACPI_STRSTR(s1,s2)      strstr((s1), (s2))
3077c478bd9Sstevel@tonic-gate #define ACPI_STRCHR(s1,c)       strchr((s1), (c))
3087c478bd9Sstevel@tonic-gate #define ACPI_STRLEN(s)          (ACPI_SIZE) strlen((s))
3097c478bd9Sstevel@tonic-gate #define ACPI_STRCPY(d,s)        (void) strcpy((d), (s))
3107c478bd9Sstevel@tonic-gate #define ACPI_STRNCPY(d,s,n)     (void) strncpy((d), (s), (ACPI_SIZE)(n))
3117c478bd9Sstevel@tonic-gate #define ACPI_STRNCMP(d,s,n)     strncmp((d), (s), (ACPI_SIZE)(n))
3127c478bd9Sstevel@tonic-gate #define ACPI_STRCMP(d,s)        strcmp((d), (s))
3137c478bd9Sstevel@tonic-gate #define ACPI_STRCAT(d,s)        (void) strcat((d), (s))
3147c478bd9Sstevel@tonic-gate #define ACPI_STRNCAT(d,s,n)     strncat((d), (s), (ACPI_SIZE)(n))
3157c478bd9Sstevel@tonic-gate #define ACPI_STRTOUL(d,s,n)     strtoul((d), (s), (ACPI_SIZE)(n))
3167c478bd9Sstevel@tonic-gate #define ACPI_MEMCMP(s1,s2,n)    memcmp((s1), (s2), (ACPI_SIZE)(n))
3177c478bd9Sstevel@tonic-gate #define ACPI_MEMCPY(d,s,n)      (void) memcpy((d), (s), (ACPI_SIZE)(n))
3187c478bd9Sstevel@tonic-gate #define ACPI_MEMSET(d,s,n)      (void) memset((d), (s), (ACPI_SIZE)(n))
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate #define ACPI_TOUPPER            toupper
3217c478bd9Sstevel@tonic-gate #define ACPI_TOLOWER            tolower
3227c478bd9Sstevel@tonic-gate #define ACPI_IS_XDIGIT          isxdigit
3237c478bd9Sstevel@tonic-gate #define ACPI_IS_DIGIT           isdigit
3247c478bd9Sstevel@tonic-gate #define ACPI_IS_SPACE           isspace
3257c478bd9Sstevel@tonic-gate #define ACPI_IS_UPPER           isupper
3267c478bd9Sstevel@tonic-gate #define ACPI_IS_PRINT           isprint
3277c478bd9Sstevel@tonic-gate #define ACPI_IS_ALPHA           isalpha
3287c478bd9Sstevel@tonic-gate #define ACPI_IS_ASCII           isascii
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate #else
3317c478bd9Sstevel@tonic-gate 
3327c478bd9Sstevel@tonic-gate /******************************************************************************
3337c478bd9Sstevel@tonic-gate  *
3347c478bd9Sstevel@tonic-gate  * Not using native C library, use local implementations
3357c478bd9Sstevel@tonic-gate  *
3367c478bd9Sstevel@tonic-gate  *****************************************************************************/
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate  /*
3397c478bd9Sstevel@tonic-gate  * Use local definitions of C library macros and functions
3407c478bd9Sstevel@tonic-gate  * NOTE: The function implementations may not be as efficient
3417c478bd9Sstevel@tonic-gate  * as an inline or assembly code implementation provided by a
3427c478bd9Sstevel@tonic-gate  * native C library.
3437c478bd9Sstevel@tonic-gate  */
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate #ifndef va_arg
3467c478bd9Sstevel@tonic-gate 
3477c478bd9Sstevel@tonic-gate #ifndef _VALIST
3487c478bd9Sstevel@tonic-gate #define _VALIST
3497c478bd9Sstevel@tonic-gate typedef char *va_list;
3507c478bd9Sstevel@tonic-gate #endif /* _VALIST */
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate /*
3537c478bd9Sstevel@tonic-gate  * Storage alignment properties
3547c478bd9Sstevel@tonic-gate  */
3557c478bd9Sstevel@tonic-gate #define  _AUPBND                (sizeof (ACPI_NATIVE_INT) - 1)
3567c478bd9Sstevel@tonic-gate #define  _ADNBND                (sizeof (ACPI_NATIVE_INT) - 1)
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate /*
3597c478bd9Sstevel@tonic-gate  * Variable argument list macro definitions
3607c478bd9Sstevel@tonic-gate  */
3617c478bd9Sstevel@tonic-gate #define _Bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
3627c478bd9Sstevel@tonic-gate #define va_arg(ap, T)           (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND))))
3637c478bd9Sstevel@tonic-gate #define va_end(ap)              (void) 0
3647c478bd9Sstevel@tonic-gate #define va_start(ap, A)         (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND))))
3657c478bd9Sstevel@tonic-gate 
3667c478bd9Sstevel@tonic-gate #endif /* va_arg */
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate 
3697c478bd9Sstevel@tonic-gate #define ACPI_STRSTR(s1,s2)      AcpiUtStrstr ((s1), (s2))
3707c478bd9Sstevel@tonic-gate #define ACPI_STRCHR(s1,c)       AcpiUtStrchr ((s1), (c))
3717c478bd9Sstevel@tonic-gate #define ACPI_STRLEN(s)          (ACPI_SIZE) AcpiUtStrlen ((s))
3727c478bd9Sstevel@tonic-gate #define ACPI_STRCPY(d,s)        (void) AcpiUtStrcpy ((d), (s))
3737c478bd9Sstevel@tonic-gate #define ACPI_STRNCPY(d,s,n)     (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n))
3747c478bd9Sstevel@tonic-gate #define ACPI_STRNCMP(d,s,n)     AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n))
3757c478bd9Sstevel@tonic-gate #define ACPI_STRCMP(d,s)        AcpiUtStrcmp ((d), (s))
3767c478bd9Sstevel@tonic-gate #define ACPI_STRCAT(d,s)        (void) AcpiUtStrcat ((d), (s))
3777c478bd9Sstevel@tonic-gate #define ACPI_STRNCAT(d,s,n)     AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n))
3787c478bd9Sstevel@tonic-gate #define ACPI_STRTOUL(d,s,n)     AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n))
3797c478bd9Sstevel@tonic-gate #define ACPI_MEMCMP(s1,s2,n)    AcpiUtMemcmp((s1), (s2), (ACPI_SIZE)(n))
3807c478bd9Sstevel@tonic-gate #define ACPI_MEMCPY(d,s,n)      (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n))
3817c478bd9Sstevel@tonic-gate #define ACPI_MEMSET(d,v,n)      (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n))
3827c478bd9Sstevel@tonic-gate #define ACPI_TOUPPER            AcpiUtToUpper
3837c478bd9Sstevel@tonic-gate #define ACPI_TOLOWER            AcpiUtToLower
3847c478bd9Sstevel@tonic-gate 
3857c478bd9Sstevel@tonic-gate #endif /* ACPI_USE_SYSTEM_CLIBRARY */
3867c478bd9Sstevel@tonic-gate 
3877c478bd9Sstevel@tonic-gate 
3887c478bd9Sstevel@tonic-gate /******************************************************************************
3897c478bd9Sstevel@tonic-gate  *
3907c478bd9Sstevel@tonic-gate  * Assembly code macros
3917c478bd9Sstevel@tonic-gate  *
3927c478bd9Sstevel@tonic-gate  *****************************************************************************/
3937c478bd9Sstevel@tonic-gate 
3947c478bd9Sstevel@tonic-gate /*
3957c478bd9Sstevel@tonic-gate  * Handle platform- and compiler-specific assembly language differences.
3967c478bd9Sstevel@tonic-gate  * These should already have been defined by the platform includes above.
3977c478bd9Sstevel@tonic-gate  *
3987c478bd9Sstevel@tonic-gate  * Notes:
3997c478bd9Sstevel@tonic-gate  * 1) Interrupt 3 is used to break into a debugger
4007c478bd9Sstevel@tonic-gate  * 2) Interrupts are turned off during ACPI register setup
4017c478bd9Sstevel@tonic-gate  */
4027c478bd9Sstevel@tonic-gate 
4037c478bd9Sstevel@tonic-gate /* Unrecognized compiler, use defaults */
4047c478bd9Sstevel@tonic-gate 
4057c478bd9Sstevel@tonic-gate #ifndef ACPI_ASM_MACROS
4067c478bd9Sstevel@tonic-gate 
4077c478bd9Sstevel@tonic-gate /*
4087c478bd9Sstevel@tonic-gate  * Calling conventions:
4097c478bd9Sstevel@tonic-gate  *
4107c478bd9Sstevel@tonic-gate  * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
4117c478bd9Sstevel@tonic-gate  * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
4127c478bd9Sstevel@tonic-gate  * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
4137c478bd9Sstevel@tonic-gate  * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
4147c478bd9Sstevel@tonic-gate  */
4157c478bd9Sstevel@tonic-gate #define ACPI_SYSTEM_XFACE
4167c478bd9Sstevel@tonic-gate #define ACPI_EXTERNAL_XFACE
4177c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_XFACE
4187c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_VAR_XFACE
4197c478bd9Sstevel@tonic-gate 
4207c478bd9Sstevel@tonic-gate #define ACPI_ASM_MACROS
4217c478bd9Sstevel@tonic-gate #define BREAKPOINT3
4227c478bd9Sstevel@tonic-gate #define ACPI_DISABLE_IRQS()
4237c478bd9Sstevel@tonic-gate #define ACPI_ENABLE_IRQS()
4247c478bd9Sstevel@tonic-gate #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)
4257c478bd9Sstevel@tonic-gate #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)
4267c478bd9Sstevel@tonic-gate 
4277c478bd9Sstevel@tonic-gate #endif /* ACPI_ASM_MACROS */
4287c478bd9Sstevel@tonic-gate 
4297c478bd9Sstevel@tonic-gate 
4307c478bd9Sstevel@tonic-gate #ifdef ACPI_APPLICATION
4317c478bd9Sstevel@tonic-gate 
4327c478bd9Sstevel@tonic-gate /* Don't want software interrupts within a ring3 application */
4337c478bd9Sstevel@tonic-gate 
4347c478bd9Sstevel@tonic-gate #undef BREAKPOINT3
4357c478bd9Sstevel@tonic-gate #define BREAKPOINT3
4367c478bd9Sstevel@tonic-gate #endif
4377c478bd9Sstevel@tonic-gate 
4387c478bd9Sstevel@tonic-gate 
4397c478bd9Sstevel@tonic-gate /******************************************************************************
4407c478bd9Sstevel@tonic-gate  *
4417c478bd9Sstevel@tonic-gate  * Compiler-specific information is contained in the compiler-specific
4427c478bd9Sstevel@tonic-gate  * headers.
4437c478bd9Sstevel@tonic-gate  *
4447c478bd9Sstevel@tonic-gate  *****************************************************************************/
4457c478bd9Sstevel@tonic-gate #endif /* __ACENV_H__ */
446