aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-12-30 14:03:29 -0500
committerLen Brown <len.brown@intel.com>2008-12-31 01:16:39 -0500
commit1685bd404dc2ecce2fdae6410e85ded2f2c0136d (patch)
tree5ccce028c1b60c50082fb6641b4afc7afdd6e636 /include/acpi
parent7488c8d51134a152f022bc11547157f80a725ff1 (diff)
ACPICA: Add ACPI_MUTEX_TYPE configuration option
Used to specify whether the OSL mutex interfaces should be used, or binary semaphores instead. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpiosxf.h13
-rw-r--r--include/acpi/actypes.h54
-rw-r--r--include/acpi/platform/acenv.h35
-rw-r--r--include/acpi/platform/aclinux.h1
4 files changed, 75 insertions, 28 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index b91440ac0d16..a62720a7edc0 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -121,8 +121,11 @@ acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
121acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); 121acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
122 122
123/* 123/*
124 * Mutex primitives 124 * Mutex primitives. May be configured to use semaphores instead via
125 * ACPI_MUTEX_TYPE (see platform/acenv.h)
125 */ 126 */
127#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
128
126acpi_status acpi_os_create_mutex(acpi_mutex * out_handle); 129acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
127 130
128void acpi_os_delete_mutex(acpi_mutex handle); 131void acpi_os_delete_mutex(acpi_mutex handle);
@@ -130,13 +133,7 @@ void acpi_os_delete_mutex(acpi_mutex handle);
130acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout); 133acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
131 134
132void acpi_os_release_mutex(acpi_mutex handle); 135void acpi_os_release_mutex(acpi_mutex handle);
133 136#endif
134/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */
135
136#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle)
137#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle)
138#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time)
139#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1)
140 137
141/* 138/*
142 * Memory allocation and mapping 139 * Memory allocation and mapping
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 20f6f9c5f21c..24b2cef5a13f 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -204,11 +204,10 @@ typedef u32 acpi_physical_address;
204 204
205/******************************************************************************* 205/*******************************************************************************
206 * 206 *
207 * OS-dependent and compiler-dependent types 207 * OS-dependent types
208 * 208 *
209 * If the defaults below are not appropriate for the host system, they can 209 * If the defaults below are not appropriate for the host system, they can
210 * be defined in the compiler-specific or OS-specific header, and this will 210 * be defined in the OS-specific header, and this will take precedence.
211 * take precedence.
212 * 211 *
213 ******************************************************************************/ 212 ******************************************************************************/
214 213
@@ -218,12 +217,6 @@ typedef u32 acpi_physical_address;
218#define acpi_thread_id acpi_size 217#define acpi_thread_id acpi_size
219#endif 218#endif
220 219
221/* Object returned from acpi_os_create_lock */
222
223#ifndef acpi_spinlock
224#define acpi_spinlock void *
225#endif
226
227/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ 220/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
228 221
229#ifndef acpi_cpu_flags 222#ifndef acpi_cpu_flags
@@ -240,6 +233,44 @@ typedef u32 acpi_physical_address;
240#endif 233#endif
241#endif 234#endif
242 235
236/*
237 * Synchronization objects - Mutexes, Semaphores, and spin_locks
238 */
239#if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
240/*
241 * These macros are used if the host OS does not support a mutex object.
242 * Map the OSL Mutex interfaces to binary semaphores.
243 */
244#define acpi_mutex acpi_semaphore
245#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle)
246#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle)
247#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time)
248#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1)
249#endif
250
251/* Configurable types for synchronization objects */
252
253#ifndef acpi_spinlock
254#define acpi_spinlock void *
255#endif
256
257#ifndef acpi_semaphore
258#define acpi_semaphore void *
259#endif
260
261#ifndef acpi_mutex
262#define acpi_mutex void *
263#endif
264
265/*******************************************************************************
266 *
267 * Compiler-dependent types
268 *
269 * If the defaults below are not appropriate for the host compiler, they can
270 * be defined in the compiler-specific header, and this will take precedence.
271 *
272 ******************************************************************************/
273
243/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 274/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
244 275
245#ifndef acpi_uintptr_t 276#ifndef acpi_uintptr_t
@@ -353,11 +384,6 @@ struct uint32_struct {
353 u32 hi; 384 u32 hi;
354}; 385};
355 386
356/* Synchronization objects */
357
358#define acpi_mutex void *
359#define acpi_semaphore void *
360
361/* 387/*
362 * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI 388 * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI
363 * version 2, integers are 64 bits. Note that this pertains to the ACPI integer 389 * version 2, integers are 64 bits. Note that this pertains to the ACPI integer
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index cbae39c728a5..e62f10d9a7d8 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -44,13 +44,26 @@
44#ifndef __ACENV_H__ 44#ifndef __ACENV_H__
45#define __ACENV_H__ 45#define __ACENV_H__
46 46
47/* 47/* Types for ACPI_MUTEX_TYPE */
48
49#define ACPI_BINARY_SEMAPHORE 0
50#define ACPI_OSL_MUTEX 1
51
52/* Types for DEBUGGER_THREADING */
53
54#define DEBUGGER_SINGLE_THREADED 0
55#define DEBUGGER_MULTI_THREADED 1
56
57/******************************************************************************
58 *
48 * Configuration for ACPI tools and utilities 59 * Configuration for ACPI tools and utilities
49 */ 60 *
61 *****************************************************************************/
62
50#ifdef ACPI_LIBRARY 63#ifdef ACPI_LIBRARY
51/* 64/*
52 * Note: The non-debug version of the acpi_library does not contain any 65 * Note: The non-debug version of the acpi_library does not contain any
53 * debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG 66 * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG
54 */ 67 */
55#define ACPI_USE_LOCAL_CACHE 68#define ACPI_USE_LOCAL_CACHE
56#endif 69#endif
@@ -167,6 +180,19 @@
167 180
168/*! [End] no source code translation !*/ 181/*! [End] no source code translation !*/
169 182
183/******************************************************************************
184 *
185 * Miscellaneous configuration
186 *
187 *****************************************************************************/
188
189/*
190 * Are mutexes supported by the host? default is no, use binary semaphores.
191 */
192#ifndef ACPI_MUTEX_TYPE
193#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
194#endif
195
170/* 196/*
171 * Debugger threading model 197 * Debugger threading model
172 * Use single threaded if the entire subsystem is contained in an application 198 * Use single threaded if the entire subsystem is contained in an application
@@ -175,9 +201,6 @@
175 * By default the model is single threaded if ACPI_APPLICATION is set, 201 * By default the model is single threaded if ACPI_APPLICATION is set,
176 * multi-threaded if ACPI_APPLICATION is not set. 202 * multi-threaded if ACPI_APPLICATION is not set.
177 */ 203 */
178#define DEBUGGER_SINGLE_THREADED 0
179#define DEBUGGER_MULTI_THREADED 1
180
181#ifndef DEBUGGER_THREADING 204#ifndef DEBUGGER_THREADING
182#ifdef ACPI_APPLICATION 205#ifdef ACPI_APPLICATION
183#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 206#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 0515e754449d..3cabf888c8af 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -46,6 +46,7 @@
46 46
47#define ACPI_USE_SYSTEM_CLIBRARY 47#define ACPI_USE_SYSTEM_CLIBRARY
48#define ACPI_USE_DO_WHILE_0 48#define ACPI_USE_DO_WHILE_0
49#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
49 50
50#ifdef __KERNEL__ 51#ifdef __KERNEL__
51 52