Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenacenv.h
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * 00003 * Name: acenv.h - Host and compiler configuration 00004 * 00005 *****************************************************************************/ 00006 00007 /****************************************************************************** 00008 * 00009 * 1. Copyright Notice 00010 * 00011 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. 00012 * All rights reserved. 00013 * 00014 * 2. License 00015 * 00016 * 2.1. This is your license from Intel Corp. under its intellectual property 00017 * rights. You may have additional license terms from the party that provided 00018 * you this software, covering your right to use that party's intellectual 00019 * property rights. 00020 * 00021 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 00022 * copy of the source code appearing in this file ("Covered Code") an 00023 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 00024 * base code distributed originally by Intel ("Original Intel Code") to copy, 00025 * make derivatives, distribute, use and display any portion of the Covered 00026 * Code in any form, with the right to sublicense such rights; and 00027 * 00028 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 00029 * license (with the right to sublicense), under only those claims of Intel 00030 * patents that are infringed by the Original Intel Code, to make, use, sell, 00031 * offer to sell, and import the Covered Code and derivative works thereof 00032 * solely to the minimum extent necessary to exercise the above copyright 00033 * license, and in no event shall the patent license extend to any additions 00034 * to or modifications of the Original Intel Code. No other license or right 00035 * is granted directly or by implication, estoppel or otherwise; 00036 * 00037 * The above copyright and patent license is granted only if the following 00038 * conditions are met: 00039 * 00040 * 3. Conditions 00041 * 00042 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 00043 * Redistribution of source code of any substantial portion of the Covered 00044 * Code or modification with rights to further distribute source must include 00045 * the above Copyright Notice, the above License, this list of Conditions, 00046 * and the following Disclaimer and Export Compliance provision. In addition, 00047 * Licensee must cause all Covered Code to which Licensee contributes to 00048 * contain a file documenting the changes Licensee made to create that Covered 00049 * Code and the date of any change. Licensee must include in that file the 00050 * documentation of any changes made by any predecessor Licensee. Licensee 00051 * must include a prominent statement that the modification is derived, 00052 * directly or indirectly, from Original Intel Code. 00053 * 00054 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 00055 * Redistribution of source code of any substantial portion of the Covered 00056 * Code or modification without rights to further distribute source must 00057 * include the following Disclaimer and Export Compliance provision in the 00058 * documentation and/or other materials provided with distribution. In 00059 * addition, Licensee may not authorize further sublicense of source of any 00060 * portion of the Covered Code, and must include terms to the effect that the 00061 * license from Licensee to its licensee is limited to the intellectual 00062 * property embodied in the software Licensee provides to its licensee, and 00063 * not to intellectual property embodied in modifications its licensee may 00064 * make. 00065 * 00066 * 3.3. Redistribution of Executable. Redistribution in executable form of any 00067 * substantial portion of the Covered Code or modification must reproduce the 00068 * above Copyright Notice, and the following Disclaimer and Export Compliance 00069 * provision in the documentation and/or other materials provided with the 00070 * distribution. 00071 * 00072 * 3.4. Intel retains all right, title, and interest in and to the Original 00073 * Intel Code. 00074 * 00075 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 00076 * Intel shall be used in advertising or otherwise to promote the sale, use or 00077 * other dealings in products derived from or relating to the Covered Code 00078 * without prior written authorization from Intel. 00079 * 00080 * 4. Disclaimer and Export Compliance 00081 * 00082 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 00083 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 00084 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 00085 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 00086 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 00087 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 00088 * PARTICULAR PURPOSE. 00089 * 00090 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 00091 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 00092 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 00093 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 00094 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 00095 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 00096 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 00097 * LIMITED REMEDY. 00098 * 00099 * 4.3. Licensee shall not export, either directly or indirectly, any of this 00100 * software or system incorporating such software without first obtaining any 00101 * required license or other approval from the U. S. Department of Commerce or 00102 * any other agency or department of the United States Government. In the 00103 * event Licensee exports any such software from the United States or 00104 * re-exports any such software from a foreign destination, Licensee shall 00105 * ensure that the distribution and export/re-export of the software is in 00106 * compliance with all laws, regulations, orders, or other restrictions of the 00107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 00108 * any of its subsidiaries will export/re-export any technical data, process, 00109 * software, or service, directly or indirectly, to any country for which the 00110 * United States government or any agency thereof requires an export license, 00111 * other governmental approval, or letter of assurance, without first obtaining 00112 * such license, approval or letter. 00113 * 00114 *****************************************************************************/ 00115 00116 #ifndef __ACENV_H__ 00117 #define __ACENV_H__ 00118 00119 /* 00120 * Environment configuration. The purpose of this file is to interface ACPICA 00121 * to the local environment. This includes compiler-specific, OS-specific, 00122 * and machine-specific configuration. 00123 */ 00124 00125 /* Types for ACPI_MUTEX_TYPE */ 00126 00127 #define ACPI_BINARY_SEMAPHORE 0 00128 #define ACPI_OSL_MUTEX 1 00129 00130 /* Types for DEBUGGER_THREADING */ 00131 00132 #define DEBUGGER_SINGLE_THREADED 0 00133 #define DEBUGGER_MULTI_THREADED 1 00134 00135 00136 /****************************************************************************** 00137 * 00138 * Configuration for ACPI tools and utilities 00139 * 00140 *****************************************************************************/ 00141 00142 /* iASL configuration */ 00143 00144 #ifdef ACPI_ASL_COMPILER 00145 #define ACPI_APPLICATION 00146 #define ACPI_DISASSEMBLER 00147 #define ACPI_DEBUG_OUTPUT 00148 #define ACPI_CONSTANT_EVAL_ONLY 00149 #define ACPI_LARGE_NAMESPACE_NODE 00150 #define ACPI_DATA_TABLE_DISASSEMBLY 00151 #define ACPI_SINGLE_THREADED 00152 #endif 00153 00154 /* AcpiExec configuration. Multithreaded with full AML debugger */ 00155 00156 #ifdef ACPI_EXEC_APP 00157 #define ACPI_APPLICATION 00158 #define ACPI_FULL_DEBUG 00159 #define ACPI_MUTEX_DEBUG 00160 #define ACPI_DBG_TRACK_ALLOCATIONS 00161 #endif 00162 00163 /* AcpiNames configuration. Single threaded with debugger output enabled. */ 00164 00165 #ifdef ACPI_NAMES_APP 00166 #define ACPI_DEBUGGER 00167 #define ACPI_APPLICATION 00168 #define ACPI_SINGLE_THREADED 00169 #endif 00170 00171 /* 00172 * AcpiBin/AcpiHelp/AcpiSrc configuration. All single threaded, with 00173 * no debug output. 00174 */ 00175 #if (defined ACPI_BIN_APP) || \ 00176 (defined ACPI_SRC_APP) || \ 00177 (defined ACPI_XTRACT_APP) 00178 #define ACPI_APPLICATION 00179 #define ACPI_SINGLE_THREADED 00180 #endif 00181 00182 #ifdef ACPI_HELP_APP 00183 #define ACPI_DEBUG_OUTPUT 00184 #define ACPI_APPLICATION 00185 #define ACPI_SINGLE_THREADED 00186 #endif 00187 00188 /* Linkable ACPICA library */ 00189 00190 #ifdef ACPI_LIBRARY 00191 #define ACPI_USE_LOCAL_CACHE 00192 #endif 00193 00194 /* Common for all ACPICA applications */ 00195 00196 #ifdef ACPI_APPLICATION 00197 #define ACPI_USE_SYSTEM_CLIBRARY 00198 #define ACPI_USE_LOCAL_CACHE 00199 #endif 00200 00201 /* Common debug support */ 00202 00203 #ifdef ACPI_FULL_DEBUG 00204 #define ACPI_DEBUGGER 00205 #define ACPI_DEBUG_OUTPUT 00206 #define ACPI_DISASSEMBLER 00207 #endif 00208 00209 00212 /****************************************************************************** 00213 * 00214 * Host configuration files. The compiler configuration files are included 00215 * by the host files. 00216 * 00217 *****************************************************************************/ 00218 00219 #if defined(_LINUX) || defined(__linux__) 00220 #include "aclinux.h" 00221 00222 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 00223 #include "acfreebsd.h" 00224 00225 #elif defined(__NetBSD__) 00226 #include "acnetbsd.h" 00227 00228 #elif defined(__sun) 00229 #include "acsolaris.h" 00230 00231 #elif defined(MODESTO) 00232 #include "acmodesto.h" 00233 00234 #elif defined(NETWARE) 00235 #include "acnetware.h" 00236 00237 #elif defined(_CYGWIN) 00238 #include "accygwin.h" 00239 00240 #elif defined(WIN32) 00241 #include "acwin.h" 00242 00243 #elif defined(WIN64) 00244 #include "acwin64.h" 00245 00246 #elif defined(_WRS_LIB_BUILD) 00247 #include "acvxworks.h" 00248 00249 #elif defined(__OS2__) 00250 #include "acos2.h" 00251 00252 #elif defined(_AED_EFI) 00253 #include "acefi.h" 00254 00255 #else 00256 00257 /* Unknown environment */ 00258 00259 #error Unknown target environment 00260 #endif 00261 00265 /****************************************************************************** 00266 * 00267 * Setup defaults for the required symbols that were not defined in one of 00268 * the host/compiler files above. 00269 * 00270 *****************************************************************************/ 00271 00272 /* 64-bit data types */ 00273 00274 #ifndef COMPILER_DEPENDENT_INT64 00275 #define COMPILER_DEPENDENT_INT64 long long 00276 #endif 00277 00278 #ifndef COMPILER_DEPENDENT_UINT64 00279 #define COMPILER_DEPENDENT_UINT64 unsigned long long 00280 #endif 00281 00282 /* Type of mutex supported by host. Default is binary semaphores. */ 00283 00284 #ifndef ACPI_MUTEX_TYPE 00285 #define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX 00286 #endif 00287 00288 /* Global Lock acquire/release */ 00289 00290 #ifndef ACPI_ACQUIRE_GLOBAL_LOCK 00291 #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = 1 00292 #endif 00293 00294 #ifndef ACPI_RELEASE_GLOBAL_LOCK 00295 #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0 00296 #endif 00297 00298 /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ 00299 00300 #ifndef ACPI_FLUSH_CPU_CACHE 00301 #define ACPI_FLUSH_CPU_CACHE() 00302 #endif 00303 00304 /* "inline" keywords - configurable since inline is not standardized */ 00305 00306 #ifndef ACPI_INLINE 00307 #define ACPI_INLINE 00308 #endif 00309 00310 /* 00311 * Configurable calling conventions: 00312 * 00313 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 00314 * ACPI_EXTERNAL_XFACE - External ACPI interfaces 00315 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 00316 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 00317 */ 00318 #ifndef ACPI_SYSTEM_XFACE 00319 #define ACPI_SYSTEM_XFACE 00320 #endif 00321 00322 #ifndef ACPI_EXTERNAL_XFACE 00323 #define ACPI_EXTERNAL_XFACE 00324 #endif 00325 00326 #ifndef ACPI_INTERNAL_XFACE 00327 #define ACPI_INTERNAL_XFACE 00328 #endif 00329 00330 #ifndef ACPI_INTERNAL_VAR_XFACE 00331 #define ACPI_INTERNAL_VAR_XFACE 00332 #endif 00333 00334 /* 00335 * Debugger threading model 00336 * Use single threaded if the entire subsystem is contained in an application 00337 * Use multiple threaded when the subsystem is running in the kernel. 00338 * 00339 * By default the model is single threaded if ACPI_APPLICATION is set, 00340 * multi-threaded if ACPI_APPLICATION is not set. 00341 */ 00342 #ifndef DEBUGGER_THREADING 00343 #ifdef ACPI_APPLICATION 00344 #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 00345 00346 #else 00347 #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED 00348 #endif 00349 #endif /* !DEBUGGER_THREADING */ 00350 00351 00352 /****************************************************************************** 00353 * 00354 * C library configuration 00355 * 00356 *****************************************************************************/ 00357 00358 /* 00359 * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. 00360 * Otherwise, local versions of string/memory functions will be used. 00361 * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and 00362 * the standard header files may be used. 00363 * 00364 * The ACPICA subsystem only uses low level C library functions that do not call 00365 * operating system services and may therefore be inlined in the code. 00366 * 00367 * It may be necessary to tailor these include files to the target 00368 * generation environment. 00369 */ 00370 #ifdef ACPI_USE_SYSTEM_CLIBRARY 00371 00372 /* Use the standard C library headers. We want to keep these to a minimum */ 00373 00374 #ifdef ACPI_USE_STANDARD_HEADERS 00375 00376 /* Use the standard headers from the standard locations */ 00377 00378 #include <stdarg.h> 00379 #include <stdlib.h> 00380 #include <string.h> 00381 #include <ctype.h> 00382 00383 #endif /* ACPI_USE_STANDARD_HEADERS */ 00384 00385 /* We will be linking to the standard Clib functions */ 00386 00387 #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) 00388 #define ACPI_STRCHR(s1,c) strchr((s1), (c)) 00389 #define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s)) 00390 #define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) 00391 #define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) 00392 #define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) 00393 #define ACPI_STRCMP(d,s) strcmp((d), (s)) 00394 #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) 00395 #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) 00396 #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) 00397 #define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) 00398 #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) 00399 #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) 00400 #define ACPI_TOUPPER(i) toupper((int) (i)) 00401 #define ACPI_TOLOWER(i) tolower((int) (i)) 00402 #define ACPI_IS_XDIGIT(i) isxdigit((int) (i)) 00403 #define ACPI_IS_DIGIT(i) isdigit((int) (i)) 00404 #define ACPI_IS_SPACE(i) isspace((int) (i)) 00405 #define ACPI_IS_UPPER(i) isupper((int) (i)) 00406 #define ACPI_IS_PRINT(i) isprint((int) (i)) 00407 #define ACPI_IS_ALPHA(i) isalpha((int) (i)) 00408 00409 #else 00410 00411 /****************************************************************************** 00412 * 00413 * Not using native C library, use local implementations 00414 * 00415 *****************************************************************************/ 00416 00417 /* 00418 * Use local definitions of C library macros and functions. These function 00419 * implementations may not be as efficient as an inline or assembly code 00420 * implementation provided by a native C library, but they are functionally 00421 * equivalent. 00422 */ 00423 #ifndef va_arg 00424 00425 #ifndef _VALIST 00426 #define _VALIST 00427 typedef char *va_list; 00428 #endif /* _VALIST */ 00429 00430 /* Storage alignment properties */ 00431 00432 #define _AUPBND (sizeof (ACPI_NATIVE_INT) - 1) 00433 #define _ADNBND (sizeof (ACPI_NATIVE_INT) - 1) 00434 00435 /* Variable argument list macro definitions */ 00436 00437 #define _Bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 00438 #define va_arg(ap, T) (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND)))) 00439 #define va_end(ap) (void) 0 00440 #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND)))) 00441 00442 #endif /* va_arg */ 00443 00444 /* Use the local (ACPICA) definitions of the clib functions */ 00445 00446 #define ACPI_STRSTR(s1,s2) AcpiUtStrstr ((s1), (s2)) 00447 #define ACPI_STRCHR(s1,c) AcpiUtStrchr ((s1), (c)) 00448 #define ACPI_STRLEN(s) (ACPI_SIZE) AcpiUtStrlen ((s)) 00449 #define ACPI_STRCPY(d,s) (void) AcpiUtStrcpy ((d), (s)) 00450 #define ACPI_STRNCPY(d,s,n) (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n)) 00451 #define ACPI_STRNCMP(d,s,n) AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n)) 00452 #define ACPI_STRCMP(d,s) AcpiUtStrcmp ((d), (s)) 00453 #define ACPI_STRCAT(d,s) (void) AcpiUtStrcat ((d), (s)) 00454 #define ACPI_STRNCAT(d,s,n) AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n)) 00455 #define ACPI_STRTOUL(d,s,n) AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n)) 00456 #define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) 00457 #define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n)) 00458 #define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n)) 00459 #define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c)) 00460 #define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c)) 00461 00462 #endif /* ACPI_USE_SYSTEM_CLIBRARY */ 00463 00464 #endif /* __ACENV_H__ */ Generated on Mon May 28 2012 04:27:07 for ReactOS by
1.7.6.1
|