1 /******************************************************************************
3 * Name: acenv.h - Generation environment specific items
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * Configuration for ACPI tools and utilities
36 #define ACPI_APPLICATION
37 #define ENABLE_DEBUGGER
38 #define ACPI_USE_SYSTEM_CLIBRARY
43 #undef DEBUGGER_THREADING
44 #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
46 #define ACPI_APPLICATION
47 #define ENABLE_DEBUGGER
48 #define ACPI_USE_SYSTEM_CLIBRARY
51 #ifdef _ACPI_ASL_COMPILER
53 #define ACPI_APPLICATION
54 #define ENABLE_DEBUGGER
55 #define ACPI_USE_SYSTEM_CLIBRARY
59 * Memory allocation tracking. Used only if
60 * 1) This is the debug version
61 * 2) This is NOT a 16-bit version of the code (not enough real-mode memory)
65 #define ACPI_DEBUG_TRACK_ALLOCATIONS
70 * Environment configuration. The purpose of this file is to interface to the
71 * local generation environment.
73 * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
74 * Otherwise, local versions of string/memory functions will be used.
75 * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
76 * the standard header files may be used.
78 * The ACPI subsystem only uses low level C library functions that do not call
79 * operating system services and may therefore be inlined in the code.
81 * It may be necessary to tailor these include files to the target
82 * generation environment.
85 * Functions and constants used from each header:
106 /*! [Begin] no source code translation */
117 #elif defined(__FreeBSD__)
118 #include "acfreebsd.h"
122 /* All other environments */
124 #define ACPI_USE_STANDARD_HEADERS
126 /* Name of host operating system (returned by the _OS_ namespace object) */
128 #define ACPI_OS_NAME "Intel ACPI/CA Core Subsystem"
133 /*! [End] no source code translation !*/
135 /******************************************************************************
137 * C library configuration
139 *****************************************************************************/
141 #ifdef ACPI_USE_SYSTEM_CLIBRARY
143 * Use the standard C library headers.
144 * We want to keep these to a minimum.
148 #ifdef ACPI_USE_STANDARD_HEADERS
150 * Use the standard headers from the standard locations
157 #endif /* ACPI_USE_STANDARD_HEADERS */
160 * We will be linking to the standard Clib functions
163 #define STRSTR(s1,s2) strstr((s1), (s2))
164 #define STRUPR(s) strupr((s))
165 #define STRLEN(s) (u32) strlen((s))
166 #define STRCPY(d,s) strcpy((d), (s))
167 #define STRNCPY(d,s,n) strncpy((d), (s), (NATIVE_INT)(n))
168 #define STRNCMP(d,s,n) strncmp((d), (s), (NATIVE_INT)(n))
169 #define STRCMP(d,s) strcmp((d), (s))
170 #define STRCAT(d,s) strcat((d), (s))
171 #define STRNCAT(d,s,n) strncat((d), (s), (NATIVE_INT)(n))
172 #define STRTOUL(d,s,n) strtoul((d), (s), (NATIVE_INT)(n))
173 #define MEMCPY(d,s,n) memcpy((d), (s), (NATIVE_INT)(n))
174 #define MEMSET(d,s,n) memset((d), (s), (NATIVE_INT)(n))
175 #define TOUPPER toupper
176 #define TOLOWER tolower
177 #define IS_XDIGIT isxdigit
179 /******************************************************************************
181 * Not using native C library, use local implementations
183 *****************************************************************************/
187 * Use local definitions of C library macros and functions
188 * NOTE: The function implementations may not be as efficient
189 * as an inline or assembly code implementation provided by a
197 typedef char *va_list;
201 * Storage alignment properties
204 #define _AUPBND (sizeof (NATIVE_INT) - 1)
205 #define _ADNBND (sizeof (NATIVE_INT) - 1)
208 * Variable argument list macro definitions
211 #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
212 #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
213 #define va_end(ap) (void) 0
214 #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
219 #define STRSTR(s1,s2) acpi_cm_strstr ((s1), (s2))
220 #define STRUPR(s) acpi_cm_strupr ((s))
221 #define STRLEN(s) acpi_cm_strlen ((s))
222 #define STRCPY(d,s) acpi_cm_strcpy ((d), (s))
223 #define STRNCPY(d,s,n) acpi_cm_strncpy ((d), (s), (n))
224 #define STRNCMP(d,s,n) acpi_cm_strncmp ((d), (s), (n))
225 #define STRCMP(d,s) acpi_cm_strcmp ((d), (s))
226 #define STRCAT(d,s) acpi_cm_strcat ((d), (s))
227 #define STRNCAT(d,s,n) acpi_cm_strncat ((d), (s), (n))
228 #define STRTOUL(d,s,n) acpi_cm_strtoul ((d), (s),(n))
229 #define MEMCPY(d,s,n) acpi_cm_memcpy ((d), (s), (n))
230 #define MEMSET(d,v,n) acpi_cm_memset ((d), (v), (n))
231 #define TOUPPER acpi_cm_to_upper
232 #define TOLOWER acpi_cm_to_lower
234 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
237 /******************************************************************************
239 * Assembly code macros
241 *****************************************************************************/
244 * Handle platform- and compiler-specific assembly language differences.
245 * These should already have been defined by the platform includes above.
248 * 1) Interrupt 3 is used to break into a debugger
249 * 2) Interrupts are turned off during ACPI register setup
252 /* Unrecognized compiler, use defaults */
253 #ifndef ACPI_ASM_MACROS
255 #define ACPI_ASM_MACROS
256 #define causeinterrupt(level)
261 #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq)
262 #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq)
264 #endif /* ACPI_ASM_MACROS */
267 #ifdef ACPI_APPLICATION
269 /* Don't want software interrupts within a ring3 application */
271 #undef causeinterrupt
273 #define causeinterrupt(level)
278 /******************************************************************************
282 *****************************************************************************/
284 /* this has been moved to compiler-specific headers, which are included from the
288 #endif /* __ACENV_H__ */