aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/platform
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2012-12-19 20:07:15 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-10 06:36:17 -0500
commit0947c6dee3f6f334fb3772175152853bd90c86ea (patch)
treeaa8ea956e9bd62529823b18ebdbb44417c1b1a1c /include/acpi/platform
parent75c8044fb38051713000e0d151852f5f9614f77b (diff)
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>
Diffstat (limited to 'include/acpi/platform')
-rw-r--r--include/acpi/platform/acenv.h217
-rw-r--r--include/acpi/platform/acgcc.h4
2 files changed, 102 insertions, 119 deletions
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index e3409b6cefbd..68a58a163fe1 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -44,6 +44,11 @@
44#ifndef __ACENV_H__ 44#ifndef __ACENV_H__
45#define __ACENV_H__ 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/* Types for ACPI_MUTEX_TYPE */ 52/* Types for ACPI_MUTEX_TYPE */
48 53
49#define ACPI_BINARY_SEMAPHORE 0 54#define ACPI_BINARY_SEMAPHORE 0
@@ -99,99 +104,101 @@
99#define ACPI_DISASSEMBLER 104#define ACPI_DISASSEMBLER
100#endif 105#endif
101 106
102/*
103 * Environment configuration. The purpose of this file is to interface to the
104 * local generation environment.
105 *
106 * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
107 * Otherwise, local versions of string/memory functions will be used.
108 * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
109 * the standard header files may be used.
110 *
111 * The ACPI subsystem only uses low level C library functions that do not call
112 * operating system services and may therefore be inlined in the code.
113 *
114 * It may be necessary to tailor these include files to the target
115 * generation environment.
116 *
117 *
118 * Functions and constants used from each header:
119 *
120 * string.h: memcpy
121 * memset
122 * strcat
123 * strcmp
124 * strcpy
125 * strlen
126 * strncmp
127 * strncat
128 * strncpy
129 *
130 * stdlib.h: strtoul
131 *
132 * stdarg.h: va_list
133 * va_arg
134 * va_start
135 * va_end
136 *
137 */
138 107
139/*! [Begin] no source code translation */ 108/*! [Begin] no source code translation */
140 109
110/******************************************************************************
111 *
112 * Host configuration files. The compiler configuration files are included
113 * by the host files.
114 *
115 *****************************************************************************/
141#if defined(_LINUX) || defined(__linux__) 116#if defined(_LINUX) || defined(__linux__)
142#include <acpi/platform/aclinux.h> 117#include <acpi/platform/aclinux.h>
143 118
144#elif defined(_AED_EFI)
145#include "acefi.h"
146
147#elif defined(WIN32)
148#include "acwin.h"
149
150#elif defined(WIN64)
151#include "acwin64.h"
152
153#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */
154#include "acdos16.h"
155
156#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 119#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
157#include "acfreebsd.h" 120#include "acfreebsd.h"
158 121
159#elif defined(__NetBSD__) 122#elif defined(__NetBSD__)
160#include "acnetbsd.h" 123#include "acnetbsd.h"
161 124
125#elif defined(__sun)
126#include "acsolaris.h"
127
162#elif defined(MODESTO) 128#elif defined(MODESTO)
163#include "acmodesto.h" 129#include "acmodesto.h"
164 130
165#elif defined(NETWARE) 131#elif defined(NETWARE)
166#include "acnetware.h" 132#include "acnetware.h"
167 133
168#elif defined(__sun) 134#elif defined(_CYGWIN)
169#include "acsolaris.h" 135#include "accygwin.h"
170 136
171#else 137#elif defined(WIN32)
138#include "acwin.h"
139
140#elif defined(WIN64)
141#include "acwin64.h"
172 142
173/* All other environments */ 143#elif defined(_WRS_LIB_BUILD)
144#include "acvxworks.h"
174 145
175#define ACPI_USE_STANDARD_HEADERS 146#elif defined(__OS2__)
147#include "acos2.h"
176 148
177#define COMPILER_DEPENDENT_INT64 long long 149#elif defined(_AED_EFI)
178#define COMPILER_DEPENDENT_UINT64 unsigned long long 150#include "acefi.h"
151
152#elif defined(__HAIKU__)
153#include "achaiku.h"
154
155#else
156
157/* Unknown environment */
179 158
159#error Unknown target environment
180#endif 160#endif
181 161
182/*! [End] no source code translation !*/ 162/*! [End] no source code translation !*/
183 163
184/****************************************************************************** 164/******************************************************************************
185 * 165 *
186 * Miscellaneous configuration 166 * Setup defaults for the required symbols that were not defined in one of
167 * the host/compiler files above.
187 * 168 *
188 *****************************************************************************/ 169 *****************************************************************************/
189 170
171/* 64-bit data types */
172
173#ifndef COMPILER_DEPENDENT_INT64
174#define COMPILER_DEPENDENT_INT64 long long
175#endif
176
177#ifndef COMPILER_DEPENDENT_UINT64
178#define COMPILER_DEPENDENT_UINT64 unsigned long long
179#endif
180
190/* Type of mutex supported by host. Default is binary semaphores. */ 181/* Type of mutex supported by host. Default is binary semaphores. */
191#ifndef ACPI_MUTEX_TYPE 182#ifndef ACPI_MUTEX_TYPE
192#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE 183#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
193#endif 184#endif
194 185
186/* Global Lock acquire/release */
187
188#ifndef ACPI_ACQUIRE_GLOBAL_LOCK
189#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1
190#endif
191
192#ifndef ACPI_RELEASE_GLOBAL_LOCK
193#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0
194#endif
195
196/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
197
198#ifndef ACPI_FLUSH_CPU_CACHE
199#define ACPI_FLUSH_CPU_CACHE()
200#endif
201
195/* "inline" keywords - configurable since inline is not standardized */ 202/* "inline" keywords - configurable since inline is not standardized */
196 203
197#ifndef ACPI_INLINE 204#ifndef ACPI_INLINE
@@ -199,6 +206,30 @@
199#endif 206#endif
200 207
201/* 208/*
209 * Configurable calling conventions:
210 *
211 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
212 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
213 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
214 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
215 */
216#ifndef ACPI_SYSTEM_XFACE
217#define ACPI_SYSTEM_XFACE
218#endif
219
220#ifndef ACPI_EXTERNAL_XFACE
221#define ACPI_EXTERNAL_XFACE
222#endif
223
224#ifndef ACPI_INTERNAL_XFACE
225#define ACPI_INTERNAL_XFACE
226#endif
227
228#ifndef ACPI_INTERNAL_VAR_XFACE
229#define ACPI_INTERNAL_VAR_XFACE
230#endif
231
232/*
202 * Debugger threading model 233 * Debugger threading model
203 * Use single threaded if the entire subsystem is contained in an application 234 * Use single threaded if the entire subsystem is contained in an application
204 * Use multiple threaded when the subsystem is running in the kernel. 235 * Use multiple threaded when the subsystem is running in the kernel.
@@ -223,11 +254,22 @@
223 254
224#define ACPI_IS_ASCII(c) ((c) < 0x80) 255#define ACPI_IS_ASCII(c) ((c) < 0x80)
225 256
226#ifdef ACPI_USE_SYSTEM_CLIBRARY
227/* 257/*
228 * Use the standard C library headers. 258 * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
229 * We want to keep these to a minimum. 259 * Otherwise, local versions of string/memory functions will be used.
260 * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
261 * the standard header files may be used.
262 *
263 * The ACPICA subsystem only uses low level C library functions that do not call
264 * operating system services and may therefore be inlined in the code.
265 *
266 * It may be necessary to tailor these include files to the target
267 * generation environment.
230 */ 268 */
269#ifdef ACPI_USE_SYSTEM_CLIBRARY
270
271/* Use the standard C library headers. We want to keep these to a minimum. */
272
231#ifdef ACPI_USE_STANDARD_HEADERS 273#ifdef ACPI_USE_STANDARD_HEADERS
232/* Use the standard headers from the standard locations */ 274/* Use the standard headers from the standard locations */
233#include <stdarg.h> 275#include <stdarg.h>
@@ -290,7 +332,7 @@ typedef char *va_list;
290/* Variable argument list macro definitions */ 332/* Variable argument list macro definitions */
291#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 333#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
292#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) 334#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
293#define va_end(ap) (void) 0 335#define va_end(ap) (ap = (va_list) NULL)
294#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) 336#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
295 337
296#endif /* va_arg */ 338#endif /* va_arg */
@@ -314,59 +356,4 @@ typedef char *va_list;
314 356
315#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 357#endif /* ACPI_USE_SYSTEM_CLIBRARY */
316 358
317/******************************************************************************
318 *
319 * Assembly code macros
320 *
321 *****************************************************************************/
322
323/*
324 * Handle platform- and compiler-specific assembly language differences.
325 * These should already have been defined by the platform includes above.
326 *
327 * Notes:
328 * 1) Interrupt 3 is used to break into a debugger
329 * 2) Interrupts are turned off during ACPI register setup
330 */
331
332/* Unrecognized compiler, use defaults */
333
334#ifndef ACPI_ASM_MACROS
335
336/*
337 * Calling conventions:
338 *
339 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
340 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
341 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
342 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
343 */
344#define ACPI_SYSTEM_XFACE
345#define ACPI_EXTERNAL_XFACE
346#define ACPI_INTERNAL_XFACE
347#define ACPI_INTERNAL_VAR_XFACE
348
349#define ACPI_ASM_MACROS
350#define BREAKPOINT3
351#define ACPI_DISABLE_IRQS()
352#define ACPI_ENABLE_IRQS()
353#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq)
354#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq)
355
356#endif /* ACPI_ASM_MACROS */
357
358#ifdef ACPI_APPLICATION
359
360/* Don't want software interrupts within a ring3 application */
361
362#undef BREAKPOINT3
363#define BREAKPOINT3
364#endif
365
366/******************************************************************************
367 *
368 * Compiler-specific information is contained in the compiler-specific
369 * headers.
370 *
371 *****************************************************************************/
372#endif /* __ACENV_H__ */ 359#endif /* __ACENV_H__ */
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 72553b0c9f33..7433ad10d2a8 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -64,8 +64,4 @@
64 */ 64 */
65#define ACPI_UNUSED_VAR __attribute__ ((unused)) 65#define ACPI_UNUSED_VAR __attribute__ ((unused))
66 66
67#ifdef _ANSI
68#define inline
69#endif
70
71#endif /* __ACGCC_H__ */ 67#endif /* __ACGCC_H__ */