Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/drivers/acpi/platform/acenv.h need to be fixed.

0001 /******************************************************************************
0002  *
0003  * Name: acenv.h - Host and compiler configuration
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights.  You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code.  No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision.  In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change.  Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee.  Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution.  In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government.  In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************/
0115 
0116 #ifndef __ACENV_H__
0117 #define __ACENV_H__
0118 
0119 /*
0120  * Environment configuration. The purpose of this file is to interface ACPICA
0121  * to the local environment. This includes compiler-specific, OS-specific,
0122  * and machine-specific configuration.
0123  */
0124 
0125 /* Types for ACPI_MUTEX_TYPE */
0126 
0127 #define ACPI_BINARY_SEMAPHORE       0
0128 #define ACPI_OSL_MUTEX              1
0129 
0130 /* Types for DEBUGGER_THREADING */
0131 
0132 #define DEBUGGER_SINGLE_THREADED    0
0133 #define DEBUGGER_MULTI_THREADED     1
0134 
0135 
0136 /******************************************************************************
0137  *
0138  * Configuration for ACPI tools and utilities
0139  *
0140  *****************************************************************************/
0141 
0142 /* iASL configuration */
0143 
0144 #ifdef ACPI_ASL_COMPILER
0145 #define ACPI_APPLICATION
0146 #define ACPI_DISASSEMBLER
0147 #define ACPI_DEBUG_OUTPUT
0148 #define ACPI_CONSTANT_EVAL_ONLY
0149 #define ACPI_LARGE_NAMESPACE_NODE
0150 #define ACPI_DATA_TABLE_DISASSEMBLY
0151 #endif
0152 
0153 /* AcpiExec configuration */
0154 
0155 #ifdef ACPI_EXEC_APP
0156 #define ACPI_APPLICATION
0157 #define ACPI_FULL_DEBUG
0158 #define ACPI_MUTEX_DEBUG
0159 #define ACPI_DBG_TRACK_ALLOCATIONS
0160 #endif
0161 
0162 /* Linkable ACPICA library */
0163 
0164 #ifdef ACPI_LIBRARY
0165 #define ACPI_USE_LOCAL_CACHE
0166 #endif
0167 
0168 /* Common for all ACPICA applications */
0169 
0170 #ifdef ACPI_APPLICATION
0171 #define ACPI_USE_SYSTEM_CLIBRARY
0172 #define ACPI_USE_LOCAL_CACHE
0173 #endif
0174 
0175 /* Common debug support */
0176 
0177 #ifdef ACPI_FULL_DEBUG
0178 #define ACPI_DEBUGGER
0179 #define ACPI_DEBUG_OUTPUT
0180 #define ACPI_DISASSEMBLER
0181 #endif
0182 
0183 
0184 /*! [Begin] no source code translation */
0185 
0186 /******************************************************************************
0187  *
0188  * Host configuration files. The compiler configuration files are included
0189  * by the host files.
0190  *
0191  *****************************************************************************/
0192 
0193 #if defined(_QUEST)
0194 #include "acquest.h"
0195 
0196 #elif defined(_LINUX) || defined(__linux__)
0197 #include "aclinux.h"
0198 
0199 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
0200 #include "acfreebsd.h"
0201 
0202 #elif defined(__NetBSD__)
0203 #include "acnetbsd.h"
0204 
0205 #elif defined(__sun)
0206 #include "acsolaris.h"
0207 
0208 #elif defined(MODESTO)
0209 #include "acmodesto.h"
0210 
0211 #elif defined(NETWARE)
0212 #include "acnetware.h"
0213 
0214 #elif defined(_CYGWIN)
0215 #include "accygwin.h"
0216 
0217 #elif defined(WIN32)
0218 #include "acwin.h"
0219 
0220 #elif defined(WIN64)
0221 #include "acwin64.h"
0222 
0223 #elif defined(_WRS_LIB_BUILD)
0224 #include "acvxworks.h"
0225 
0226 #elif defined(__OS2__)
0227 #include "acos2.h"
0228 
0229 #elif defined(_AED_EFI)
0230 #include "acefi.h"
0231 
0232 #else
0233 
0234 /* Unknown environment */
0235 
0236 #error Unknown target environment
0237 #endif
0238 
0239 /*! [End] no source code translation !*/
0240 
0241 
0242 /******************************************************************************
0243  *
0244  * Setup defaults for the required symbols that were not defined in one of
0245  * the host/compiler files above.
0246  *
0247  *****************************************************************************/
0248 
0249 /* 64-bit data types */
0250 
0251 #ifndef COMPILER_DEPENDENT_INT64
0252 #define COMPILER_DEPENDENT_INT64   long long
0253 #endif
0254 
0255 #ifndef COMPILER_DEPENDENT_UINT64
0256 #define COMPILER_DEPENDENT_UINT64  unsigned long long
0257 #endif
0258 
0259 /* Type of mutex supported by host. Default is binary semaphores. */
0260 
0261 #ifndef ACPI_MUTEX_TYPE
0262 #define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
0263 #endif
0264 
0265 /* Global Lock acquire/release */
0266 
0267 #ifndef ACPI_ACQUIRE_GLOBAL_LOCK
0268 #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) Acq = 1
0269 #endif
0270 
0271 #ifndef ACPI_RELEASE_GLOBAL_LOCK
0272 #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) Acq = 0
0273 #endif
0274 
0275 /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
0276 
0277 #ifndef ACPI_FLUSH_CPU_CACHE
0278 #define ACPI_FLUSH_CPU_CACHE()
0279 #endif
0280 
0281 /*
0282  * Configurable calling conventions:
0283  *
0284  * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
0285  * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
0286  * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
0287  * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
0288  */
0289 #ifndef ACPI_SYSTEM_XFACE
0290 #define ACPI_SYSTEM_XFACE
0291 #endif
0292 
0293 #ifndef ACPI_EXTERNAL_XFACE
0294 #define ACPI_EXTERNAL_XFACE
0295 #endif
0296 
0297 #ifndef ACPI_INTERNAL_XFACE
0298 #define ACPI_INTERNAL_XFACE
0299 #endif
0300 
0301 #ifndef ACPI_INTERNAL_VAR_XFACE
0302 #define ACPI_INTERNAL_VAR_XFACE
0303 #endif
0304 
0305 /*
0306  * Debugger threading model
0307  * Use single threaded if the entire subsystem is contained in an application
0308  * Use multiple threaded when the subsystem is running in the kernel.
0309  *
0310  * By default the model is single threaded if ACPI_APPLICATION is set,
0311  * multi-threaded if ACPI_APPLICATION is not set.
0312  */
0313 #ifndef DEBUGGER_THREADING
0314 #ifdef ACPI_APPLICATION
0315 #define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
0316 
0317 #else
0318 #define DEBUGGER_THREADING          DEBUGGER_MULTI_THREADED
0319 #endif
0320 #endif /* !DEBUGGER_THREADING */
0321 
0322 
0323 /******************************************************************************
0324  *
0325  * C library configuration
0326  *
0327  *****************************************************************************/
0328 
0329 /*
0330  * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
0331  *      Otherwise, local versions of string/memory functions will be used.
0332  * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
0333  *      the standard header files may be used.
0334  *
0335  * The ACPICA subsystem only uses low level C library functions that do not call
0336  * operating system services and may therefore be inlined in the code.
0337  *
0338  * It may be necessary to tailor these include files to the target
0339  * generation environment.
0340  */
0341 #ifdef ACPI_USE_SYSTEM_CLIBRARY
0342 
0343 /* Use the standard C library headers. We want to keep these to a minimum */
0344 
0345 #ifdef ACPI_USE_STANDARD_HEADERS
0346 
0347 /* Use the standard headers from the standard locations */
0348 
0349 #include <stdarg.h>
0350 #include <stdlib.h>
0351 #include <string.h>
0352 #include <ctype.h>
0353 
0354 #endif /* ACPI_USE_STANDARD_HEADERS */
0355 
0356 /* We will be linking to the standard Clib functions */
0357 
0358 #define ACPI_STRSTR(s1,s2)      strstr((s1), (s2))
0359 #define ACPI_STRCHR(s1,c)       strchr((s1), (c))
0360 #define ACPI_STRLEN(s)          (ACPI_SIZE) strlen((s))
0361 #define ACPI_STRCPY(d,s)        (void) strcpy((d), (s))
0362 #define ACPI_STRNCPY(d,s,n)     (void) strncpy((d), (s), (ACPI_SIZE)(n))
0363 #define ACPI_STRNCMP(d,s,n)     strncmp((d), (s), (ACPI_SIZE)(n))
0364 #define ACPI_STRCMP(d,s)        strcmp((d), (s))
0365 #define ACPI_STRCAT(d,s)        (void) strcat((d), (s))
0366 #define ACPI_STRNCAT(d,s,n)     strncat((d), (s), (ACPI_SIZE)(n))
0367 #define ACPI_STRTOUL(d,s,n)     strtoul((d), (s), (ACPI_SIZE)(n))
0368 #define ACPI_MEMCMP(s1,s2,n)    memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n))
0369 #define ACPI_MEMCPY(d,s,n)      (void) memcpy((d), (s), (ACPI_SIZE)(n))
0370 #define ACPI_MEMSET(d,s,n)      (void) memset((d), (s), (ACPI_SIZE)(n))
0371 #define ACPI_TOUPPER(i)         toupper((int) (i))
0372 #define ACPI_TOLOWER(i)         tolower((int) (i))
0373 #define ACPI_IS_XDIGIT(i)       isxdigit((int) (i))
0374 #define ACPI_IS_DIGIT(i)        isdigit((int) (i))
0375 #define ACPI_IS_SPACE(i)        isspace((int) (i))
0376 #define ACPI_IS_UPPER(i)        isupper((int) (i))
0377 #define ACPI_IS_PRINT(i)        isprint((int) (i))
0378 #define ACPI_IS_ALPHA(i)        isalpha((int) (i))
0379 
0380 #else
0381 
0382 /******************************************************************************
0383  *
0384  * Not using native C library, use local implementations
0385  *
0386  *****************************************************************************/
0387 
0388 /*
0389  * Use local definitions of C library macros and functions. These function
0390  * implementations may not be as efficient as an inline or assembly code
0391  * implementation provided by a native C library, but they are functionally
0392  * equivalent.
0393  */
0394 #ifndef va_arg
0395 
0396 #ifndef _VALIST
0397 #define _VALIST
0398 typedef char *va_list;
0399 #endif /* _VALIST */
0400 
0401 /* Storage alignment properties */
0402 
0403 #define  _AUPBND                (sizeof (ACPI_NATIVE_INT) - 1)
0404 #define  _ADNBND                (sizeof (ACPI_NATIVE_INT) - 1)
0405 
0406 /* Variable argument list macro definitions */
0407 
0408 #define _Bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
0409 #define va_arg(ap, T)           (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND))))
0410 #define va_end(ap)              (void) 0
0411 #define va_start(ap, A)         (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND))))
0412 
0413 #endif /* va_arg */
0414 
0415 /* Use the local (ACPICA) definitions of the clib functions */
0416 
0417 #define ACPI_STRSTR(s1,s2)      AcpiUtStrstr ((s1), (s2))
0418 #define ACPI_STRCHR(s1,c)       AcpiUtStrchr ((s1), (c))
0419 #define ACPI_STRLEN(s)          (ACPI_SIZE) AcpiUtStrlen ((s))
0420 #define ACPI_STRCPY(d,s)        (void) AcpiUtStrcpy ((d), (s))
0421 #define ACPI_STRNCPY(d,s,n)     (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n))
0422 #define ACPI_STRNCMP(d,s,n)     AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n))
0423 #define ACPI_STRCMP(d,s)        AcpiUtStrcmp ((d), (s))
0424 #define ACPI_STRCAT(d,s)        (void) AcpiUtStrcat ((d), (s))
0425 #define ACPI_STRNCAT(d,s,n)     AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n))
0426 #define ACPI_STRTOUL(d,s,n)     AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n))
0427 #define ACPI_MEMCMP(s1,s2,n)    AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n))
0428 #define ACPI_MEMCPY(d,s,n)      (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n))
0429 #define ACPI_MEMSET(d,v,n)      (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n))
0430 #define ACPI_TOUPPER            AcpiUtToUpper
0431 #define ACPI_TOLOWER            AcpiUtToLower
0432 
0433 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
0434 
0435 #endif /* __ACENV_H__ */