17c478bd9Sstevel@tonic-gate /****************************************************************************** 27c478bd9Sstevel@tonic-gate * 37c478bd9Sstevel@tonic-gate * Name: acenv.h - Generation environment specific items 4*db2bae30SDana Myers * $Revision: 1.133 $ 57c478bd9Sstevel@tonic-gate * 67c478bd9Sstevel@tonic-gate *****************************************************************************/ 77c478bd9Sstevel@tonic-gate 87c478bd9Sstevel@tonic-gate /****************************************************************************** 97c478bd9Sstevel@tonic-gate * 107c478bd9Sstevel@tonic-gate * 1. Copyright Notice 117c478bd9Sstevel@tonic-gate * 12*db2bae30SDana Myers * Some or all of this work - Copyright (c) 1999 - 2008, 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 125450d6964Smyers #ifdef ACPI_LIBRARY 12627f7c583Smyers /* 12727f7c583Smyers * Note: The non-debug version of the AcpiLibrary does not contain any 12827f7c583Smyers * debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG 12927f7c583Smyers */ 130450d6964Smyers #define ACPI_USE_LOCAL_CACHE 131450d6964Smyers #endif 132450d6964Smyers 13327f7c583Smyers #ifdef ACPI_ASL_COMPILER 1347c478bd9Sstevel@tonic-gate #define ACPI_DEBUG_OUTPUT 1357c478bd9Sstevel@tonic-gate #define ACPI_APPLICATION 1367c478bd9Sstevel@tonic-gate #define ACPI_DISASSEMBLER 13727f7c583Smyers #define ACPI_CONSTANT_EVAL_ONLY 13827f7c583Smyers #define ACPI_LARGE_NAMESPACE_NODE 13927f7c583Smyers #define ACPI_DATA_TABLE_DISASSEMBLY 1407c478bd9Sstevel@tonic-gate #endif 1417c478bd9Sstevel@tonic-gate 142450d6964Smyers #ifdef ACPI_EXEC_APP 1437c478bd9Sstevel@tonic-gate #undef DEBUGGER_THREADING 1447c478bd9Sstevel@tonic-gate #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 14527f7c583Smyers #define ACPI_FULL_DEBUG 1467c478bd9Sstevel@tonic-gate #define ACPI_APPLICATION 1477c478bd9Sstevel@tonic-gate #define ACPI_DEBUGGER 148186507a7Smyers #define ACPI_MUTEX_DEBUG 14927f7c583Smyers #define ACPI_DBG_TRACK_ALLOCATIONS 1507c478bd9Sstevel@tonic-gate #endif 1517c478bd9Sstevel@tonic-gate 15227f7c583Smyers #ifdef ACPI_DASM_APP 15327f7c583Smyers #ifndef MSDOS 1547c478bd9Sstevel@tonic-gate #define ACPI_DEBUG_OUTPUT 15527f7c583Smyers #endif 1567c478bd9Sstevel@tonic-gate #define ACPI_APPLICATION 1577c478bd9Sstevel@tonic-gate #define ACPI_DISASSEMBLER 15827f7c583Smyers #define ACPI_NO_METHOD_EXECUTION 15927f7c583Smyers #define ACPI_LARGE_NAMESPACE_NODE 16027f7c583Smyers #define ACPI_DATA_TABLE_DISASSEMBLY 161450d6964Smyers #endif 162450d6964Smyers 163450d6964Smyers #ifdef ACPI_APPLICATION 1647c478bd9Sstevel@tonic-gate #define ACPI_USE_SYSTEM_CLIBRARY 165450d6964Smyers #define ACPI_USE_LOCAL_CACHE 1667c478bd9Sstevel@tonic-gate #endif 1677c478bd9Sstevel@tonic-gate 16827f7c583Smyers #ifdef ACPI_FULL_DEBUG 16927f7c583Smyers #define ACPI_DEBUGGER 17027f7c583Smyers #define ACPI_DEBUG_OUTPUT 17127f7c583Smyers #define ACPI_DISASSEMBLER 17227f7c583Smyers #endif 17327f7c583Smyers 17427f7c583Smyers 1757c478bd9Sstevel@tonic-gate /* 1767c478bd9Sstevel@tonic-gate * Environment configuration. The purpose of this file is to interface to the 1777c478bd9Sstevel@tonic-gate * local generation environment. 1787c478bd9Sstevel@tonic-gate * 1797c478bd9Sstevel@tonic-gate * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. 1807c478bd9Sstevel@tonic-gate * Otherwise, local versions of string/memory functions will be used. 1817c478bd9Sstevel@tonic-gate * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and 1827c478bd9Sstevel@tonic-gate * the standard header files may be used. 1837c478bd9Sstevel@tonic-gate * 1847c478bd9Sstevel@tonic-gate * The ACPI subsystem only uses low level C library functions that do not call 1857c478bd9Sstevel@tonic-gate * operating system services and may therefore be inlined in the code. 1867c478bd9Sstevel@tonic-gate * 1877c478bd9Sstevel@tonic-gate * It may be necessary to tailor these include files to the target 1887c478bd9Sstevel@tonic-gate * generation environment. 1897c478bd9Sstevel@tonic-gate * 1907c478bd9Sstevel@tonic-gate * 1917c478bd9Sstevel@tonic-gate * Functions and constants used from each header: 1927c478bd9Sstevel@tonic-gate * 1937c478bd9Sstevel@tonic-gate * string.h: memcpy 1947c478bd9Sstevel@tonic-gate * memset 1957c478bd9Sstevel@tonic-gate * strcat 1967c478bd9Sstevel@tonic-gate * strcmp 1977c478bd9Sstevel@tonic-gate * strcpy 1987c478bd9Sstevel@tonic-gate * strlen 1997c478bd9Sstevel@tonic-gate * strncmp 2007c478bd9Sstevel@tonic-gate * strncat 2017c478bd9Sstevel@tonic-gate * strncpy 2027c478bd9Sstevel@tonic-gate * 2037c478bd9Sstevel@tonic-gate * stdlib.h: strtoul 2047c478bd9Sstevel@tonic-gate * 2057c478bd9Sstevel@tonic-gate * stdarg.h: va_list 2067c478bd9Sstevel@tonic-gate * va_arg 2077c478bd9Sstevel@tonic-gate * va_start 2087c478bd9Sstevel@tonic-gate * va_end 2097c478bd9Sstevel@tonic-gate * 2107c478bd9Sstevel@tonic-gate */ 2117c478bd9Sstevel@tonic-gate 2127c478bd9Sstevel@tonic-gate /*! [Begin] no source code translation */ 2137c478bd9Sstevel@tonic-gate 214*db2bae30SDana Myers #if defined(_LINUX) || defined(__linux__) 2157c478bd9Sstevel@tonic-gate #include "aclinux.h" 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate #elif defined(_AED_EFI) 2187c478bd9Sstevel@tonic-gate #include "acefi.h" 2197c478bd9Sstevel@tonic-gate 2207c478bd9Sstevel@tonic-gate #elif defined(WIN32) 2217c478bd9Sstevel@tonic-gate #include "acwin.h" 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate #elif defined(WIN64) 2247c478bd9Sstevel@tonic-gate #include "acwin64.h" 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gate #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ 2277c478bd9Sstevel@tonic-gate #include "acdos16.h" 2287c478bd9Sstevel@tonic-gate 22927f7c583Smyers #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 2307c478bd9Sstevel@tonic-gate #include "acfreebsd.h" 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate #elif defined(__NetBSD__) 2337c478bd9Sstevel@tonic-gate #include "acnetbsd.h" 2347c478bd9Sstevel@tonic-gate 2357c478bd9Sstevel@tonic-gate #elif defined(MODESTO) 2367c478bd9Sstevel@tonic-gate #include "acmodesto.h" 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate #elif defined(NETWARE) 2397c478bd9Sstevel@tonic-gate #include "acnetware.h" 2407c478bd9Sstevel@tonic-gate 2417c478bd9Sstevel@tonic-gate #elif defined(__sun) 2427c478bd9Sstevel@tonic-gate #include "acsolaris.h" 2437c478bd9Sstevel@tonic-gate 244*db2bae30SDana Myers #elif defined(__OS2__) 245*db2bae30SDana Myers #include "acos2.h" 246*db2bae30SDana Myers 2477c478bd9Sstevel@tonic-gate #else 2487c478bd9Sstevel@tonic-gate 2497c478bd9Sstevel@tonic-gate /* All other environments */ 2507c478bd9Sstevel@tonic-gate 2517c478bd9Sstevel@tonic-gate #define ACPI_USE_STANDARD_HEADERS 2527c478bd9Sstevel@tonic-gate 2537c478bd9Sstevel@tonic-gate #define COMPILER_DEPENDENT_INT64 long long 2547c478bd9Sstevel@tonic-gate #define COMPILER_DEPENDENT_UINT64 unsigned long long 2557c478bd9Sstevel@tonic-gate 2567c478bd9Sstevel@tonic-gate #endif 2577c478bd9Sstevel@tonic-gate 2587c478bd9Sstevel@tonic-gate /*! [End] no source code translation !*/ 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate 2617c478bd9Sstevel@tonic-gate /* 2627c478bd9Sstevel@tonic-gate * Debugger threading model 2637c478bd9Sstevel@tonic-gate * Use single threaded if the entire subsystem is contained in an application 2647c478bd9Sstevel@tonic-gate * Use multiple threaded when the subsystem is running in the kernel. 2657c478bd9Sstevel@tonic-gate * 2667c478bd9Sstevel@tonic-gate * By default the model is single threaded if ACPI_APPLICATION is set, 2677c478bd9Sstevel@tonic-gate * multi-threaded if ACPI_APPLICATION is not set. 2687c478bd9Sstevel@tonic-gate */ 2697c478bd9Sstevel@tonic-gate #define DEBUGGER_SINGLE_THREADED 0 2707c478bd9Sstevel@tonic-gate #define DEBUGGER_MULTI_THREADED 1 2717c478bd9Sstevel@tonic-gate 2727c478bd9Sstevel@tonic-gate #ifndef DEBUGGER_THREADING 2737c478bd9Sstevel@tonic-gate #ifdef ACPI_APPLICATION 2747c478bd9Sstevel@tonic-gate #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 2757c478bd9Sstevel@tonic-gate 2767c478bd9Sstevel@tonic-gate #else 2777c478bd9Sstevel@tonic-gate #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED 2787c478bd9Sstevel@tonic-gate #endif 2797c478bd9Sstevel@tonic-gate #endif /* !DEBUGGER_THREADING */ 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate 2827c478bd9Sstevel@tonic-gate /****************************************************************************** 2837c478bd9Sstevel@tonic-gate * 2847c478bd9Sstevel@tonic-gate * C library configuration 2857c478bd9Sstevel@tonic-gate * 2867c478bd9Sstevel@tonic-gate *****************************************************************************/ 2877c478bd9Sstevel@tonic-gate 28830082d0cSmyers #define ACPI_IS_ASCII(c) ((c) < 0x80) 28930082d0cSmyers 2907c478bd9Sstevel@tonic-gate #ifdef ACPI_USE_SYSTEM_CLIBRARY 2917c478bd9Sstevel@tonic-gate /* 2927c478bd9Sstevel@tonic-gate * Use the standard C library headers. 2937c478bd9Sstevel@tonic-gate * We want to keep these to a minimum. 2947c478bd9Sstevel@tonic-gate */ 2957c478bd9Sstevel@tonic-gate #ifdef ACPI_USE_STANDARD_HEADERS 2967c478bd9Sstevel@tonic-gate /* 2977c478bd9Sstevel@tonic-gate * Use the standard headers from the standard locations 2987c478bd9Sstevel@tonic-gate */ 2997c478bd9Sstevel@tonic-gate #include <stdarg.h> 3007c478bd9Sstevel@tonic-gate #include <stdlib.h> 3017c478bd9Sstevel@tonic-gate #include <string.h> 3027c478bd9Sstevel@tonic-gate #include <ctype.h> 3037c478bd9Sstevel@tonic-gate 3047c478bd9Sstevel@tonic-gate #endif /* ACPI_USE_STANDARD_HEADERS */ 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate /* 3077c478bd9Sstevel@tonic-gate * We will be linking to the standard Clib functions 3087c478bd9Sstevel@tonic-gate */ 3097c478bd9Sstevel@tonic-gate #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) 3107c478bd9Sstevel@tonic-gate #define ACPI_STRCHR(s1,c) strchr((s1), (c)) 3117c478bd9Sstevel@tonic-gate #define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s)) 3127c478bd9Sstevel@tonic-gate #define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) 3137c478bd9Sstevel@tonic-gate #define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) 3147c478bd9Sstevel@tonic-gate #define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) 3157c478bd9Sstevel@tonic-gate #define ACPI_STRCMP(d,s) strcmp((d), (s)) 3167c478bd9Sstevel@tonic-gate #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) 3177c478bd9Sstevel@tonic-gate #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) 3187c478bd9Sstevel@tonic-gate #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) 31930082d0cSmyers #define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) 3207c478bd9Sstevel@tonic-gate #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) 3217c478bd9Sstevel@tonic-gate #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) 3227c478bd9Sstevel@tonic-gate 323186507a7Smyers #define ACPI_TOUPPER(i) toupper((int) (i)) 324186507a7Smyers #define ACPI_TOLOWER(i) tolower((int) (i)) 325186507a7Smyers #define ACPI_IS_XDIGIT(i) isxdigit((int) (i)) 326186507a7Smyers #define ACPI_IS_DIGIT(i) isdigit((int) (i)) 327186507a7Smyers #define ACPI_IS_SPACE(i) isspace((int) (i)) 328186507a7Smyers #define ACPI_IS_UPPER(i) isupper((int) (i)) 329186507a7Smyers #define ACPI_IS_PRINT(i) isprint((int) (i)) 330186507a7Smyers #define ACPI_IS_ALPHA(i) isalpha((int) (i)) 3317c478bd9Sstevel@tonic-gate 3327c478bd9Sstevel@tonic-gate #else 3337c478bd9Sstevel@tonic-gate 3347c478bd9Sstevel@tonic-gate /****************************************************************************** 3357c478bd9Sstevel@tonic-gate * 3367c478bd9Sstevel@tonic-gate * Not using native C library, use local implementations 3377c478bd9Sstevel@tonic-gate * 3387c478bd9Sstevel@tonic-gate *****************************************************************************/ 3397c478bd9Sstevel@tonic-gate 3407c478bd9Sstevel@tonic-gate /* 3417c478bd9Sstevel@tonic-gate * Use local definitions of C library macros and functions 3427c478bd9Sstevel@tonic-gate * NOTE: The function implementations may not be as efficient 3437c478bd9Sstevel@tonic-gate * as an inline or assembly code implementation provided by a 3447c478bd9Sstevel@tonic-gate * native C library. 3457c478bd9Sstevel@tonic-gate */ 3467c478bd9Sstevel@tonic-gate 3477c478bd9Sstevel@tonic-gate #ifndef va_arg 3487c478bd9Sstevel@tonic-gate 3497c478bd9Sstevel@tonic-gate #ifndef _VALIST 3507c478bd9Sstevel@tonic-gate #define _VALIST 3517c478bd9Sstevel@tonic-gate typedef char *va_list; 3527c478bd9Sstevel@tonic-gate #endif /* _VALIST */ 3537c478bd9Sstevel@tonic-gate 3547c478bd9Sstevel@tonic-gate /* 3557c478bd9Sstevel@tonic-gate * Storage alignment properties 3567c478bd9Sstevel@tonic-gate */ 3577c478bd9Sstevel@tonic-gate #define _AUPBND (sizeof (ACPI_NATIVE_INT) - 1) 3587c478bd9Sstevel@tonic-gate #define _ADNBND (sizeof (ACPI_NATIVE_INT) - 1) 3597c478bd9Sstevel@tonic-gate 3607c478bd9Sstevel@tonic-gate /* 3617c478bd9Sstevel@tonic-gate * Variable argument list macro definitions 3627c478bd9Sstevel@tonic-gate */ 3637c478bd9Sstevel@tonic-gate #define _Bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 3647c478bd9Sstevel@tonic-gate #define va_arg(ap, T) (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND)))) 3657c478bd9Sstevel@tonic-gate #define va_end(ap) (void) 0 3667c478bd9Sstevel@tonic-gate #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND)))) 3677c478bd9Sstevel@tonic-gate 3687c478bd9Sstevel@tonic-gate #endif /* va_arg */ 3697c478bd9Sstevel@tonic-gate 3707c478bd9Sstevel@tonic-gate 3717c478bd9Sstevel@tonic-gate #define ACPI_STRSTR(s1,s2) AcpiUtStrstr ((s1), (s2)) 3727c478bd9Sstevel@tonic-gate #define ACPI_STRCHR(s1,c) AcpiUtStrchr ((s1), (c)) 3737c478bd9Sstevel@tonic-gate #define ACPI_STRLEN(s) (ACPI_SIZE) AcpiUtStrlen ((s)) 3747c478bd9Sstevel@tonic-gate #define ACPI_STRCPY(d,s) (void) AcpiUtStrcpy ((d), (s)) 3757c478bd9Sstevel@tonic-gate #define ACPI_STRNCPY(d,s,n) (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n)) 3767c478bd9Sstevel@tonic-gate #define ACPI_STRNCMP(d,s,n) AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n)) 3777c478bd9Sstevel@tonic-gate #define ACPI_STRCMP(d,s) AcpiUtStrcmp ((d), (s)) 3787c478bd9Sstevel@tonic-gate #define ACPI_STRCAT(d,s) (void) AcpiUtStrcat ((d), (s)) 3797c478bd9Sstevel@tonic-gate #define ACPI_STRNCAT(d,s,n) AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n)) 3807c478bd9Sstevel@tonic-gate #define ACPI_STRTOUL(d,s,n) AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n)) 38130082d0cSmyers #define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) 3827c478bd9Sstevel@tonic-gate #define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n)) 3837c478bd9Sstevel@tonic-gate #define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n)) 3847c478bd9Sstevel@tonic-gate #define ACPI_TOUPPER AcpiUtToUpper 3857c478bd9Sstevel@tonic-gate #define ACPI_TOLOWER AcpiUtToLower 3867c478bd9Sstevel@tonic-gate 3877c478bd9Sstevel@tonic-gate #endif /* ACPI_USE_SYSTEM_CLIBRARY */ 3887c478bd9Sstevel@tonic-gate 3897c478bd9Sstevel@tonic-gate 3907c478bd9Sstevel@tonic-gate /****************************************************************************** 3917c478bd9Sstevel@tonic-gate * 3927c478bd9Sstevel@tonic-gate * Assembly code macros 3937c478bd9Sstevel@tonic-gate * 3947c478bd9Sstevel@tonic-gate *****************************************************************************/ 3957c478bd9Sstevel@tonic-gate 3967c478bd9Sstevel@tonic-gate /* 3977c478bd9Sstevel@tonic-gate * Handle platform- and compiler-specific assembly language differences. 3987c478bd9Sstevel@tonic-gate * These should already have been defined by the platform includes above. 3997c478bd9Sstevel@tonic-gate * 4007c478bd9Sstevel@tonic-gate * Notes: 4017c478bd9Sstevel@tonic-gate * 1) Interrupt 3 is used to break into a debugger 4027c478bd9Sstevel@tonic-gate * 2) Interrupts are turned off during ACPI register setup 4037c478bd9Sstevel@tonic-gate */ 4047c478bd9Sstevel@tonic-gate 4057c478bd9Sstevel@tonic-gate /* Unrecognized compiler, use defaults */ 4067c478bd9Sstevel@tonic-gate 4077c478bd9Sstevel@tonic-gate #ifndef ACPI_ASM_MACROS 4087c478bd9Sstevel@tonic-gate 4097c478bd9Sstevel@tonic-gate /* 4107c478bd9Sstevel@tonic-gate * Calling conventions: 4117c478bd9Sstevel@tonic-gate * 4127c478bd9Sstevel@tonic-gate * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 4137c478bd9Sstevel@tonic-gate * ACPI_EXTERNAL_XFACE - External ACPI interfaces 4147c478bd9Sstevel@tonic-gate * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 4157c478bd9Sstevel@tonic-gate * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 4167c478bd9Sstevel@tonic-gate */ 4177c478bd9Sstevel@tonic-gate #define ACPI_SYSTEM_XFACE 4187c478bd9Sstevel@tonic-gate #define ACPI_EXTERNAL_XFACE 4197c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_XFACE 4207c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_VAR_XFACE 4217c478bd9Sstevel@tonic-gate 4227c478bd9Sstevel@tonic-gate #define ACPI_ASM_MACROS 4237c478bd9Sstevel@tonic-gate #define BREAKPOINT3 4247c478bd9Sstevel@tonic-gate #define ACPI_DISABLE_IRQS() 4257c478bd9Sstevel@tonic-gate #define ACPI_ENABLE_IRQS() 4267c478bd9Sstevel@tonic-gate #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) 4277c478bd9Sstevel@tonic-gate #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) 4287c478bd9Sstevel@tonic-gate 4297c478bd9Sstevel@tonic-gate #endif /* ACPI_ASM_MACROS */ 4307c478bd9Sstevel@tonic-gate 4317c478bd9Sstevel@tonic-gate 4327c478bd9Sstevel@tonic-gate #ifdef ACPI_APPLICATION 4337c478bd9Sstevel@tonic-gate 4347c478bd9Sstevel@tonic-gate /* Don't want software interrupts within a ring3 application */ 4357c478bd9Sstevel@tonic-gate 4367c478bd9Sstevel@tonic-gate #undef BREAKPOINT3 4377c478bd9Sstevel@tonic-gate #define BREAKPOINT3 4387c478bd9Sstevel@tonic-gate #endif 4397c478bd9Sstevel@tonic-gate 4407c478bd9Sstevel@tonic-gate 4417c478bd9Sstevel@tonic-gate /****************************************************************************** 4427c478bd9Sstevel@tonic-gate * 4437c478bd9Sstevel@tonic-gate * Compiler-specific information is contained in the compiler-specific 4447c478bd9Sstevel@tonic-gate * headers. 4457c478bd9Sstevel@tonic-gate * 4467c478bd9Sstevel@tonic-gate *****************************************************************************/ 4477c478bd9Sstevel@tonic-gate #endif /* __ACENV_H__ */ 448