Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPICA: Update compilation environment settings.

This patch does not affect the generation of the Linux binary.
This patch decreases 300 lines of 20121018 divergence.diff.

This patch updates architecture specific environment settings for compiling
ACPICA as such enhancement already has been done in ACPICA.

Note that the appended compiler default settings in the
<acpi/platform/acenv.h> will deprecate some of the macros defined in the
architecture specific <asm/acpi.h>. Thus two of the <asm/acpi.h> headers
have been cleaned up in this patch accordingly.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lv Zheng and committed by
Rafael J. Wysocki
0947c6de 75c8044f

+103 -128
-4
arch/ia64/include/asm/acpi.h
··· 52 52 53 53 /* Asm macros */ 54 54 55 - #define ACPI_ASM_MACROS 56 - #define BREAKPOINT3 57 - #define ACPI_DISABLE_IRQS() local_irq_disable() 58 - #define ACPI_ENABLE_IRQS() local_irq_enable() 59 55 #define ACPI_FLUSH_CPU_CACHE() 60 56 61 57 static inline int
-4
arch/x86/include/asm/acpi.h
··· 49 49 50 50 /* Asm macros */ 51 51 52 - #define ACPI_ASM_MACROS 53 - #define BREAKPOINT3 54 - #define ACPI_DISABLE_IRQS() local_irq_disable() 55 - #define ACPI_ENABLE_IRQS() local_irq_enable() 56 52 #define ACPI_FLUSH_CPU_CACHE() wbinvd() 57 53 58 54 int __acpi_acquire_global_lock(unsigned int *lock);
+103 -116
include/acpi/platform/acenv.h
··· 44 44 #ifndef __ACENV_H__ 45 45 #define __ACENV_H__ 46 46 47 + /* 48 + * Environment configuration. The purpose of this file is to interface ACPICA 49 + * to the local environment. This includes compiler-specific, OS-specific, 50 + * and machine-specific configuration. 51 + */ 47 52 /* Types for ACPI_MUTEX_TYPE */ 48 53 49 54 #define ACPI_BINARY_SEMAPHORE 0 ··· 104 99 #define ACPI_DISASSEMBLER 105 100 #endif 106 101 107 - /* 108 - * Environment configuration. The purpose of this file is to interface to the 109 - * local generation environment. 110 - * 111 - * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. 112 - * Otherwise, local versions of string/memory functions will be used. 113 - * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and 114 - * the standard header files may be used. 115 - * 116 - * The ACPI subsystem only uses low level C library functions that do not call 117 - * operating system services and may therefore be inlined in the code. 118 - * 119 - * It may be necessary to tailor these include files to the target 120 - * generation environment. 121 - * 122 - * 123 - * Functions and constants used from each header: 124 - * 125 - * string.h: memcpy 126 - * memset 127 - * strcat 128 - * strcmp 129 - * strcpy 130 - * strlen 131 - * strncmp 132 - * strncat 133 - * strncpy 134 - * 135 - * stdlib.h: strtoul 136 - * 137 - * stdarg.h: va_list 138 - * va_arg 139 - * va_start 140 - * va_end 141 - * 142 - */ 143 102 144 103 /*! [Begin] no source code translation */ 145 104 105 + /****************************************************************************** 106 + * 107 + * Host configuration files. The compiler configuration files are included 108 + * by the host files. 109 + * 110 + *****************************************************************************/ 146 111 #if defined(_LINUX) || defined(__linux__) 147 112 #include <acpi/platform/aclinux.h> 148 - 149 - #elif defined(_AED_EFI) 150 - #include "acefi.h" 151 - 152 - #elif defined(WIN32) 153 - #include "acwin.h" 154 - 155 - #elif defined(WIN64) 156 - #include "acwin64.h" 157 - 158 - #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ 159 - #include "acdos16.h" 160 113 161 114 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 162 115 #include "acfreebsd.h" ··· 122 159 #elif defined(__NetBSD__) 123 160 #include "acnetbsd.h" 124 161 162 + #elif defined(__sun) 163 + #include "acsolaris.h" 164 + 125 165 #elif defined(MODESTO) 126 166 #include "acmodesto.h" 127 167 128 168 #elif defined(NETWARE) 129 169 #include "acnetware.h" 130 170 131 - #elif defined(__sun) 132 - #include "acsolaris.h" 171 + #elif defined(_CYGWIN) 172 + #include "accygwin.h" 173 + 174 + #elif defined(WIN32) 175 + #include "acwin.h" 176 + 177 + #elif defined(WIN64) 178 + #include "acwin64.h" 179 + 180 + #elif defined(_WRS_LIB_BUILD) 181 + #include "acvxworks.h" 182 + 183 + #elif defined(__OS2__) 184 + #include "acos2.h" 185 + 186 + #elif defined(_AED_EFI) 187 + #include "acefi.h" 188 + 189 + #elif defined(__HAIKU__) 190 + #include "achaiku.h" 133 191 134 192 #else 135 193 136 - /* All other environments */ 194 + /* Unknown environment */ 137 195 138 - #define ACPI_USE_STANDARD_HEADERS 139 - 140 - #define COMPILER_DEPENDENT_INT64 long long 141 - #define COMPILER_DEPENDENT_UINT64 unsigned long long 142 - 196 + #error Unknown target environment 143 197 #endif 144 198 145 199 /*! [End] no source code translation !*/ 146 200 147 201 /****************************************************************************** 148 202 * 149 - * Miscellaneous configuration 203 + * Setup defaults for the required symbols that were not defined in one of 204 + * the host/compiler files above. 150 205 * 151 206 *****************************************************************************/ 207 + 208 + /* 64-bit data types */ 209 + 210 + #ifndef COMPILER_DEPENDENT_INT64 211 + #define COMPILER_DEPENDENT_INT64 long long 212 + #endif 213 + 214 + #ifndef COMPILER_DEPENDENT_UINT64 215 + #define COMPILER_DEPENDENT_UINT64 unsigned long long 216 + #endif 152 217 153 218 /* Type of mutex supported by host. Default is binary semaphores. */ 154 219 #ifndef ACPI_MUTEX_TYPE 155 220 #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE 156 221 #endif 157 222 223 + /* Global Lock acquire/release */ 224 + 225 + #ifndef ACPI_ACQUIRE_GLOBAL_LOCK 226 + #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1 227 + #endif 228 + 229 + #ifndef ACPI_RELEASE_GLOBAL_LOCK 230 + #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0 231 + #endif 232 + 233 + /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ 234 + 235 + #ifndef ACPI_FLUSH_CPU_CACHE 236 + #define ACPI_FLUSH_CPU_CACHE() 237 + #endif 238 + 158 239 /* "inline" keywords - configurable since inline is not standardized */ 159 240 160 241 #ifndef ACPI_INLINE 161 242 #define ACPI_INLINE 243 + #endif 244 + 245 + /* 246 + * Configurable calling conventions: 247 + * 248 + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 249 + * ACPI_EXTERNAL_XFACE - External ACPI interfaces 250 + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 251 + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 252 + */ 253 + #ifndef ACPI_SYSTEM_XFACE 254 + #define ACPI_SYSTEM_XFACE 255 + #endif 256 + 257 + #ifndef ACPI_EXTERNAL_XFACE 258 + #define ACPI_EXTERNAL_XFACE 259 + #endif 260 + 261 + #ifndef ACPI_INTERNAL_XFACE 262 + #define ACPI_INTERNAL_XFACE 263 + #endif 264 + 265 + #ifndef ACPI_INTERNAL_VAR_XFACE 266 + #define ACPI_INTERNAL_VAR_XFACE 162 267 #endif 163 268 164 269 /* ··· 254 223 255 224 #define ACPI_IS_ASCII(c) ((c) < 0x80) 256 225 257 - #ifdef ACPI_USE_SYSTEM_CLIBRARY 258 226 /* 259 - * Use the standard C library headers. 260 - * We want to keep these to a minimum. 227 + * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. 228 + * Otherwise, local versions of string/memory functions will be used. 229 + * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and 230 + * the standard header files may be used. 231 + * 232 + * The ACPICA subsystem only uses low level C library functions that do not call 233 + * operating system services and may therefore be inlined in the code. 234 + * 235 + * It may be necessary to tailor these include files to the target 236 + * generation environment. 261 237 */ 238 + #ifdef ACPI_USE_SYSTEM_CLIBRARY 239 + 240 + /* Use the standard C library headers. We want to keep these to a minimum. */ 241 + 262 242 #ifdef ACPI_USE_STANDARD_HEADERS 263 243 /* Use the standard headers from the standard locations */ 264 244 #include <stdarg.h> ··· 332 290 /* Variable argument list macro definitions */ 333 291 #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 334 292 #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) 335 - #define va_end(ap) (void) 0 293 + #define va_end(ap) (ap = (va_list) NULL) 336 294 #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) 337 295 338 296 #endif /* va_arg */ ··· 356 314 357 315 #endif /* ACPI_USE_SYSTEM_CLIBRARY */ 358 316 359 - /****************************************************************************** 360 - * 361 - * Assembly code macros 362 - * 363 - *****************************************************************************/ 364 - 365 - /* 366 - * Handle platform- and compiler-specific assembly language differences. 367 - * These should already have been defined by the platform includes above. 368 - * 369 - * Notes: 370 - * 1) Interrupt 3 is used to break into a debugger 371 - * 2) Interrupts are turned off during ACPI register setup 372 - */ 373 - 374 - /* Unrecognized compiler, use defaults */ 375 - 376 - #ifndef ACPI_ASM_MACROS 377 - 378 - /* 379 - * Calling conventions: 380 - * 381 - * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 382 - * ACPI_EXTERNAL_XFACE - External ACPI interfaces 383 - * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 384 - * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 385 - */ 386 - #define ACPI_SYSTEM_XFACE 387 - #define ACPI_EXTERNAL_XFACE 388 - #define ACPI_INTERNAL_XFACE 389 - #define ACPI_INTERNAL_VAR_XFACE 390 - 391 - #define ACPI_ASM_MACROS 392 - #define BREAKPOINT3 393 - #define ACPI_DISABLE_IRQS() 394 - #define ACPI_ENABLE_IRQS() 395 - #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) 396 - #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) 397 - 398 - #endif /* ACPI_ASM_MACROS */ 399 - 400 - #ifdef ACPI_APPLICATION 401 - 402 - /* Don't want software interrupts within a ring3 application */ 403 - 404 - #undef BREAKPOINT3 405 - #define BREAKPOINT3 406 - #endif 407 - 408 - /****************************************************************************** 409 - * 410 - * Compiler-specific information is contained in the compiler-specific 411 - * headers. 412 - * 413 - *****************************************************************************/ 414 317 #endif /* __ACENV_H__ */
-4
include/acpi/platform/acgcc.h
··· 64 64 */ 65 65 #define ACPI_UNUSED_VAR __attribute__ ((unused)) 66 66 67 - #ifdef _ANSI 68 - #define inline 69 - #endif 70 - 71 67 #endif /* __ACGCC_H__ */