0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __ACENV_H__
0011 #define __ACENV_H__
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #define ACPI_BINARY_SEMAPHORE 0
0022 #define ACPI_OSL_MUTEX 1
0023
0024
0025
0026 #define DEBUGGER_SINGLE_THREADED 0
0027 #define DEBUGGER_MULTI_THREADED 1
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #if (defined ACPI_ASL_COMPILER) || \
0038 (defined ACPI_BIN_APP) || \
0039 (defined ACPI_DUMP_APP) || \
0040 (defined ACPI_HELP_APP) || \
0041 (defined ACPI_NAMES_APP) || \
0042 (defined ACPI_SRC_APP) || \
0043 (defined ACPI_XTRACT_APP) || \
0044 (defined ACPI_EXAMPLE_APP) || \
0045 (defined ACPI_EFI_HELLO)
0046 #define ACPI_APPLICATION
0047 #define ACPI_SINGLE_THREADED
0048 #define USE_NATIVE_ALLOCATE_ZEROED
0049 #endif
0050
0051
0052
0053 #ifdef ACPI_ASL_COMPILER
0054 #define ACPI_DEBUG_OUTPUT
0055 #define ACPI_CONSTANT_EVAL_ONLY
0056 #define ACPI_LARGE_NAMESPACE_NODE
0057 #define ACPI_DATA_TABLE_DISASSEMBLY
0058 #define ACPI_32BIT_PHYSICAL_ADDRESS
0059 #define ACPI_DISASSEMBLER 1
0060 #endif
0061
0062
0063
0064 #ifdef ACPI_EXEC_APP
0065 #define ACPI_APPLICATION
0066 #define ACPI_FULL_DEBUG
0067 #define ACPI_MUTEX_DEBUG
0068 #define ACPI_DBG_TRACK_ALLOCATIONS
0069 #endif
0070
0071
0072
0073 #ifdef ACPI_HELP_APP
0074 #define ACPI_NO_ERROR_MESSAGES
0075 #endif
0076
0077
0078
0079 #ifdef ACPI_NAMES_APP
0080 #define ACPI_DEBUG_OUTPUT
0081 #endif
0082
0083
0084
0085 #if (defined ACPI_EXEC_APP) || \
0086 (defined ACPI_EXAMPLE_APP) || \
0087 (defined ACPI_NAMES_APP)
0088 #define ACPI_USE_NATIVE_RSDP_POINTER
0089 #endif
0090
0091
0092
0093 #ifdef ACPI_DUMP_APP
0094 #define ACPI_USE_NATIVE_MEMORY_MAPPING
0095 #endif
0096
0097
0098
0099 #if (defined ACPI_EXAMPLE_APP) || \
0100 (defined ACPI_NAMES_APP)
0101 #define ACPI_REDUCED_HARDWARE 1
0102 #endif
0103
0104
0105
0106 #ifdef ACPI_LIBRARY
0107 #define ACPI_USE_LOCAL_CACHE
0108 #define ACPI_DEBUGGER 1
0109 #define ACPI_DISASSEMBLER 1
0110
0111 #ifdef _DEBUG
0112 #define ACPI_DEBUG_OUTPUT
0113 #endif
0114 #endif
0115
0116
0117
0118 #ifdef ACPI_APPLICATION
0119 #define ACPI_USE_LOCAL_CACHE
0120 #endif
0121
0122
0123
0124 #ifdef ACPI_FULL_DEBUG
0125 #define ACPI_DEBUG_OUTPUT
0126 #define ACPI_DEBUGGER 1
0127 #define ACPI_DISASSEMBLER 1
0128 #endif
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140 #define ACPI_SRC_OS_LF_ONLY 0
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
0152 #include <acpi/platform/acgcc.h>
0153
0154 #elif defined(_MSC_VER)
0155 #include "acmsvc.h"
0156
0157 #elif defined(__INTEL_COMPILER)
0158 #include <acpi/platform/acintel.h>
0159
0160 #endif
0161
0162 #if defined(_LINUX) || defined(__linux__)
0163 #include <acpi/platform/aclinux.h>
0164
0165 #elif defined(_APPLE) || defined(__APPLE__)
0166 #include "acmacosx.h"
0167
0168 #elif defined(__DragonFly__)
0169 #include "acdragonfly.h"
0170
0171 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
0172 #include "acfreebsd.h"
0173
0174 #elif defined(__NetBSD__)
0175 #include "acnetbsd.h"
0176
0177 #elif defined(__sun)
0178 #include "acsolaris.h"
0179
0180 #elif defined(MODESTO)
0181 #include "acmodesto.h"
0182
0183 #elif defined(NETWARE)
0184 #include "acnetware.h"
0185
0186 #elif defined(_CYGWIN)
0187 #include "accygwin.h"
0188
0189 #elif defined(WIN32)
0190 #include "acwin.h"
0191
0192 #elif defined(WIN64)
0193 #include "acwin64.h"
0194
0195 #elif defined(_WRS_LIB_BUILD)
0196 #include "acvxworks.h"
0197
0198 #elif defined(__OS2__)
0199 #include "acos2.h"
0200
0201 #elif defined(__HAIKU__)
0202 #include "achaiku.h"
0203
0204 #elif defined(__QNX__)
0205 #include "acqnx.h"
0206
0207
0208
0209
0210
0211
0212 #elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
0213 #include "acefi.h"
0214
0215 #else
0216
0217
0218
0219 #error Unknown target environment
0220 #endif
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233 #ifndef COMPILER_DEPENDENT_INT64
0234 #define COMPILER_DEPENDENT_INT64 long long
0235 #endif
0236
0237 #ifndef COMPILER_DEPENDENT_UINT64
0238 #define COMPILER_DEPENDENT_UINT64 unsigned long long
0239 #endif
0240
0241
0242 #ifndef ACPI_MUTEX_TYPE
0243 #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
0244 #endif
0245
0246
0247
0248 #ifndef ACPI_ACQUIRE_GLOBAL_LOCK
0249 #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1
0250 #endif
0251
0252 #ifndef ACPI_RELEASE_GLOBAL_LOCK
0253 #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0
0254 #endif
0255
0256
0257
0258 #ifndef ACPI_FLUSH_CPU_CACHE
0259 #define ACPI_FLUSH_CPU_CACHE()
0260 #endif
0261
0262
0263
0264 #ifndef ACPI_INLINE
0265 #define ACPI_INLINE
0266 #endif
0267
0268
0269 #ifndef ACPI_STRUCT_INIT
0270 #define ACPI_STRUCT_INIT(field, value) value
0271 #endif
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281 #ifndef ACPI_SYSTEM_XFACE
0282 #define ACPI_SYSTEM_XFACE
0283 #endif
0284
0285 #ifndef ACPI_EXTERNAL_XFACE
0286 #define ACPI_EXTERNAL_XFACE
0287 #endif
0288
0289 #ifndef ACPI_INTERNAL_XFACE
0290 #define ACPI_INTERNAL_XFACE
0291 #endif
0292
0293 #ifndef ACPI_INTERNAL_VAR_XFACE
0294 #define ACPI_INTERNAL_VAR_XFACE
0295 #endif
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305 #ifndef DEBUGGER_THREADING
0306 #if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
0307 #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
0308
0309 #else
0310 #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
0311 #endif
0312 #endif
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336 #ifdef ACPI_USE_STANDARD_HEADERS
0337
0338
0339
0340 #include <stdlib.h>
0341 #include <string.h>
0342 #include <ctype.h>
0343 #if defined (ACPI_APPLICATION) || defined(ACPI_LIBRARY)
0344 #include <stdio.h>
0345 #include <fcntl.h>
0346 #include <errno.h>
0347 #include <time.h>
0348 #include <signal.h>
0349 #endif
0350
0351 #endif
0352
0353 #ifdef ACPI_APPLICATION
0354 #define ACPI_FILE FILE *
0355 #define ACPI_FILE_OUT stdout
0356 #define ACPI_FILE_ERR stderr
0357 #else
0358 #define ACPI_FILE void *
0359 #define ACPI_FILE_OUT NULL
0360 #define ACPI_FILE_ERR NULL
0361 #endif
0362
0363 #ifndef ACPI_INIT_FUNCTION
0364 #define ACPI_INIT_FUNCTION
0365 #endif
0366
0367 #endif