diff options
Diffstat (limited to 'include/acpi/platform/acenv.h')
-rw-r--r-- | include/acpi/platform/acenv.h | 90 |
1 files changed, 34 insertions, 56 deletions
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 86b5a8447606..34cce729109c 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -78,6 +78,7 @@ | |||
78 | (defined ACPI_EXAMPLE_APP) | 78 | (defined ACPI_EXAMPLE_APP) |
79 | #define ACPI_APPLICATION | 79 | #define ACPI_APPLICATION |
80 | #define ACPI_SINGLE_THREADED | 80 | #define ACPI_SINGLE_THREADED |
81 | #define USE_NATIVE_ALLOCATE_ZEROED | ||
81 | #endif | 82 | #endif |
82 | 83 | ||
83 | /* iASL configuration */ | 84 | /* iASL configuration */ |
@@ -124,7 +125,6 @@ | |||
124 | 125 | ||
125 | #ifdef ACPI_DUMP_APP | 126 | #ifdef ACPI_DUMP_APP |
126 | #define ACPI_USE_NATIVE_MEMORY_MAPPING | 127 | #define ACPI_USE_NATIVE_MEMORY_MAPPING |
127 | #define USE_NATIVE_ALLOCATE_ZEROED | ||
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | /* acpi_names/Example configuration. Hardware disabled */ | 130 | /* acpi_names/Example configuration. Hardware disabled */ |
@@ -149,7 +149,6 @@ | |||
149 | /* Common for all ACPICA applications */ | 149 | /* Common for all ACPICA applications */ |
150 | 150 | ||
151 | #ifdef ACPI_APPLICATION | 151 | #ifdef ACPI_APPLICATION |
152 | #define ACPI_USE_SYSTEM_CLIBRARY | ||
153 | #define ACPI_USE_LOCAL_CACHE | 152 | #define ACPI_USE_LOCAL_CACHE |
154 | #endif | 153 | #endif |
155 | 154 | ||
@@ -167,10 +166,21 @@ | |||
167 | /****************************************************************************** | 166 | /****************************************************************************** |
168 | * | 167 | * |
169 | * Host configuration files. The compiler configuration files are included | 168 | * Host configuration files. The compiler configuration files are included |
170 | * by the host files. | 169 | * first. |
171 | * | 170 | * |
172 | *****************************************************************************/ | 171 | *****************************************************************************/ |
173 | 172 | ||
173 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) | ||
174 | #include <acpi/platform/acgcc.h> | ||
175 | |||
176 | #elif defined(_MSC_VER) | ||
177 | #include "acmsvc.h" | ||
178 | |||
179 | #elif defined(__INTEL_COMPILER) | ||
180 | #include "acintel.h" | ||
181 | |||
182 | #endif | ||
183 | |||
174 | #if defined(_LINUX) || defined(__linux__) | 184 | #if defined(_LINUX) || defined(__linux__) |
175 | #include <acpi/platform/aclinux.h> | 185 | #include <acpi/platform/aclinux.h> |
176 | 186 | ||
@@ -210,18 +220,20 @@ | |||
210 | #elif defined(__OS2__) | 220 | #elif defined(__OS2__) |
211 | #include "acos2.h" | 221 | #include "acos2.h" |
212 | 222 | ||
213 | #elif defined(_AED_EFI) | ||
214 | #include "acefi.h" | ||
215 | |||
216 | #elif defined(_GNU_EFI) | ||
217 | #include "acefi.h" | ||
218 | |||
219 | #elif defined(__HAIKU__) | 223 | #elif defined(__HAIKU__) |
220 | #include "achaiku.h" | 224 | #include "achaiku.h" |
221 | 225 | ||
222 | #elif defined(__QNX__) | 226 | #elif defined(__QNX__) |
223 | #include "acqnx.h" | 227 | #include "acqnx.h" |
224 | 228 | ||
229 | /* | ||
230 | * EFI applications can be built with -nostdlib, in this case, it must be | ||
231 | * included after including all other host environmental definitions, in | ||
232 | * order to override the definitions. | ||
233 | */ | ||
234 | #elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI) | ||
235 | #include "acefi.h" | ||
236 | |||
225 | #else | 237 | #else |
226 | 238 | ||
227 | /* Unknown environment */ | 239 | /* Unknown environment */ |
@@ -326,7 +338,8 @@ | |||
326 | * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. | 338 | * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. |
327 | * Otherwise, local versions of string/memory functions will be used. | 339 | * Otherwise, local versions of string/memory functions will be used. |
328 | * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | 340 | * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and |
329 | * the standard header files may be used. | 341 | * the standard header files may be used. Defining this implies that |
342 | * ACPI_USE_SYSTEM_CLIBRARY has been defined. | ||
330 | * | 343 | * |
331 | * The ACPICA subsystem only uses low level C library functions that do not | 344 | * The ACPICA subsystem only uses low level C library functions that do not |
332 | * call operating system services and may therefore be inlined in the code. | 345 | * call operating system services and may therefore be inlined in the code. |
@@ -334,7 +347,6 @@ | |||
334 | * It may be necessary to tailor these include files to the target | 347 | * It may be necessary to tailor these include files to the target |
335 | * generation environment. | 348 | * generation environment. |
336 | */ | 349 | */ |
337 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
338 | 350 | ||
339 | /* Use the standard C library headers. We want to keep these to a minimum. */ | 351 | /* Use the standard C library headers. We want to keep these to a minimum. */ |
340 | 352 | ||
@@ -342,57 +354,20 @@ | |||
342 | 354 | ||
343 | /* Use the standard headers from the standard locations */ | 355 | /* Use the standard headers from the standard locations */ |
344 | 356 | ||
345 | #include <stdarg.h> | ||
346 | #include <stdlib.h> | 357 | #include <stdlib.h> |
347 | #include <string.h> | 358 | #include <string.h> |
348 | #include <ctype.h> | 359 | #include <ctype.h> |
360 | #ifdef ACPI_APPLICATION | ||
361 | #include <stdio.h> | ||
362 | #include <fcntl.h> | ||
363 | #include <errno.h> | ||
364 | #include <time.h> | ||
365 | #include <signal.h> | ||
366 | #endif | ||
349 | 367 | ||
350 | #endif /* ACPI_USE_STANDARD_HEADERS */ | 368 | #endif /* ACPI_USE_STANDARD_HEADERS */ |
351 | 369 | ||
352 | /* We will be linking to the standard Clib functions */ | ||
353 | |||
354 | #else | ||
355 | |||
356 | /****************************************************************************** | ||
357 | * | ||
358 | * Not using native C library, use local implementations | ||
359 | * | ||
360 | *****************************************************************************/ | ||
361 | |||
362 | /* | ||
363 | * Use local definitions of C library macros and functions. These function | ||
364 | * implementations may not be as efficient as an inline or assembly code | ||
365 | * implementation provided by a native C library, but they are functionally | ||
366 | * equivalent. | ||
367 | */ | ||
368 | #ifndef va_arg | ||
369 | |||
370 | #ifndef _VALIST | ||
371 | #define _VALIST | ||
372 | typedef char *va_list; | ||
373 | #endif /* _VALIST */ | ||
374 | |||
375 | /* Storage alignment properties */ | ||
376 | |||
377 | #define _AUPBND (sizeof (acpi_native_int) - 1) | ||
378 | #define _ADNBND (sizeof (acpi_native_int) - 1) | ||
379 | |||
380 | /* Variable argument list macro definitions */ | ||
381 | |||
382 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) | ||
383 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) | ||
384 | #define va_end(ap) (ap = (va_list) NULL) | ||
385 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) | ||
386 | |||
387 | #endif /* va_arg */ | ||
388 | |||
389 | /* Use the local (ACPICA) definitions of the clib functions */ | ||
390 | |||
391 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | ||
392 | |||
393 | #ifndef ACPI_FILE | ||
394 | #ifdef ACPI_APPLICATION | 370 | #ifdef ACPI_APPLICATION |
395 | #include <stdio.h> | ||
396 | #define ACPI_FILE FILE * | 371 | #define ACPI_FILE FILE * |
397 | #define ACPI_FILE_OUT stdout | 372 | #define ACPI_FILE_OUT stdout |
398 | #define ACPI_FILE_ERR stderr | 373 | #define ACPI_FILE_ERR stderr |
@@ -401,6 +376,9 @@ typedef char *va_list; | |||
401 | #define ACPI_FILE_OUT NULL | 376 | #define ACPI_FILE_OUT NULL |
402 | #define ACPI_FILE_ERR NULL | 377 | #define ACPI_FILE_ERR NULL |
403 | #endif /* ACPI_APPLICATION */ | 378 | #endif /* ACPI_APPLICATION */ |
404 | #endif /* ACPI_FILE */ | 379 | |
380 | #ifndef ACPI_INIT_FUNCTION | ||
381 | #define ACPI_INIT_FUNCTION | ||
382 | #endif | ||
405 | 383 | ||
406 | #endif /* __ACENV_H__ */ | 384 | #endif /* __ACENV_H__ */ |