Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128056
b: refs/heads/master
c: 1685bd4
h: refs/heads/master
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Dec 31, 2008
1 parent 9aa0620 commit f9b534f
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7488c8d51134a152f022bc11547157f80a725ff1
refs/heads/master: 1685bd404dc2ecce2fdae6410e85ded2f2c0136d
13 changes: 5 additions & 8 deletions trunk/include/acpi/acpiosxf.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,19 @@ acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);

/*
* Mutex primitives
* Mutex primitives. May be configured to use semaphores instead via
* ACPI_MUTEX_TYPE (see platform/acenv.h)
*/
#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)

acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);

void acpi_os_delete_mutex(acpi_mutex handle);

acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);

void acpi_os_release_mutex(acpi_mutex handle);

/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */

#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle)
#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle)
#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time)
#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1)
#endif

/*
* Memory allocation and mapping
Expand Down
54 changes: 40 additions & 14 deletions trunk/include/acpi/actypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,10 @@ typedef u32 acpi_physical_address;

/*******************************************************************************
*
* OS-dependent and compiler-dependent types
* OS-dependent types
*
* If the defaults below are not appropriate for the host system, they can
* be defined in the compiler-specific or OS-specific header, and this will
* take precedence.
* be defined in the OS-specific header, and this will take precedence.
*
******************************************************************************/

Expand All @@ -218,12 +217,6 @@ typedef u32 acpi_physical_address;
#define acpi_thread_id acpi_size
#endif

/* Object returned from acpi_os_create_lock */

#ifndef acpi_spinlock
#define acpi_spinlock void *
#endif

/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */

#ifndef acpi_cpu_flags
Expand All @@ -240,6 +233,44 @@ typedef u32 acpi_physical_address;
#endif
#endif

/*
* Synchronization objects - Mutexes, Semaphores, and spin_locks
*/
#if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
/*
* These macros are used if the host OS does not support a mutex object.
* Map the OSL Mutex interfaces to binary semaphores.
*/
#define acpi_mutex acpi_semaphore
#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle)
#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle)
#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time)
#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1)
#endif

/* Configurable types for synchronization objects */

#ifndef acpi_spinlock
#define acpi_spinlock void *
#endif

#ifndef acpi_semaphore
#define acpi_semaphore void *
#endif

#ifndef acpi_mutex
#define acpi_mutex void *
#endif

/*******************************************************************************
*
* Compiler-dependent types
*
* If the defaults below are not appropriate for the host compiler, they can
* be defined in the compiler-specific header, and this will take precedence.
*
******************************************************************************/

/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */

#ifndef acpi_uintptr_t
Expand Down Expand Up @@ -353,11 +384,6 @@ struct uint32_struct {
u32 hi;
};

/* Synchronization objects */

#define acpi_mutex void *
#define acpi_semaphore void *

/*
* Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI
* version 2, integers are 64 bits. Note that this pertains to the ACPI integer
Expand Down
35 changes: 29 additions & 6 deletions trunk/include/acpi/platform/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,26 @@
#ifndef __ACENV_H__
#define __ACENV_H__

/*
/* Types for ACPI_MUTEX_TYPE */

#define ACPI_BINARY_SEMAPHORE 0
#define ACPI_OSL_MUTEX 1

/* Types for DEBUGGER_THREADING */

#define DEBUGGER_SINGLE_THREADED 0
#define DEBUGGER_MULTI_THREADED 1

/******************************************************************************
*
* Configuration for ACPI tools and utilities
*/
*
*****************************************************************************/

#ifdef ACPI_LIBRARY
/*
* Note: The non-debug version of the acpi_library does not contain any
* debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG
* debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG
*/
#define ACPI_USE_LOCAL_CACHE
#endif
Expand Down Expand Up @@ -167,6 +180,19 @@

/*! [End] no source code translation !*/

/******************************************************************************
*
* Miscellaneous configuration
*
*****************************************************************************/

/*
* Are mutexes supported by the host? default is no, use binary semaphores.
*/
#ifndef ACPI_MUTEX_TYPE
#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
#endif

/*
* Debugger threading model
* Use single threaded if the entire subsystem is contained in an application
Expand All @@ -175,9 +201,6 @@
* By default the model is single threaded if ACPI_APPLICATION is set,
* multi-threaded if ACPI_APPLICATION is not set.
*/
#define DEBUGGER_SINGLE_THREADED 0
#define DEBUGGER_MULTI_THREADED 1

#ifndef DEBUGGER_THREADING
#ifdef ACPI_APPLICATION
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
Expand Down
1 change: 1 addition & 0 deletions trunk/include/acpi/platform/aclinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0
#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE

#ifdef __KERNEL__

Expand Down

0 comments on commit f9b534f

Please sign in to comment.