* contents of the acpica branch
@ 2006-11-24 7:18 Len Brown
[not found] ` <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com>
2006-11-24 20:32 ` contents of the acpica branch Rafael J. Wysocki
0 siblings, 2 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi
The following patches are on the "acpica" branch of the ACPI git tree.
To test, apply this e-mail series, or git pull from here:
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git acpica
thanks,
-Len
^ permalink raw reply [flat|nested] 67+ messages in thread
* [PATCH 1/65] ACPICA: Update function header
[not found] ` <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
[not found] ` <b36e9a5492481728323509aa6179ce6bdab46953.1164352285.git.len.brown@intel.com>
` (61 subsequent siblings)
62 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evrgnini.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index 203d135..790d49b 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -432,6 +432,9 @@ acpi_ev_default_region_setup(acpi_handle
* a PCI address in the scope of the definition. This address is
* required to perform an access to PCI config space.
*
+ * MUTEX: Interpreter should be unlocked, because we may run the _REG
+ * method for this region.
+ *
******************************************************************************/
acpi_status
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 2/65] ACPICA: Handle mis-matched package length
[not found] ` <b36e9a5492481728323509aa6179ce6bdab46953.1164352285.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Implement support within the AML interpreter for
package objects that contain a mismatch between the AML
length and package element count. In this case, the lesser
of the two is used. Some BIOS code apparently modifies
the package length on the fly, and this change supports
this. Provides compatibility with the MS AML interpreter.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dsobject.c | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 72190ab..aaeb9f9 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -318,9 +318,7 @@ acpi_ds_build_internal_package_obj(struc
obj_desc->package.node = parent->common.node;
}
- obj_desc->package.count = package_length;
-
- /* Count the number of items in the package list */
+ /* Count the *actual* number of items in the package list */
arg = op->common.value.arg;
arg = arg->common.next;
@@ -329,11 +327,24 @@ acpi_ds_build_internal_package_obj(struc
}
/*
- * The package length (number of elements) will be the greater
- * of the specified length and the length of the initializer list
+ * The number of elements in the package will be the lesser of the
+ * specified element count and the length of the initializer list.
+ *
+ * Even though the ASL compilers do not allow this to happen (for the
+ * fixed length package opcode), some BIOS code modifies the AML on the
+ * fly to adjust the package length, and this code compensates for that.
+ * This also provides compatibility with other AML interpreters.
*/
- if (package_list_length > package_length) {
- obj_desc->package.count = package_list_length;
+ obj_desc->package.count = package_length;
+
+ if (package_list_length != package_length) {
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "Package length mismatch, using lesser of %X(Length Arg) and %X(AML Length)\n",
+ package_length, package_list_length));
+
+ if (package_list_length < package_length) {
+ obj_desc->package.count = package_list_length;
+ }
}
/*
@@ -356,7 +367,7 @@ acpi_ds_build_internal_package_obj(struc
*/
arg = op->common.value.arg;
arg = arg->common.next;
- for (i = 0; arg; i++) {
+ for (i = 0; i < obj_desc->package.count; i++) {
if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
/* Object (package or buffer) is already built */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 3/65] ACPICA: Handle case NumElements > Package length
[not found] ` <34a1e7753c2bddaed096a7342ea5a138737c8033.1164352285.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Additional update for NumElements fix. Must handle
case where NumElements > Package list length, pad package
with null elements.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dsobject.c | 87 +++++++++++++++++-------------------
1 files changed, 41 insertions(+), 46 deletions(-)
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index aaeb9f9..f9f6862 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -260,7 +260,7 @@ acpi_ds_build_internal_buffer_obj(struct
}
obj_desc->buffer.flags |= AOPOBJ_DATA_VALID;
- op->common.node = (struct acpi_namespace_node *)obj_desc;
+ op->common.node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_desc);
return_ACPI_STATUS(AE_OK);
}
@@ -270,7 +270,8 @@ acpi_ds_build_internal_buffer_obj(struct
*
* PARAMETERS: walk_state - Current walk state
* Op - Parser object to be translated
- * package_length - Number of elements in the package
+ * element_count - Number of elements in the package - this is
+ * the num_elements argument to Package()
* obj_desc_ptr - Where the ACPI internal object is returned
*
* RETURN: Status
@@ -278,18 +279,29 @@ acpi_ds_build_internal_buffer_obj(struct
* DESCRIPTION: Translate a parser Op package object to the equivalent
* namespace object
*
+ * NOTE: The number of elements in the package will be always be the num_elements
+ * count, regardless of the number of elements in the package list. If
+ * num_elements is smaller, only that many package list elements are used.
+ * if num_elements is larger, the Package object is padded out with
+ * objects of type Uninitialized (as per ACPI spec.)
+ *
+ * Even though the ASL compilers do not allow num_elements to be smaller
+ * than the Package list length (for the fixed length package opcode), some
+ * BIOS code modifies the AML on the fly to adjust the num_elements, and
+ * this code compensates for that. This also provides compatibility with
+ * other AML interpreters.
+ *
******************************************************************************/
acpi_status
acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
- u32 package_length,
+ u32 element_count,
union acpi_operand_object **obj_desc_ptr)
{
union acpi_parse_object *arg;
union acpi_parse_object *parent;
union acpi_operand_object *obj_desc = NULL;
- u32 package_list_length;
acpi_status status = AE_OK;
acpi_native_uint i;
@@ -318,43 +330,13 @@ acpi_ds_build_internal_package_obj(struc
obj_desc->package.node = parent->common.node;
}
- /* Count the *actual* number of items in the package list */
-
- arg = op->common.value.arg;
- arg = arg->common.next;
- for (package_list_length = 0; arg; package_list_length++) {
- arg = arg->common.next;
- }
-
- /*
- * The number of elements in the package will be the lesser of the
- * specified element count and the length of the initializer list.
- *
- * Even though the ASL compilers do not allow this to happen (for the
- * fixed length package opcode), some BIOS code modifies the AML on the
- * fly to adjust the package length, and this code compensates for that.
- * This also provides compatibility with other AML interpreters.
- */
- obj_desc->package.count = package_length;
-
- if (package_list_length != package_length) {
- ACPI_DEBUG_PRINT((ACPI_DB_INFO,
- "Package length mismatch, using lesser of %X(Length Arg) and %X(AML Length)\n",
- package_length, package_list_length));
-
- if (package_list_length < package_length) {
- obj_desc->package.count = package_list_length;
- }
- }
-
/*
- * Allocate the pointer array (array of pointers to the
- * individual objects). Add an extra pointer slot so
- * that the list is always null terminated.
+ * Allocate the element array (array of pointers to the individual
+ * objects) based on the num_elements parameter. Add an extra pointer slot
+ * so that the list is always null terminated.
*/
obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
- obj_desc->package.
- count +
+ element_count +
1) * sizeof(void *));
if (!obj_desc->package.elements) {
@@ -362,15 +344,20 @@ acpi_ds_build_internal_package_obj(struc
return_ACPI_STATUS(AE_NO_MEMORY);
}
+ obj_desc->package.count = element_count;
+
/*
- * Initialize all elements of the package
+ * Initialize the elements of the package, up to the num_elements count.
+ * Package is automatically padded with uninitialized (NULL) elements
+ * if num_elements is greater than the package list length. Likewise,
+ * Package is truncated if num_elements is less than the list length.
*/
arg = op->common.value.arg;
arg = arg->common.next;
- for (i = 0; i < obj_desc->package.count; i++) {
+ for (i = 0; arg && (i < element_count); i++) {
if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
- /* Object (package or buffer) is already built */
+ /* This package element is already built, just get it */
obj_desc->package.elements[i] =
ACPI_CAST_PTR(union acpi_operand_object,
@@ -384,8 +371,14 @@ acpi_ds_build_internal_package_obj(struc
arg = arg->common.next;
}
+ if (!arg) {
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "Package List length larger than NumElements count (%X), truncated\n",
+ element_count));
+ }
+
obj_desc->package.flags |= AOPOBJ_DATA_VALID;
- op->common.node = (struct acpi_namespace_node *)obj_desc;
+ op->common.node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_desc);
return_ACPI_STATUS(status);
}
@@ -499,8 +492,9 @@ acpi_ds_init_object_from_op(struct acpi_
/*
* Defer evaluation of Buffer term_arg operand
*/
- obj_desc->buffer.node = (struct acpi_namespace_node *)
- walk_state->operands[0];
+ obj_desc->buffer.node =
+ ACPI_CAST_PTR(struct acpi_namespace_node,
+ walk_state->operands[0]);
obj_desc->buffer.aml_start = op->named.data;
obj_desc->buffer.aml_length = op->named.length;
break;
@@ -510,8 +504,9 @@ acpi_ds_init_object_from_op(struct acpi_
/*
* Defer evaluation of Package term_arg operand
*/
- obj_desc->package.node = (struct acpi_namespace_node *)
- walk_state->operands[0];
+ obj_desc->package.node =
+ ACPI_CAST_PTR(struct acpi_namespace_node,
+ walk_state->operands[0]);
obj_desc->package.aml_start = op->named.data;
obj_desc->package.aml_length = op->named.length;
break;
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 4/65] ACPICA: Delete recursive feature of ACPI Global Lock
[not found] ` <e555508044e355677130b49c67aa6acf9559e014.1164352285.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Completed a new design and implementation for
the ACPI Global Lock support. On the OS side, the global
lock is now treated as a standard AML mutex. Previously,
multiple OS threads could acquire the global lock
simultaneously, but this could cause the BIOS to be starved
by the lock in cases such as the Embedded Controller driver,
where there is a tight coupling between the OS and the BIOS.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evmisc.c | 113 +++++++++++++++++++------------------
drivers/acpi/executer/exmutex.c | 84 ++++++++++++++++------------
drivers/acpi/executer/exsystem.c | 78 +-------------------------
drivers/acpi/namespace/nsaccess.c | 36 +++++-------
drivers/acpi/utilities/utdelete.c | 14 +++--
drivers/acpi/utilities/utglobal.c | 2 +-
include/acpi/acglobal.h | 2 +-
include/acpi/acinterp.h | 6 --
include/acpi/aclocal.h | 1 -
9 files changed, 135 insertions(+), 201 deletions(-)
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index ee2a10b..60c7fbd 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -298,19 +298,13 @@ static void ACPI_SYSTEM_XFACE acpi_ev_gl
{
acpi_status status;
- /* Signal threads that are waiting for the lock */
+ /* Signal the thread that is waiting for the lock */
- if (acpi_gbl_global_lock_thread_count) {
+ /* Send a unit to the semaphore */
- /* Send sufficient units to the semaphore */
-
- status =
- acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore,
- acpi_gbl_global_lock_thread_count);
- if (ACPI_FAILURE(status)) {
- ACPI_ERROR((AE_INFO,
- "Could not signal Global Lock semaphore"));
- }
+ status = acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore, 1);
+ if (ACPI_FAILURE(status)) {
+ ACPI_ERROR((AE_INFO, "Could not signal Global Lock semaphore"));
}
}
@@ -334,7 +328,8 @@ static u32 acpi_ev_global_lock_handler(v
acpi_status status;
/*
- * Attempt to get the lock
+ * Attempt to get the lock.
+ *
* If we don't get it now, it will be marked pending and we will
* take another interrupt when it becomes free.
*/
@@ -342,6 +337,7 @@ static u32 acpi_ev_global_lock_handler(v
if (acquired) {
/* Got the lock, now wake all threads waiting for it */
+
acpi_gbl_global_lock_acquired = TRUE;
acpi_ev_global_lock_thread(context);
}
@@ -400,6 +396,16 @@ acpi_status acpi_ev_init_global_lock_han
*
* DESCRIPTION: Attempt to gain ownership of the Global Lock.
*
+ * MUTEX: Interpreter must be locked
+ *
+ * Note: The original implementation allowed multiple threads to "acquire" the
+ * Global Lock, and the OS would hold the lock until the last thread had
+ * released it. However, this could potentially starve the BIOS out of the
+ * lock, especially in the case where there is a tight handshake between the
+ * Embedded Controller driver and the BIOS. Therefore, this implementation
+ * allows only one thread to acquire the HW Global Lock at a time, and makes
+ * the global lock appear as a standard mutex on the OS side.
+ *
*****************************************************************************/
acpi_status acpi_ev_acquire_global_lock(u16 timeout)
@@ -409,27 +415,25 @@ acpi_status acpi_ev_acquire_global_lock(
ACPI_FUNCTION_TRACE(ev_acquire_global_lock);
-#ifndef ACPI_APPLICATION
- /* Make sure that we actually have a global lock */
-
- if (!acpi_gbl_global_lock_present) {
- return_ACPI_STATUS(AE_NO_GLOBAL_LOCK);
+ /*
+ * Only one thread can acquire the GL at a time, the global_lock_mutex
+ * enforces this. This interface releases the interpreter if we must wait.
+ */
+ status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, timeout);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
}
-#endif
-
- /* One more thread wants the global lock */
-
- acpi_gbl_global_lock_thread_count++;
/*
- * If we (OS side vs. BIOS side) have the hardware lock already,
- * we are done
+ * Make sure that a global lock actually exists. If not, just treat
+ * the lock as a standard mutex.
*/
- if (acpi_gbl_global_lock_acquired) {
+ if (!acpi_gbl_global_lock_present) {
+ acpi_gbl_global_lock_acquired = TRUE;
return_ACPI_STATUS(AE_OK);
}
- /* We must acquire the actual hardware lock */
+ /* Attempt to acquire the actual hardware lock */
ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
if (acquired) {
@@ -437,25 +441,24 @@ acpi_status acpi_ev_acquire_global_lock(
/* We got the lock */
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
- "Acquired the HW Global Lock\n"));
+ "Acquired hardware Global Lock\n"));
acpi_gbl_global_lock_acquired = TRUE;
return_ACPI_STATUS(AE_OK);
}
/*
- * Did not get the lock. The pending bit was set above, and we must now
+ * Did not get the lock. The pending bit was set above, and we must now
* wait until we get the global lock released interrupt.
*/
- ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Waiting for the HW Global Lock\n"));
+ ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Waiting for hardware Global Lock\n"));
/*
- * Acquire the global lock semaphore first.
- * Since this wait will block, we must release the interpreter
+ * Wait for handshake with the global lock interrupt handler.
+ * This interface releases the interpreter if we must wait.
*/
- status =
- acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
- timeout);
+ status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
+ ACPI_WAIT_FOREVER);
return_ACPI_STATUS(status);
}
@@ -478,38 +481,40 @@ acpi_status acpi_ev_release_global_lock(
ACPI_FUNCTION_TRACE(ev_release_global_lock);
- if (!acpi_gbl_global_lock_thread_count) {
+ /* Lock must be acquired */
+
+ if (!acpi_gbl_global_lock_acquired) {
ACPI_WARNING((AE_INFO,
- "Cannot release HW Global Lock, it has not been acquired"));
+ "Cannot release the ACPI Global Lock, it has not been acquired"));
return_ACPI_STATUS(AE_NOT_ACQUIRED);
}
- /* One fewer thread has the global lock */
+ if (acpi_gbl_global_lock_present) {
- acpi_gbl_global_lock_thread_count--;
- if (acpi_gbl_global_lock_thread_count) {
+ /* Allow any thread to release the lock */
- /* There are still some threads holding the lock, cannot release */
+ ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock,
+ pending);
- return_ACPI_STATUS(AE_OK);
+ /*
+ * If the pending bit was set, we must write GBL_RLS to the control
+ * register
+ */
+ if (pending) {
+ status =
+ acpi_set_register(ACPI_BITREG_GLOBAL_LOCK_RELEASE,
+ 1, ACPI_MTX_LOCK);
+ }
+
+ ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+ "Released hardware Global Lock\n"));
}
- /*
- * No more threads holding lock, we can do the actual hardware
- * release
- */
- ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, pending);
acpi_gbl_global_lock_acquired = FALSE;
- /*
- * If the pending bit was set, we must write GBL_RLS to the control
- * register
- */
- if (pending) {
- status = acpi_set_register(ACPI_BITREG_GLOBAL_LOCK_RELEASE,
- 1, ACPI_MTX_LOCK);
- }
+ /* Release the local GL mutex */
+ acpi_os_release_mutex(acpi_gbl_global_lock_mutex);
return_ACPI_STATUS(status);
}
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 3a39c2e..e30cc53 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -44,6 +44,7 @@
#include <acpi/acpi.h>
#include <acpi/acinterp.h>
+#include <acpi/acevents.h>
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exmutex")
@@ -150,7 +151,7 @@ acpi_ex_acquire_mutex(union acpi_operand
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
- /* Sanity check -- we must have a valid thread ID */
+ /* Sanity check: we must have a valid thread ID */
if (!walk_state->thread) {
ACPI_ERROR((AE_INFO,
@@ -174,24 +175,28 @@ acpi_ex_acquire_mutex(union acpi_operand
/* Support for multiple acquires by the owning thread */
if (obj_desc->mutex.owner_thread) {
-
- /* Special case for Global Lock, allow all threads */
-
- if ((obj_desc->mutex.owner_thread->thread_id ==
- walk_state->thread->thread_id) ||
- (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK)) {
+ if (obj_desc->mutex.owner_thread->thread_id ==
+ walk_state->thread->thread_id) {
/*
- * The mutex is already owned by this thread,
- * just increment the acquisition depth
+ * The mutex is already owned by this thread, just increment the
+ * acquisition depth
*/
obj_desc->mutex.acquisition_depth++;
return_ACPI_STATUS(AE_OK);
}
}
- /* Acquire the mutex, wait if necessary */
+ /* Acquire the mutex, wait if necessary. Special case for Global Lock */
+
+ if (obj_desc->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+ status =
+ acpi_ev_acquire_global_lock((u16) time_desc->integer.value);
+ } else {
+ status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
+ (u16) time_desc->integer.
+ value);
+ }
- status = acpi_ex_system_acquire_mutex(time_desc, obj_desc);
if (ACPI_FAILURE(status)) {
/* Includes failure from a timeout on time_desc */
@@ -211,7 +216,6 @@ acpi_ex_acquire_mutex(union acpi_operand
/* Link the mutex to the current thread for force-unlock at method exit */
acpi_ex_link_mutex(obj_desc, walk_state->thread);
-
return_ACPI_STATUS(AE_OK);
}
@@ -232,7 +236,7 @@ acpi_status
acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state)
{
- acpi_status status;
+ acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(ex_release_mutex);
@@ -249,7 +253,7 @@ acpi_ex_release_mutex(union acpi_operand
return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED);
}
- /* Sanity check -- we must have a valid thread ID */
+ /* Sanity check: we must have a valid thread ID */
if (!walk_state->thread) {
ACPI_ERROR((AE_INFO,
@@ -264,18 +268,18 @@ acpi_ex_release_mutex(union acpi_operand
*/
if ((obj_desc->mutex.owner_thread->thread_id !=
walk_state->thread->thread_id)
- && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) {
+ && (obj_desc->mutex.os_mutex != acpi_gbl_global_lock_mutex)) {
ACPI_ERROR((AE_INFO,
- "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
- (u32) walk_state->thread->thread_id,
+ "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX",
+ (unsigned long) walk_state->thread->thread_id,
acpi_ut_get_node_name(obj_desc->mutex.node),
- (u32) obj_desc->mutex.owner_thread->thread_id));
+ (unsigned long) obj_desc->mutex.owner_thread->thread_id));
return_ACPI_STATUS(AE_AML_NOT_OWNER);
}
/*
- * The sync level of the mutex must be less than or
- * equal to the current sync level
+ * The sync level of the mutex must be less than or equal to the current
+ * sync level
*/
if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
ACPI_ERROR((AE_INFO,
@@ -298,11 +302,15 @@ acpi_ex_release_mutex(union acpi_operand
acpi_ex_unlink_mutex(obj_desc);
- /* Release the mutex */
+ /* Release the mutex, special case for Global Lock */
- status = acpi_ex_system_release_mutex(obj_desc);
+ if (obj_desc->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+ status = acpi_ev_release_global_lock();
+ } else {
+ acpi_os_release_mutex(obj_desc->mutex.os_mutex);
+ }
- /* Update the mutex and walk state, restore sync_level before acquire */
+ /* Update the mutex and restore sync_level */
obj_desc->mutex.owner_thread = NULL;
walk_state->thread->current_sync_level =
@@ -326,34 +334,38 @@ acpi_ex_release_mutex(union acpi_operand
void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
{
union acpi_operand_object *next = thread->acquired_mutex_list;
- union acpi_operand_object *this;
- acpi_status status;
+ union acpi_operand_object *obj_desc;
ACPI_FUNCTION_ENTRY();
/* Traverse the list of owned mutexes, releasing each one */
while (next) {
- this = next;
- next = this->mutex.next;
+ obj_desc = next;
+ next = obj_desc->mutex.next;
+
+ obj_desc->mutex.prev = NULL;
+ obj_desc->mutex.next = NULL;
+ obj_desc->mutex.acquisition_depth = 1;
+
+ /* Release the mutex, special case for Global Lock */
- this->mutex.acquisition_depth = 1;
- this->mutex.prev = NULL;
- this->mutex.next = NULL;
+ if (obj_desc->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
- /* Release the mutex */
+ /* Ignore errors */
- status = acpi_ex_system_release_mutex(this);
- if (ACPI_FAILURE(status)) {
- continue;
+ (void)acpi_ev_release_global_lock();
+ } else {
+ acpi_os_release_mutex(obj_desc->mutex.os_mutex);
}
/* Mark mutex unowned */
- this->mutex.owner_thread = NULL;
+ obj_desc->mutex.owner_thread = NULL;
/* Update Thread sync_level (Last mutex is the important one) */
- thread->current_sync_level = this->mutex.original_sync_level;
+ thread->current_sync_level =
+ obj_desc->mutex.original_sync_level;
}
}
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 28aef3e..3b9736a 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -227,82 +227,6 @@ acpi_status acpi_ex_system_do_suspend(ac
/*******************************************************************************
*
- * FUNCTION: acpi_ex_system_acquire_mutex
- *
- * PARAMETERS: time_desc - Maximum time to wait for the mutex
- * obj_desc - The object descriptor for this op
- *
- * RETURN: Status
- *
- * DESCRIPTION: Provides an access point to perform synchronization operations
- * within the AML. This function will cause a lock to be generated
- * for the Mutex pointed to by obj_desc.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ex_system_acquire_mutex(union acpi_operand_object * time_desc,
- union acpi_operand_object * obj_desc)
-{
- acpi_status status = AE_OK;
-
- ACPI_FUNCTION_TRACE_PTR(ex_system_acquire_mutex, obj_desc);
-
- if (!obj_desc) {
- return_ACPI_STATUS(AE_BAD_PARAMETER);
- }
-
- /* Support for the _GL_ Mutex object -- go get the global lock */
-
- if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) {
- status =
- acpi_ev_acquire_global_lock((u16) time_desc->integer.value);
- return_ACPI_STATUS(status);
- }
-
- status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
- (u16) time_desc->integer.value);
- return_ACPI_STATUS(status);
-}
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_ex_system_release_mutex
- *
- * PARAMETERS: obj_desc - The object descriptor for this op
- *
- * RETURN: Status
- *
- * DESCRIPTION: Provides an access point to perform synchronization operations
- * within the AML. This operation is a request to release a
- * previously acquired Mutex. If the Mutex variable is set then
- * it will be decremented.
- *
- ******************************************************************************/
-
-acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc)
-{
- acpi_status status = AE_OK;
-
- ACPI_FUNCTION_TRACE(ex_system_release_mutex);
-
- if (!obj_desc) {
- return_ACPI_STATUS(AE_BAD_PARAMETER);
- }
-
- /* Support for the _GL_ Mutex object -- release the global lock */
-
- if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) {
- status = acpi_ev_release_global_lock();
- return_ACPI_STATUS(status);
- }
-
- acpi_os_release_mutex(obj_desc->mutex.os_mutex);
- return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_ex_system_signal_event
*
* PARAMETERS: obj_desc - The object descriptor for this op
@@ -314,7 +238,7 @@ acpi_status acpi_ex_system_release_mutex
*
******************************************************************************/
-acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc)
+acpi_status acpi_ex_system_signal_event(union acpi_operand_object * obj_desc)
{
acpi_status status = AE_OK;
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index c1c6c23..b2ef673 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -195,31 +195,27 @@ acpi_status acpi_ns_root_initialize(void
obj_desc->mutex.sync_level =
(u8) (ACPI_TO_INTEGER(val) - 1);
- if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
-
- /* Create a counting semaphore for the global lock */
+ /* Create a mutex */
+
+ status =
+ acpi_os_create_mutex(&obj_desc->mutex.
+ os_mutex);
+ if (ACPI_FAILURE(status)) {
+ acpi_ut_remove_reference(obj_desc);
+ goto unlock_and_exit;
+ }
- status =
- acpi_os_create_semaphore
- (ACPI_NO_UNIT_LIMIT, 1,
- &acpi_gbl_global_lock_semaphore);
- if (ACPI_FAILURE(status)) {
- acpi_ut_remove_reference
- (obj_desc);
- goto unlock_and_exit;
- }
+ /* Special case for ACPI Global Lock */
- /* Mark this mutex as very special */
+ if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
+ acpi_gbl_global_lock_mutex =
+ obj_desc->mutex.os_mutex;
- obj_desc->mutex.os_mutex =
- ACPI_GLOBAL_LOCK;
- } else {
- /* Create a mutex */
+ /* Create additional counting semaphore for global lock */
status =
- acpi_os_create_mutex(&obj_desc->
- mutex.
- os_mutex);
+ acpi_os_create_semaphore(1, 1,
+ &acpi_gbl_global_lock_semaphore);
if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference
(obj_desc);
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 9d3f114..af8e65f 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -158,16 +158,20 @@ static void acpi_ut_delete_internal_obj(
"***** Mutex %p, OS Mutex %p\n",
object, object->mutex.os_mutex));
- if (object->mutex.os_mutex != ACPI_GLOBAL_LOCK) {
- acpi_ex_unlink_mutex(object);
- acpi_os_delete_mutex(object->mutex.os_mutex);
- } else {
- /* Global Lock "mutex" is actually a counting semaphore */
+ if (object->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+
+ /* Global Lock has extra semaphore */
(void)
acpi_os_delete_semaphore
(acpi_gbl_global_lock_semaphore);
acpi_gbl_global_lock_semaphore = NULL;
+
+ acpi_os_delete_mutex(object->mutex.os_mutex);
+ acpi_gbl_global_lock_mutex = NULL;
+ } else {
+ acpi_ex_unlink_mutex(object);
+ acpi_os_delete_mutex(object->mutex.os_mutex);
}
break;
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 014030a..1038452 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -795,8 +795,8 @@ void acpi_ut_init_globals(void)
/* Global Lock support */
acpi_gbl_global_lock_semaphore = NULL;
+ acpi_gbl_global_lock_mutex = NULL;
acpi_gbl_global_lock_acquired = FALSE;
- acpi_gbl_global_lock_thread_count = 0;
acpi_gbl_global_lock_handle = 0;
/* Miscellaneous variables */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 06972e6..bf43184 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -197,6 +197,7 @@ ACPI_EXTERN struct acpi_mutex_info acpi_
/*
* Global lock semaphore works in conjunction with the actual HW global lock
*/
+ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex;
ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
/*
@@ -240,7 +241,6 @@ ACPI_EXTERN struct acpi_walk_state *acpi
/* Misc */
-ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
ACPI_EXTERN u32 acpi_gbl_original_mode;
ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 91586d0..f266b38 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -277,12 +277,6 @@ acpi_status acpi_ex_system_do_suspend(ac
acpi_status acpi_ex_system_do_stall(u32 time);
-acpi_status
-acpi_ex_system_acquire_mutex(union acpi_operand_object *time,
- union acpi_operand_object *obj_desc);
-
-acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc);
-
acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc);
acpi_status
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 063c4b5..d542140 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -51,7 +51,6 @@
#define ACPI_SERIALIZED 0xFF
typedef u32 acpi_mutex_handle;
-#define ACPI_GLOBAL_LOCK (acpi_semaphore) (-1)
/* Total number of aml opcodes defined */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 5/65] ACPICA: Release global lock from interrupt handler
[not found] ` <66534596d22c36a673afc16e8842de3e5d1b99c5.1164352287.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
The ACPI Global Lock interrupt handler no longer
queues the execution of a separate thread to signal the
global lock semaphore. Instead, the semaphore is signaled
directly from the interrupt handler.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evmisc.c | 51 +++++++++++++----------------------------
1 files changed, 16 insertions(+), 35 deletions(-)
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 60c7fbd..66cd71b 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -67,8 +67,6 @@ static const char *acpi_notify_value_nam
static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
-static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context);
-
static u32 acpi_ev_global_lock_handler(void *context);
/*******************************************************************************
@@ -282,43 +280,19 @@ static void ACPI_SYSTEM_XFACE acpi_ev_no
/*******************************************************************************
*
- * FUNCTION: acpi_ev_global_lock_thread
- *
- * PARAMETERS: Context - From thread interface, not used
- *
- * RETURN: None
- *
- * DESCRIPTION: Invoked by SCI interrupt handler upon acquisition of the
- * Global Lock. Simply signal all threads that are waiting
- * for the lock.
- *
- ******************************************************************************/
-
-static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
-{
- acpi_status status;
-
- /* Signal the thread that is waiting for the lock */
-
- /* Send a unit to the semaphore */
-
- status = acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore, 1);
- if (ACPI_FAILURE(status)) {
- ACPI_ERROR((AE_INFO, "Could not signal Global Lock semaphore"));
- }
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_ev_global_lock_handler
*
* PARAMETERS: Context - From thread interface, not used
*
- * RETURN: ACPI_INTERRUPT_HANDLED or ACPI_INTERRUPT_NOT_HANDLED
+ * RETURN: ACPI_INTERRUPT_HANDLED
*
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
- * release interrupt occurs. Grab the global lock and queue
- * the global lock thread for execution
+ * release interrupt occurs. Attempt to acquire the global lock,
+ * if successful, signal the thread waiting for the lock.
+ *
+ * NOTE: Assumes that the semaphore can be signaled from interrupt level. If
+ * this is not possible for some reason, a separate thread will have to be
+ * scheduled to do this.
*
******************************************************************************/
@@ -339,7 +313,14 @@ static u32 acpi_ev_global_lock_handler(v
/* Got the lock, now wake all threads waiting for it */
acpi_gbl_global_lock_acquired = TRUE;
- acpi_ev_global_lock_thread(context);
+ /* Send a unit to the semaphore */
+
+ status =
+ acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore, 1);
+ if (ACPI_FAILURE(status)) {
+ ACPI_ERROR((AE_INFO,
+ "Could not signal Global Lock semaphore"));
+ }
}
return (ACPI_INTERRUPT_HANDLED);
@@ -481,7 +462,7 @@ acpi_status acpi_ev_release_global_lock(
ACPI_FUNCTION_TRACE(ev_release_global_lock);
- /* Lock must be acquired */
+ /* Lock must be already acquired */
if (!acpi_gbl_global_lock_acquired) {
ACPI_WARNING((AE_INFO,
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 6/65] ACPICA: Cast acpi_thread_id to UINT32 for debug output only
[not found] ` <769a0a9461f482d132e563f3dc09649e4b60989d.1164352288.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/utilities/utdebug.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index bb1eaf9..72bc062 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -47,7 +47,7 @@
ACPI_MODULE_NAME("utdebug")
#ifdef ACPI_DEBUG_OUTPUT
-static acpi_thread_id acpi_gbl_prev_thread_id;
+static acpi_thread_id acpi_gbl_prev_thread_id = 0;
static char *acpi_gbl_fn_entry_str = "----Entry";
static char *acpi_gbl_fn_exit_str = "----Exit-";
@@ -181,7 +181,7 @@ acpi_ut_debug_print(u32 requested_debug_
if (ACPI_LV_THREADS & acpi_dbg_level) {
acpi_os_printf
("\n**** Context Switch from TID %X to TID %X ****\n\n",
- (u32) acpi_gbl_prev_thread_id, (u32) thread_id);
+ (unsigned)acpi_gbl_prev_thread_id, (unsigned)thread_id);
}
acpi_gbl_prev_thread_id = thread_id;
@@ -194,7 +194,7 @@ acpi_ut_debug_print(u32 requested_debug_
acpi_os_printf("%8s-%04ld ", module_name, line_number);
if (ACPI_LV_THREADS & acpi_dbg_level) {
- acpi_os_printf("[%04lX] ", thread_id);
+ acpi_os_printf("[%04X] ", (unsigned)thread_id);
}
acpi_os_printf("[%02ld] %-22.22s: ",
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 7/65] ACPICA: fix for object premature deletion
[not found] ` <c243528a18ae423700c1e6d41e027b18907189eb.1164352288.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Fix for object premature deletion after CopyObject
on Operation Region (BZ 350)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/utilities/utcopy.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 5e1a80d..5c38276 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -719,6 +719,15 @@ acpi_ut_copy_simple_object(union acpi_op
acpi_ut_add_reference(source_desc->reference.object);
break;
+ case ACPI_TYPE_REGION:
+ /*
+ * We copied the Region Handler, so we now must add a reference
+ */
+ if (dest_desc->region.handler) {
+ acpi_ut_add_reference(dest_desc->region.handler);
+ }
+ break;
+
default:
/* Nothing to do for other simple objects */
break;
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 8/65] ACPICA: Temporary fix for BankValue parameter
[not found] ` <c439b8a0815e3992b20e20f5890daf0c494f9519.1164352288.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Temporary fix for BankValue parameter of a Bank
Field to support all constant values, including Zero
and One. Must eventually be converted to a full TermArg
evaluation.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dsfield.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index a6d77ef..379dd71 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -133,7 +133,8 @@ acpi_ds_create_buffer_field(union acpi_p
}
}
- /* We could put the returned object (Node) on the object stack for later,
+ /*
+ * We could put the returned object (Node) on the object stack for later,
* but for now, we will put it in the "op" object that the parser uses,
* so we can get it again at the end of this scope
*/
@@ -514,8 +515,33 @@ acpi_ds_create_bank_field(union acpi_par
/* Third arg is the bank_value */
+ /* TBD: This arg is a term_arg, not a constant, and must be evaluated */
+
arg = arg->common.next;
- info.bank_value = (u32) arg->common.value.integer;
+
+ /* Currently, only the following constants are supported */
+
+ switch (arg->common.aml_opcode) {
+ case AML_ZERO_OP:
+ info.bank_value = 0;
+ break;
+
+ case AML_ONE_OP:
+ info.bank_value = 1;
+ break;
+
+ case AML_BYTE_OP:
+ case AML_WORD_OP:
+ case AML_DWORD_OP:
+ case AML_QWORD_OP:
+ info.bank_value = (u32) arg->common.value.integer;
+ break;
+
+ default:
+ info.bank_value = 0;
+ ACPI_ERROR((AE_INFO,
+ "Non-constant BankValue for BankField is not implemented"));
+ }
/* Fourth arg is the field flags */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 9/65] ACPICA: Update version to 20060721
[not found] ` <e3360d67bf3a2661dc3c7b2f470a263e4bea340d.1164352288.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acconfig.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 9e6c23c..fe6ccd2 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20060707
+#define ACPI_CA_VERSION 0x20060721
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 10/65] ACPICA: Update debug output
[not found] ` <13a610105f122dc0836db720d985b3e8f8be1086.1164352288.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evgpe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index c76c058..1f98818 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -570,7 +570,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_as
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
- "While evaluating GPE method [%4.4s]",
+ "while evaluating GPE method [%4.4s]",
acpi_ut_get_node_name
(local_gpe_event_info.dispatch.
method_node)));
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 12/65] ACPICA: misc fixes for new Table Manager:
[not found] ` <0faeae4ba9aef6951c161cb01955ae3d25743f16.1164352290.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbinstal.c | 35 +--
drivers/acpi/tables/tbutils.c | 544 ++++++++++++++++++++++++--------------
drivers/acpi/tables/tbxface.c | 58 +++--
drivers/acpi/utilities/utmisc.c | 8 +-
include/acpi/acconfig.h | 2 +-
include/acpi/aclocal.h | 21 +-
include/acpi/actables.h | 6 +-
include/acpi/actbl.h | 12 +-
8 files changed, 420 insertions(+), 266 deletions(-)
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 9076ca0..9e0b3ce 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -61,7 +61,7 @@ ACPI_MODULE_NAME("tbinstal")
*****************************************************************************/
acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
{
- u8 checksum;
+ acpi_status status;
ACPI_FUNCTION_TRACE(tb_verify_table);
@@ -84,17 +84,9 @@ acpi_status acpi_tb_verify_table(struct
/* Always calculate checksum, ignore bad checksum if requested */
- checksum = acpi_tb_checksum(ACPI_CAST_PTR(void, table_desc->pointer),
- table_desc->length);
-
-#if (ACPI_CHECKSUM_ABORT)
-
- if (checksum) {
- return_ACPI_STATUS(AE_BAD_CHECKSUM);
- }
-#endif
-
- return_ACPI_STATUS(AE_OK);
+ status =
+ acpi_tb_verify_checksum(table_desc->pointer, table_desc->length);
+ return_ACPI_STATUS(status);
}
/*******************************************************************************
@@ -188,7 +180,7 @@ acpi_status acpi_tb_resize_root_table_li
/* allow_resize flag is a parameter to acpi_initialize_tables */
- if (!(acpi_gbl_root_table_list.flags & ACPI_TABLE_FLAGS_ALLOW_RESIZE)) {
+ if (!(acpi_gbl_root_table_list.flags & ACPI_ROOT_ALLOW_RESIZE)) {
ACPI_ERROR((AE_INFO,
"Resize of Root Table Array is not allowed"));
return_ACPI_STATUS(AE_SUPPORT);
@@ -212,18 +204,14 @@ acpi_status acpi_tb_resize_root_table_li
acpi_gbl_root_table_list.size *
sizeof(struct acpi_table_desc));
- if (acpi_gbl_root_table_list.flags & ACPI_TABLE_ORIGIN_MASK ==
- ACPI_TABLE_ORIGIN_ALLOCATED) {
+ if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
ACPI_FREE(acpi_gbl_root_table_list.tables);
}
}
acpi_gbl_root_table_list.tables = tables;
acpi_gbl_root_table_list.size += ACPI_ROOT_TABLE_SIZE_INCREMENT;
- acpi_gbl_root_table_list.flags = (u8) (ACPI_TABLE_ORIGIN_ALLOCATED |
- (acpi_gbl_root_table_list.
- flags &
- ~ACPI_TABLE_ORIGIN_MASK));
+ acpi_gbl_root_table_list.flags |= (u8) ACPI_ROOT_ORIGIN_ALLOCATED;
return_ACPI_STATUS(AE_OK);
}
@@ -348,8 +336,7 @@ void acpi_tb_terminate(void)
* Delete the root table array if allocated locally. Array cannot be
* mapped, so we don't need to check for that flag.
*/
- if ((acpi_gbl_root_table_list.flags & ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_ALLOCATED) {
+ if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
ACPI_FREE(acpi_gbl_root_table_list.tables);
}
@@ -497,7 +484,7 @@ u8 acpi_tb_is_table_loaded(acpi_native_u
if (table_index < acpi_gbl_root_table_list.count) {
is_loaded = (u8)
(acpi_gbl_root_table_list.tables[table_index].
- flags & ACPI_TABLE_FLAGS_LOADED);
+ flags & ACPI_TABLE_IS_LOADED);
}
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
@@ -524,10 +511,10 @@ void acpi_tb_set_table_loaded_flag(acpi_
if (table_index < acpi_gbl_root_table_list.count) {
if (is_loaded) {
acpi_gbl_root_table_list.tables[table_index].flags |=
- ACPI_TABLE_FLAGS_LOADED;
+ ACPI_TABLE_IS_LOADED;
} else {
acpi_gbl_root_table_list.tables[table_index].flags &=
- ~ACPI_TABLE_FLAGS_LOADED;
+ ~ACPI_TABLE_IS_LOADED;
}
}
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 3620ac5..2f4ab75 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -48,11 +48,52 @@
ACPI_MODULE_NAME("tbutils")
/* Local prototypes */
-static void acpi_tb_parse_fadt(struct acpi_table_fadt *fadt, u8 flags);
+static void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
+
+static void acpi_tb_convert_fadt(void);
+
+static void
+acpi_tb_install_table(acpi_physical_address address,
+ u8 flags, char *signature, acpi_native_uint table_index);
static void inline
acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
- u8 bit_width, acpi_physical_address address);
+ u8 bit_width, u64 address);
+
+/* Table used for conversion of FADT to common format */
+
+typedef struct acpi_fadt_conversion {
+ u8 target;
+ u8 source;
+ u8 length;
+
+} acpi_fadt_conversion;
+
+static struct acpi_fadt_conversion fadt_conversion_table[] = {
+ {ACPI_FADT_OFFSET(xpm1a_event_block),
+ ACPI_FADT_OFFSET(pm1a_event_block),
+ ACPI_FADT_OFFSET(pm1_event_length)},
+ {ACPI_FADT_OFFSET(xpm1b_event_block),
+ ACPI_FADT_OFFSET(pm1b_event_block),
+ ACPI_FADT_OFFSET(pm1_event_length)},
+ {ACPI_FADT_OFFSET(xpm1a_control_block),
+ ACPI_FADT_OFFSET(pm1a_control_block),
+ ACPI_FADT_OFFSET(pm1_control_length)},
+ {ACPI_FADT_OFFSET(xpm1b_control_block),
+ ACPI_FADT_OFFSET(pm1b_control_block),
+ ACPI_FADT_OFFSET(pm1_control_length)},
+ {ACPI_FADT_OFFSET(xpm2_control_block),
+ ACPI_FADT_OFFSET(pm2_control_block),
+ ACPI_FADT_OFFSET(pm2_control_length)},
+ {ACPI_FADT_OFFSET(xpm_timer_block), ACPI_FADT_OFFSET(pm_timer_block),
+ ACPI_FADT_OFFSET(pm_timer_length)},
+ {ACPI_FADT_OFFSET(xgpe0_block), ACPI_FADT_OFFSET(gpe0_block),
+ ACPI_FADT_OFFSET(gpe0_block_length)},
+ {ACPI_FADT_OFFSET(xgpe1_block), ACPI_FADT_OFFSET(gpe1_block),
+ ACPI_FADT_OFFSET(gpe1_block_length)}
+};
+
+#define ACPI_FADT_CONVERSION_ENTRIES (sizeof (fadt_conversion_table) / sizeof (struct acpi_fadt_conversion))
/*******************************************************************************
*
@@ -63,7 +104,7 @@ acpi_tb_init_generic_address(struct acpi
*
* RETURN: None
*
- * DESCRIPTION: Print an ACPI table header
+ * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP.
*
******************************************************************************/
@@ -72,12 +113,32 @@ acpi_tb_print_table_header(acpi_physical
struct acpi_table_header *header)
{
- ACPI_INFO((AE_INFO,
- "%4.4s @ 0x%p Length 0x%04X (v%3.3d %6.6s %8.8s 0x%08X %4.4s 0x%08X)",
- header->signature, ACPI_CAST_PTR(void, address),
- header->length, header->revision, header->oem_id,
- header->oem_table_id, header->oem_revision,
- header->asl_compiler_id, header->asl_compiler_revision));
+ if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) {
+
+ /* FACS only has signature and length fields of common table header */
+
+ ACPI_INFO((AE_INFO, "%4.4s @ 0x%p/0x%04X",
+ header->signature, ACPI_CAST_PTR(void, address),
+ header->length));
+ } else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) {
+
+ /* RSDP has no common fields */
+
+ ACPI_INFO((AE_INFO, "RSDP @ 0x%p/0x%04X (v%3.3d %6.6s)",
+ ACPI_CAST_PTR(void, address),
+ (((struct acpi_table_rsdp *)header)->revision > 0) ?
+ ((struct acpi_table_rsdp *)header)->length : 20,
+ ((struct acpi_table_rsdp *)header)->revision,
+ ((struct acpi_table_rsdp *)header)->oem_id));
+ } else {
+ ACPI_INFO((AE_INFO,
+ "%4.4s @ 0x%p/0x%04X (v%3.3d %6.6s %8.8s 0x%08X %4.4s 0x%08X)",
+ header->signature, ACPI_CAST_PTR(void, address),
+ header->length, header->revision, header->oem_id,
+ header->oem_table_id, header->oem_revision,
+ header->asl_compiler_id,
+ header->asl_compiler_revision));
+ }
}
/*******************************************************************************
@@ -96,7 +157,7 @@ acpi_tb_print_table_header(acpi_physical
static void inline
acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
- u8 bit_width, acpi_physical_address address)
+ u8 bit_width, u64 address)
{
ACPI_STORE_ADDRESS(new_gas_struct->address, address);
@@ -108,6 +169,45 @@ acpi_tb_init_generic_address(struct acpi
/*******************************************************************************
*
+ * FUNCTION: acpi_tb_validate_checksum
+ *
+ * PARAMETERS: Table - ACPI table to verify
+ * Length - Length of entire table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns
+ * exception on bad checksum.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
+{
+ u8 checksum;
+
+ /* Compute the checksum on the table */
+
+ checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length);
+
+ /* Checksum ok? (should be zero) */
+
+ if (checksum) {
+ ACPI_WARNING((AE_INFO,
+ "Incorrect checksum in table [%4.4s] - %2.2X, should be %2.2X",
+ table->signature, table->checksum,
+ (u8) (table->checksum - checksum)));
+
+#if (ACPI_CHECKSUM_ABORT)
+
+ return (AE_BAD_CHECKSUM);
+#endif
+ }
+
+ return (AE_OK);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_tb_checksum
*
* PARAMETERS: Buffer - Pointer to memory region to be checked
@@ -135,24 +235,38 @@ u8 acpi_tb_checksum(u8 * buffer, acpi_na
*
* FUNCTION: acpi_tb_convert_fadt
*
- * PARAMETERS: Fadt - FADT table to be converted
+ * PARAMETERS: None, uses acpi_gbl_FADT
*
* RETURN: None
*
- * DESCRIPTION: Converts a BIOS supplied ACPI 1.0 FADT to a local
- * ACPI 2.0 FADT. If the BIOS supplied a 2.0 FADT then it is simply
- * copied to the local FADT. The ACPI CA software uses this
- * local FADT. Thus a significant amount of special #ifdef
- * type codeing is saved.
+ * DESCRIPTION: Converts all versions of the FADT to a common internal format.
+ *
+ * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must contain
+ * a copy of the actual FADT.
+ *
+ * ACPICA will use the "X" fields of the FADT for all addresses.
+ *
+ * "X" fields are optional extensions to the original V1.0 fields. Even if
+ * they are present in the structure, they can be optionally not used by
+ * setting them to zero. Therefore, we must selectively expand V1.0 fields
+ * if the corresponding X field is zero.
+ *
+ * For ACPI 1.0 FADTs, all address fields are expanded to the corresponding
+ * "X" fields.
+ *
+ * For ACPI 2.0 FADTs, any "X" fields that are NULL are filled in by
+ * expanding the corresponding ACPI 1.0 field.
*
******************************************************************************/
-void acpi_tb_convert_fadt(struct acpi_table_fadt *fadt)
+static void acpi_tb_convert_fadt(void)
{
+ u8 pm1_register_length;
+ struct acpi_generic_address *target;
+ acpi_native_uint i;
+
+ /* Expand the FACS and DSDT addresses as necessary */
- /*
- * Convert table pointers to 64-bit fields
- */
if (!acpi_gbl_FADT.Xfacs) {
acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
}
@@ -162,62 +276,49 @@ void acpi_tb_convert_fadt(struct acpi_ta
}
/*
- * Convert the V1.0 block addresses to V2.0 GAS structures
+ * Expand the V1.0 addresses to the "X" generic address structs,
+ * as necessary.
*/
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xpm1a_event_block,
- acpi_gbl_FADT.pm1_event_length,
- (acpi_physical_address) acpi_gbl_FADT.
- pm1a_event_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xpm1b_event_block,
- acpi_gbl_FADT.pm1_event_length,
- (acpi_physical_address) acpi_gbl_FADT.
- pm1b_event_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xpm1a_control_block,
- acpi_gbl_FADT.pm1_control_length,
- (acpi_physical_address) acpi_gbl_FADT.
- pm1a_control_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xpm1b_control_block,
- acpi_gbl_FADT.pm1_control_length,
- (acpi_physical_address) acpi_gbl_FADT.
- pm1b_control_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xpm2_control_block,
- acpi_gbl_FADT.pm2_control_length,
- (acpi_physical_address) acpi_gbl_FADT.
- pm2_control_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xpm_timer_block,
- acpi_gbl_FADT.pm_timer_length,
- (acpi_physical_address) acpi_gbl_FADT.
- pm_timer_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xgpe0_block, 0,
- (acpi_physical_address) acpi_gbl_FADT.
- gpe0_block);
- acpi_tb_init_generic_address(&acpi_gbl_FADT.xgpe1_block, 0,
- (acpi_physical_address) acpi_gbl_FADT.
- gpe1_block);
+ for (i = 0; i < ACPI_FADT_CONVERSION_ENTRIES; i++) {
+ target =
+ ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
+ fadt_conversion_table[i].target);
+
+ if (!target->address) {
+ acpi_tb_init_generic_address(target,
+ *ACPI_ADD_PTR(u8,
+ &acpi_gbl_FADT,
+ fadt_conversion_table
+ [i].length),
+ *ACPI_ADD_PTR(u64,
+ &acpi_gbl_FADT,
+ fadt_conversion_table
+ [i].source));
+ }
+ }
/*
- * Create separate GAS structs for the PM1 Enable registers
+ * Calculate separate GAS structs for the PM1 Enable registers.
+ * These addresses do not appear (directly) in the FADT, so it is
+ * useful to calculate them once, here.
*/
+ pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
+
+ /* PM1A is required */
+
acpi_tb_init_generic_address(&acpi_gbl_xpm1a_enable,
- (u8) ACPI_DIV_2(acpi_gbl_FADT.
- pm1_event_length),
- (acpi_physical_address)
- (acpi_gbl_FADT.xpm1a_event_block.address +
- ACPI_DIV_2(acpi_gbl_FADT.
- pm1_event_length)));
+ pm1_register_length,
+ (u64) (acpi_gbl_FADT.xpm1a_event_block.
+ address + pm1_register_length));
+
+ /* PM1B is optional; leave null if not present */
- /*
- * PM1B is optional; leave null if not present
- */
if (acpi_gbl_FADT.xpm1b_event_block.address) {
acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
- (u8) ACPI_DIV_2(acpi_gbl_FADT.
- pm1_event_length),
- (acpi_physical_address)
- (acpi_gbl_FADT.xpm1b_event_block.
- address +
- ACPI_DIV_2(acpi_gbl_FADT.
- pm1_event_length)));
+ pm1_register_length,
+ (u64) (acpi_gbl_FADT.
+ xpm1b_event_block.address +
+ pm1_register_length));
}
/* Global FADT is the new common V2.0 FADT */
@@ -227,84 +328,132 @@ void acpi_tb_convert_fadt(struct acpi_ta
/*******************************************************************************
*
- * FUNCTION: acpi_tb_parse_fadt
+ * FUNCTION: acpi_tb_install_table
*
- * PARAMETERS: Fadt - Pointer to FADT table
- * Flags - Flags
+ * PARAMETERS: Address - Physical address of DSDT or FACS
+ * Flags - Flags
+ * Signature - Table signature, NULL if no need to
+ * match
+ * table_index - Index into root table array
*
- * RETURN: none
+ * RETURN: None
*
- * DESCRIPTION: This function is called to initialise the FADT, DSDT and FACS
- * tables (FADT contains the addresses of the DSDT and FACS)
+ * DESCRIPTION: Install an ACPI table into the global data structure.
*
******************************************************************************/
-static void acpi_tb_parse_fadt(struct acpi_table_fadt *fadt, u8 flags)
+static void
+acpi_tb_install_table(acpi_physical_address address,
+ u8 flags, char *signature, acpi_native_uint table_index)
{
- acpi_physical_address dsdt_address =
- (acpi_physical_address) fadt->Xdsdt;
- acpi_physical_address facs_address =
- (acpi_physical_address) fadt->Xfacs;
struct acpi_table_header *table;
- if (!dsdt_address) {
- goto no_dsdt;
+ if (!address) {
+ ACPI_ERROR((AE_INFO,
+ "Null physical address for ACPI table [%s]",
+ signature));
+ return;
}
- table =
- acpi_os_map_memory(dsdt_address, sizeof(struct acpi_table_header));
+ /* Map just the table header */
+
+ table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
if (!table) {
- goto no_dsdt;
+ return;
+ }
+
+ /* If a particular signature is expected, signature must match */
+
+ if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) {
+ ACPI_ERROR((AE_INFO,
+ "Invalid signature 0x%X for ACPI table [%s]",
+ *ACPI_CAST_PTR(u32, table->signature), signature));
+ goto unmap_and_exit;
}
- /* Initialize the DSDT table */
+ /* Initialize the table entry */
+
+ acpi_gbl_root_table_list.tables[table_index].address = address;
+ acpi_gbl_root_table_list.tables[table_index].length = table->length;
+ acpi_gbl_root_table_list.tables[table_index].flags = flags;
ACPI_MOVE_32_TO_32(&
- (acpi_gbl_root_table_list.
- tables[ACPI_TABLE_INDEX_DSDT].signature),
- ACPI_SIG_DSDT);
+ (acpi_gbl_root_table_list.tables[table_index].
+ signature), table->signature);
- acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].address =
- dsdt_address;
- acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].length =
- table->length;
- acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].flags = flags;
+ acpi_tb_print_table_header(address, table);
- acpi_tb_print_table_header(dsdt_address, table);
+ if (table_index == ACPI_TABLE_INDEX_DSDT) {
- /* Global integer width is based upon revision of the DSDT */
+ /* Global integer width is based upon revision of the DSDT */
- acpi_ut_set_integer_width(table->revision);
+ acpi_ut_set_integer_width(table->revision);
+ }
+
+ unmap_and_exit:
acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
+}
- no_dsdt:
- if (!facs_address) {
- return;
- }
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_parse_fadt
+ *
+ * PARAMETERS: table_index - Index for the FADT
+ * Flags - Flags
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize the FADT, DSDT and FACS tables
+ * (FADT contains the addresses of the DSDT and FACS)
+ *
+ ******************************************************************************/
+
+static void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
+{
+ u32 length;
+ struct acpi_table_header *table;
+
+ /*
+ * Special case for the FADT because of multiple versions and the fact
+ * that it contains pointers to both the DSDT and FACS tables.
+ *
+ * Get a local copy of the FADT and convert it to a common format
+ * Map entire FADT, assumed to be smaller than one page.
+ */
+ length = acpi_gbl_root_table_list.tables[table_index].length;
table =
- acpi_os_map_memory(facs_address, sizeof(struct acpi_table_header));
+ acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index].
+ address, length);
if (!table) {
return;
}
- /* Initialize the FACS table */
+ /*
+ * Validate the FADT checksum before we copy the table. Ignore
+ * checksum error as we want to try to get the DSDT and FACS.
+ */
+ (void)acpi_tb_verify_checksum(table, length);
- ACPI_MOVE_32_TO_32(&
- (acpi_gbl_root_table_list.
- tables[ACPI_TABLE_INDEX_FACS].signature),
- ACPI_SIG_FACS);
+ /* Copy the entire FADT locally */
- acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_FACS].address =
- facs_address;
- acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_FACS].length =
- table->length;
- acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_FACS].flags = flags;
+ ACPI_MEMSET(&acpi_gbl_FADT, sizeof(struct acpi_table_fadt), 0);
- ACPI_INFO((AE_INFO, "%4.4s @ 0x%p",
- table->signature, ACPI_CAST_PTR(void, facs_address)));
+ ACPI_MEMCPY(&acpi_gbl_FADT, table,
+ ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
+ acpi_os_unmap_memory(table, length);
- acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
+ /* Convert local FADT to the common internal format */
+
+ acpi_tb_convert_fadt();
+
+ /* Extract the DSDT and FACS tables from the FADT */
+
+ acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
+ flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
+
+ acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
+ flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
}
/*******************************************************************************
@@ -325,20 +474,33 @@ static void acpi_tb_parse_fadt(struct ac
*
******************************************************************************/
-acpi_status acpi_tb_parse_root_table(struct acpi_table_rsdp *rsdp, u8 flags)
+acpi_status
+acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
{
+ struct acpi_table_rsdp *rsdp;
+ acpi_native_uint table_entry_size;
+ acpi_native_uint i;
+ u32 table_count;
struct acpi_table_header *table;
acpi_physical_address address;
u32 length;
u8 *table_entry;
- acpi_native_uint i;
- acpi_native_uint pointer_size;
- u32 table_count;
- u8 checksum;
acpi_status status;
ACPI_FUNCTION_TRACE(tb_parse_root_table);
+ /*
+ * Map the entire RSDP and extract the address of the RSDT or XSDT
+ */
+ rsdp = acpi_os_map_memory(rsdp_address, sizeof(struct acpi_table_rsdp));
+ if (!rsdp) {
+ return_ACPI_STATUS(AE_NO_MEMORY);
+ }
+
+ acpi_tb_print_table_header(rsdp_address,
+ ACPI_CAST_PTR(struct acpi_table_header,
+ rsdp));
+
/* Differentiate between RSDT and XSDT root tables */
if (rsdp->revision > 1 && rsdp->xsdt_physical_address) {
@@ -347,22 +509,30 @@ acpi_status acpi_tb_parse_root_table(str
* XSDT if the revision is > 1 and the XSDT pointer is present, as per
* the ACPI specification.
*/
- address = (acpi_native_uint) rsdp->xsdt_physical_address;
- pointer_size = sizeof(u64);
+ address = (acpi_physical_address) rsdp->xsdt_physical_address;
+ table_entry_size = sizeof(u64);
} else {
/* Root table is an RSDT (32-bit physical addresses) */
- address = (acpi_native_uint) rsdp->rsdt_physical_address;
- pointer_size = sizeof(u32);
+ address = (acpi_physical_address) rsdp->rsdt_physical_address;
+ table_entry_size = sizeof(u32);
}
- /* Map the table header to get the full table length */
+ /*
+ * It is not possible to map more than one entry in some environments,
+ * so unmap the RSDP here before mapping other tables
+ */
+ acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
+
+ /* Map the RSDT/XSDT table header to get the full table length */
table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
if (!table) {
- return (AE_NO_MEMORY);
+ return_ACPI_STATUS(AE_NO_MEMORY);
}
+ acpi_tb_print_table_header(address, table);
+
/* Get the length of the full table, verify length and map entire table */
length = table->length;
@@ -371,48 +541,45 @@ acpi_status acpi_tb_parse_root_table(str
if (length < sizeof(struct acpi_table_header)) {
ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT",
length));
- return (AE_INVALID_TABLE_LENGTH);
+ return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
}
table = acpi_os_map_memory(address, length);
if (!table) {
- return (AE_NO_MEMORY);
+ return_ACPI_STATUS(AE_NO_MEMORY);
}
/* Validate the root table checksum */
- checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length);
-#if (ACPI_CHECKSUM_ABORT)
-
- if (checksum) {
+ status = acpi_tb_verify_checksum(table, length);
+ if (ACPI_FAILURE(status)) {
acpi_os_unmap_memory(table, length);
- return (AE_BAD_CHECKSUM);
+ return_ACPI_STATUS(status);
}
-#endif
-
- acpi_tb_print_table_header(address, table);
/* Calculate the number of tables described in the root table */
table_count =
- (table->length - sizeof(struct acpi_table_header)) / pointer_size;
-
- /* Setup loop */
+ (table->length -
+ sizeof(struct acpi_table_header)) / table_entry_size;
+ /*
+ * First two entries in the table array are reserved for the DSDT and FACS,
+ * which are not actually present in the RSDT/XSDT - they come from the FADT
+ */
table_entry =
ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header);
acpi_gbl_root_table_list.count = 2;
/*
- * Initialize the ACPI table entries
- * First two entries in the table array are reserved for the DSDT and FACS
+ * Initialize the root table array from the RSDT/XSDT
*/
- for (i = 0; i < table_count; ++i, table_entry += pointer_size) {
-
- /* Ensure there is room for another table entry */
-
+ for (i = 0; i < table_count; i++) {
if (acpi_gbl_root_table_list.count >=
acpi_gbl_root_table_list.size) {
+
+ /* There is no more room in the root table array, attempt resize */
+
status = acpi_tb_resize_root_table_list();
if (ACPI_FAILURE(status)) {
ACPI_WARNING((AE_INFO,
@@ -425,20 +592,34 @@ acpi_status acpi_tb_parse_root_table(str
}
}
- /* Get the physical address (32-bit for RSDT, 64-bit for XSDT) */
-
- if (pointer_size == sizeof(u32)) {
+ /*
+ * Get the table physical address (32-bit for RSDT, 64-bit for XSDT)
+ */
+ if ((table_entry_size == sizeof(u32)) ||
+ (sizeof(acpi_physical_address) == sizeof(u32))) {
+ /*
+ * 32-bit platform, RSDT: Move 32-bit to 32-bit
+ * 32-bit platform, XSDT: Truncate 64-bit to 32-bit
+ * 64-bit platform, RSDT: Expand 32-bit to 64-bit
+ *
+ * Note: Addresses are 32-bit aligned in both RSDT and XSDT
+ */
acpi_gbl_root_table_list.
tables[acpi_gbl_root_table_list.count].address =
(acpi_physical_address) (*ACPI_CAST_PTR
(u32, table_entry));
} else {
- acpi_gbl_root_table_list.
- tables[acpi_gbl_root_table_list.count].address =
- (acpi_physical_address) (*ACPI_CAST_PTR
- (u64, table_entry));
+ /*
+ * 64-bit platform, XSDT: Move 64-bit to 64-bit
+ *
+ * Note: 64-bit addresses are only 32-bit aligned in the XSDT
+ */
+ ACPI_MOVE_64_TO_64(&acpi_gbl_root_table_list.
+ tables[acpi_gbl_root_table_list.
+ count].address, table_entry);
}
+ table_entry += table_entry_size;
acpi_gbl_root_table_list.count++;
}
@@ -448,59 +629,20 @@ acpi_status acpi_tb_parse_root_table(str
*/
acpi_os_unmap_memory(table, length);
- /* Initialize all tables other than the DSDT and FACS */
-
+ /*
+ * Complete the initialization of the root table array by examining
+ * the header of each table
+ */
for (i = 2; i < acpi_gbl_root_table_list.count; i++) {
- address = acpi_gbl_root_table_list.tables[i].address;
- length = sizeof(struct acpi_table_header);
-
- table = acpi_os_map_memory(address, length);
- if (!table) {
- continue;
- }
-
- acpi_gbl_root_table_list.tables[i].length = table->length;
- acpi_gbl_root_table_list.tables[i].flags = flags;
-
- ACPI_MOVE_32_TO_32(&
- (acpi_gbl_root_table_list.tables[i].
- signature), table->signature);
-
- acpi_tb_print_table_header(address, table);
-
- /*
- * Special case for the FADT because of multiple versions -
- * get a local copy and convert to common format
- */
- if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FADT)) {
- acpi_os_unmap_memory(table, length);
- length = table->length;
-
- table = acpi_os_map_memory(address, length);
- if (!table) {
- continue;
- }
-
- /* Copy the entire FADT locally */
-
- ACPI_MEMCPY(&acpi_gbl_FADT, table,
- ACPI_MIN(table->length,
- sizeof(struct acpi_table_fadt)));
+ acpi_tb_install_table(acpi_gbl_root_table_list.tables[i].
+ address, flags, NULL, i);
- /* Small table means old revision, convert to new */
+ /* Special case for FADT - get the DSDT and FACS */
- if (table->length < sizeof(struct acpi_table_fadt)) {
- acpi_tb_convert_fadt(ACPI_CAST_PTR
- (struct acpi_table_fadt,
- table));
- }
-
- /* Unmap original FADT */
-
- acpi_os_unmap_memory(table, length);
- acpi_tb_parse_fadt(&acpi_gbl_FADT, flags);
- } else {
- acpi_os_unmap_memory(table, length);
+ if (ACPI_COMPARE_NAME
+ (&acpi_gbl_root_table_list.tables[i].signature,
+ ACPI_SIG_FADT)) {
+ acpi_tb_parse_fadt(i, flags);
}
}
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 61faaa6..c697d6d 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -82,9 +82,8 @@ acpi_status
acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
u32 initial_table_count, u8 allow_resize)
{
- acpi_physical_address address;
+ acpi_physical_address rsdp_address;
acpi_status status;
- struct acpi_table_rsdp *rsdp;
ACPI_FUNCTION_TRACE(acpi_initialize_tables);
@@ -94,7 +93,7 @@ acpi_initialize_tables(struct acpi_table
*/
if (!initial_table_array) {
acpi_gbl_root_table_list.size = initial_table_count;
- acpi_gbl_root_table_list.flags = ACPI_TABLE_FLAGS_ALLOW_RESIZE;
+ acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE;
status = acpi_tb_resize_root_table_list();
if (ACPI_FAILURE(status)) {
@@ -103,37 +102,33 @@ acpi_initialize_tables(struct acpi_table
} else {
/* Root Table Array has been statically allocated by the host */
+ ACPI_MEMSET(initial_table_array,
+ initial_table_count *
+ sizeof(struct acpi_table_desc), 0);
+
acpi_gbl_root_table_list.tables = initial_table_array;
acpi_gbl_root_table_list.size = initial_table_count;
- acpi_gbl_root_table_list.flags = ACPI_TABLE_ORIGIN_UNKNOWN;
+ acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN;
if (allow_resize) {
- acpi_gbl_root_table_list.flags =
- ACPI_TABLE_FLAGS_ALLOW_RESIZE;
+ acpi_gbl_root_table_list.flags |=
+ ACPI_ROOT_ALLOW_RESIZE;
}
}
- /* Get the RSDP and map it */
+ /* Get the address of the RSDP */
- address = acpi_os_get_root_pointer();
- if (!address) {
+ rsdp_address = acpi_os_get_root_pointer();
+ if (!rsdp_address) {
return_ACPI_STATUS(AE_NOT_FOUND);
}
- rsdp = acpi_os_map_memory(address, sizeof(struct acpi_table_rsdp));
- if (!rsdp) {
- return_ACPI_STATUS(AE_NO_MEMORY);
- }
-
- ACPI_INFO((AE_INFO, "%.8s @ 0x%p",
- rsdp->signature, ACPI_CAST_PTR(void, address)));
-
/*
* Get the root table (RSDT or XSDT) and extract all entries to the local
* Root Table Array. This array contains the information of the RSDT/XSDT
* in a common, more useable format.
*/
- status = acpi_tb_parse_root_table(rsdp, ACPI_TABLE_ORIGIN_MAPPED);
- acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
+ status =
+ acpi_tb_parse_root_table(rsdp_address, ACPI_TABLE_ORIGIN_MAPPED);
return_ACPI_STATUS(status);
}
@@ -164,8 +159,7 @@ acpi_status acpi_reallocate_root_table(v
* Only reallocate the root table if the host provided a static buffer
* for the table array in the call to acpi_initialize_tables.
*/
- if ((acpi_gbl_root_table_list.flags & ACPI_TABLE_ORIGIN_MASK) !=
- ACPI_TABLE_ORIGIN_UNKNOWN) {
+ if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
return_ACPI_STATUS(AE_SUPPORT);
}
@@ -185,7 +179,7 @@ acpi_status acpi_reallocate_root_table(v
acpi_gbl_root_table_list.size = acpi_gbl_root_table_list.count;
acpi_gbl_root_table_list.tables = tables;
acpi_gbl_root_table_list.flags =
- ACPI_TABLE_ORIGIN_ALLOCATED | ACPI_TABLE_FLAGS_ALLOW_RESIZE;
+ ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE;
return_ACPI_STATUS(AE_OK);
}
@@ -217,6 +211,12 @@ acpi_get_table_header(char *signature,
acpi_native_uint i;
acpi_native_uint j;
+ /* Parameter validation */
+
+ if (!signature || !out_table_header) {
+ return (AE_BAD_PARAMETER);
+ }
+
/*
* Walk the root table list
*/
@@ -237,7 +237,7 @@ acpi_get_table_header(char *signature,
acpi_gbl_root_table_list.tables[i].
flags & ACPI_TABLE_ORIGIN_MASK);
- if (!out_table_header) {
+ if (!(*out_table_header)) {
return (AE_NO_MEMORY);
}
@@ -270,6 +270,12 @@ acpi_get_table(char *signature,
acpi_native_uint j;
acpi_status status;
+ /* Parameter validation */
+
+ if (!signature || !out_table) {
+ return (AE_BAD_PARAMETER);
+ }
+
/*
* Walk the root table list
*/
@@ -318,6 +324,12 @@ acpi_get_table_by_index(acpi_native_uint
ACPI_FUNCTION_TRACE(acpi_get_table_by_index);
+ /* Parameter validation */
+
+ if (!table) {
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
+
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
/* Validate index */
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 47dcf82..4b03051 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -996,9 +996,13 @@ acpi_ut_info(char *module_name, u32 line
{
va_list args;
- acpi_os_printf("ACPI (%s-%04d): ", module_name, line_number);
+ /*
+ * Removed module_name, line_number, and acpica version, not needed
+ * for info output
+ */
+ acpi_os_printf("ACPI: ");
va_start(args, format);
acpi_os_vprintf(format, args);
- acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
+ acpi_os_printf("\n");
}
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index cf712df..ed181bc 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20060823
+#define ACPI_CA_VERSION 0x20060828
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 0f12fec..a870484 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -227,6 +227,16 @@ struct acpi_table_desc {
u8 flags;
};
+/* Flags for above */
+
+#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
+#define ACPI_TABLE_ORIGIN_MAPPED (1)
+#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
+#define ACPI_TABLE_ORIGIN_MASK (3)
+#define ACPI_TABLE_IS_LOADED (4)
+
+/* One internal RSDT for table management */
+
struct acpi_internal_rsdt {
struct acpi_table_desc *tables;
u32 count;
@@ -234,14 +244,11 @@ struct acpi_internal_rsdt {
u8 flags;
};
-/* Flags for both structs above */
+/* Flags for above */
-#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
-#define ACPI_TABLE_ORIGIN_MAPPED (1)
-#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
-#define ACPI_TABLE_ORIGIN_MASK (3)
-#define ACPI_TABLE_FLAGS_LOADED (4)
-#define ACPI_TABLE_FLAGS_ALLOW_RESIZE (8)
+#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
+#define ACPI_ROOT_ORIGIN_ALLOCATED (1)
+#define ACPI_ROOT_ALLOW_RESIZE (2)
/* Predefined (fixed) table indexes */
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 1737a2f..9183de1 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -94,9 +94,11 @@ acpi_tb_print_table_header(acpi_physical
u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length);
-void acpi_tb_convert_fadt(struct acpi_table_fadt *fadt);
+acpi_status
+acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
-acpi_status acpi_tb_parse_root_table(struct acpi_table_rsdp *rsdp, u8 flags);
+acpi_status
+acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
void *acpi_tb_map(acpi_physical_address address, u32 length, u32 flags);
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index b455f54..c55939e 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -199,8 +199,8 @@ struct acpi_table_fadt {
u32 pm1b_control_block; /* Port address of Power Mgt 1b Control Reg Blk */
u32 pm2_control_block; /* Port address of Power Mgt 2 Control Reg Blk */
u32 pm_timer_block; /* Port address of Power Mgt Timer Ctrl Reg Blk */
- u32 gpe0_block; /* Port addr of General Purpose acpi_event 0 Reg Blk */
- u32 gpe1_block; /* Port addr of General Purpose acpi_event 1 Reg Blk */
+ u32 gpe0_block; /* Port addr of General Purpose Event 0 Reg Blk */
+ u32 gpe1_block; /* Port addr of General Purpose Event 1 Reg Blk */
u8 pm1_event_length; /* Byte Length of ports at pm1_x_evt_blk */
u8 pm1_control_length; /* Byte Length of ports at pm1_x_cnt_blk */
u8 pm2_control_length; /* Byte Length of ports at pm2_cnt_blk */
@@ -226,14 +226,14 @@ struct acpi_table_fadt {
u8 reserved4[3]; /* These three bytes must be zero */
u64 Xfacs; /* 64-bit physical address of FACS */
u64 Xdsdt; /* 64-bit physical address of DSDT */
- struct acpi_generic_address xpm1a_event_block; /* Extended Power Mgt 1a acpi_event Reg Blk address */
- struct acpi_generic_address xpm1b_event_block; /* Extended Power Mgt 1b acpi_event Reg Blk address */
+ struct acpi_generic_address xpm1a_event_block; /* Extended Power Mgt 1a Event Reg Blk address */
+ struct acpi_generic_address xpm1b_event_block; /* Extended Power Mgt 1b Event Reg Blk address */
struct acpi_generic_address xpm1a_control_block; /* Extended Power Mgt 1a Control Reg Blk address */
struct acpi_generic_address xpm1b_control_block; /* Extended Power Mgt 1b Control Reg Blk address */
struct acpi_generic_address xpm2_control_block; /* Extended Power Mgt 2 Control Reg Blk address */
struct acpi_generic_address xpm_timer_block; /* Extended Power Mgt Timer Ctrl Reg Blk address */
- struct acpi_generic_address xgpe0_block; /* Extended General Purpose acpi_event 0 Reg Blk address */
- struct acpi_generic_address xgpe1_block; /* Extended General Purpose acpi_event 1 Reg Blk address */
+ struct acpi_generic_address xgpe0_block; /* Extended General Purpose Event 0 Reg Blk address */
+ struct acpi_generic_address xgpe1_block; /* Extended General Purpose Event 1 Reg Blk address */
};
/* FADT flags */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 13/65] ACPICA: Update comments for individual table fields
[not found] ` <c0f2f417d70ac411c7085aa64ffc44787562e1ca.1164352291.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
comments only
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/actbl.h | 64 +++++++++++++++++++++++++-------------------------
1 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index c55939e..aed49a5 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -56,7 +56,7 @@
#define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */
#define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */
#define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */
-#define ACPI_RSDP_NAME "RSDP"
+#define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */
/*
* All tables and structures must be byte-packed to match the ACPI
@@ -185,55 +185,55 @@ struct acpi_table_fadt {
struct acpi_table_header header; /* Common ACPI table header */
u32 facs; /* 32-bit physical address of FACS */
u32 dsdt; /* 32-bit physical address of DSDT */
- u8 model; /* System Interrupt Model (ACPI 1.0) not used in ACPI 2.0+ */
+ u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */
u16 sci_interrupt; /* System vector of SCI interrupt */
- u32 smi_command; /* Port address of SMI command port */
+ u32 smi_command; /* 32-bit Port address of SMI command port */
u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
u8 S4bios_request; /* Value to write to SMI CMD to enter S4BIOS state */
u8 pstate_control; /* Processor performance state control */
- u32 pm1a_event_block; /* Port address of Power Mgt 1a Event Reg Blk */
- u32 pm1b_event_block; /* Port address of Power Mgt 1b Event Reg Blk */
- u32 pm1a_control_block; /* Port address of Power Mgt 1a Control Reg Blk */
- u32 pm1b_control_block; /* Port address of Power Mgt 1b Control Reg Blk */
- u32 pm2_control_block; /* Port address of Power Mgt 2 Control Reg Blk */
- u32 pm_timer_block; /* Port address of Power Mgt Timer Ctrl Reg Blk */
- u32 gpe0_block; /* Port addr of General Purpose Event 0 Reg Blk */
- u32 gpe1_block; /* Port addr of General Purpose Event 1 Reg Blk */
- u8 pm1_event_length; /* Byte Length of ports at pm1_x_evt_blk */
- u8 pm1_control_length; /* Byte Length of ports at pm1_x_cnt_blk */
- u8 pm2_control_length; /* Byte Length of ports at pm2_cnt_blk */
- u8 pm_timer_length; /* Byte Length of ports at pm_tmr_blk */
- u8 gpe0_block_length; /* Byte Length of ports at gpe0_blk */
- u8 gpe1_block_length; /* Byte Length of ports at gpe1_blk */
- u8 gpe1_base; /* Offset in gpe model where gpe1 events start */
- u8 cst_control; /* Support for the _CST object and C States change notification. */
+ u32 pm1a_event_block; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */
+ u32 pm1b_event_block; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */
+ u32 pm1a_control_block; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */
+ u32 pm1b_control_block; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */
+ u32 pm2_control_block; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */
+ u32 pm_timer_block; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
+ u32 gpe0_block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */
+ u32 gpe1_block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */
+ u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */
+ u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */
+ u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */
+ u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */
+ u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */
+ u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */
+ u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */
+ u8 cst_control; /* Support for the _CST object and C States change notification */
u16 C2latency; /* Worst case HW latency to enter/exit C2 state */
u16 C3latency; /* Worst case HW latency to enter/exit C3 state */
u16 flush_size; /* Processor's memory cache line width, in bytes */
u16 flush_stride; /* Number of flush strides that need to be read */
- u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg */
- u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register. */
+ u8 duty_offset; /* Processor duty cycle index in processor's P_CNT reg */
+ u8 duty_width; /* Processor duty cycle value bit width in P_CNT register. */
u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */
u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* Index to century in RTC CMOS RAM */
u16 boot_flags; /* IA-PC Boot Architecture Flags. See Table 5-10 for description */
u8 reserved; /* Reserved, must be zero */
- u32 flags; /* Miscellaneous flag bits */
- struct acpi_generic_address reset_register; /* Reset register address in GAS format */
+ u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
+ struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
u8 reset_value; /* Value to write to the reset_register port to reset the system */
- u8 reserved4[3]; /* These three bytes must be zero */
+ u8 reserved4[3]; /* Reserved, must be zero */
u64 Xfacs; /* 64-bit physical address of FACS */
u64 Xdsdt; /* 64-bit physical address of DSDT */
- struct acpi_generic_address xpm1a_event_block; /* Extended Power Mgt 1a Event Reg Blk address */
- struct acpi_generic_address xpm1b_event_block; /* Extended Power Mgt 1b Event Reg Blk address */
- struct acpi_generic_address xpm1a_control_block; /* Extended Power Mgt 1a Control Reg Blk address */
- struct acpi_generic_address xpm1b_control_block; /* Extended Power Mgt 1b Control Reg Blk address */
- struct acpi_generic_address xpm2_control_block; /* Extended Power Mgt 2 Control Reg Blk address */
- struct acpi_generic_address xpm_timer_block; /* Extended Power Mgt Timer Ctrl Reg Blk address */
- struct acpi_generic_address xgpe0_block; /* Extended General Purpose Event 0 Reg Blk address */
- struct acpi_generic_address xgpe1_block; /* Extended General Purpose Event 1 Reg Blk address */
+ struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
+ struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
+ struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
+ struct acpi_generic_address xpm1b_control_block; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
+ struct acpi_generic_address xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
+ struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
+ struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
+ struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
};
/* FADT flags */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 14/65] ACPICA: Fix for FADT conversion in 64-bit mode
[not found] ` <7f4682ef0ee3349060e1d9c037d6c97d111c05b0.1164352291.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbutils.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 2f4ab75..77c7e87 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -131,6 +131,8 @@ acpi_tb_print_table_header(acpi_physical
((struct acpi_table_rsdp *)header)->revision,
((struct acpi_table_rsdp *)header)->oem_id));
} else {
+ /* Standard ACPI table with full common header */
+
ACPI_INFO((AE_INFO,
"%4.4s @ 0x%p/0x%04X (v%3.3d %6.6s %8.8s 0x%08X %4.4s 0x%08X)",
header->signature, ACPI_CAST_PTR(void, address),
@@ -160,7 +162,7 @@ acpi_tb_init_generic_address(struct acpi
u8 bit_width, u64 address)
{
- ACPI_STORE_ADDRESS(new_gas_struct->address, address);
+ ACPI_MOVE_64_TO_64(&new_gas_struct->address, &address);
new_gas_struct->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
new_gas_struct->bit_width = bit_width;
new_gas_struct->bit_offset = 0;
@@ -284,13 +286,15 @@ static void acpi_tb_convert_fadt(void)
ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
fadt_conversion_table[i].target);
+ /* Expand only if the X target is null */
+
if (!target->address) {
acpi_tb_init_generic_address(target,
*ACPI_ADD_PTR(u8,
&acpi_gbl_FADT,
fadt_conversion_table
[i].length),
- *ACPI_ADD_PTR(u64,
+ *ACPI_ADD_PTR(u32,
&acpi_gbl_FADT,
fadt_conversion_table
[i].source));
@@ -301,6 +305,10 @@ static void acpi_tb_convert_fadt(void)
* Calculate separate GAS structs for the PM1 Enable registers.
* These addresses do not appear (directly) in the FADT, so it is
* useful to calculate them once, here.
+ *
+ * The PM event blocks are split into two register blocks, first is the
+ * PM Status Register block, followed immediately by the PM Enable Register
+ * block. Each is of length (pm1_event_length/2)
*/
pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
@@ -308,17 +316,16 @@ static void acpi_tb_convert_fadt(void)
acpi_tb_init_generic_address(&acpi_gbl_xpm1a_enable,
pm1_register_length,
- (u64) (acpi_gbl_FADT.xpm1a_event_block.
- address + pm1_register_length));
+ (acpi_gbl_FADT.xpm1a_event_block.address +
+ pm1_register_length));
/* PM1B is optional; leave null if not present */
if (acpi_gbl_FADT.xpm1b_event_block.address) {
acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
pm1_register_length,
- (u64) (acpi_gbl_FADT.
- xpm1b_event_block.address +
- pm1_register_length));
+ (acpi_gbl_FADT.xpm1b_event_block.
+ address + pm1_register_length));
}
/* Global FADT is the new common V2.0 FADT */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 15/65] ACPICA: Lint changes
[not found] ` <ec604624c47740c2516cf8a4f2fa33a04956b810.1164352291.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
[not found] ` <1164352776767-git-send-email-len.brown@intel.com>
0 siblings, 1 reply; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Lint changes
Move RSDT/XSDT pointer extraction to separate function
Warning on 32-bit platforms if XSDT pointers use more than 32 bits.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbutils.c | 121 ++++++++++++++++++++++++++++-------------
drivers/acpi/tables/tbxface.c | 4 +-
2 files changed, 84 insertions(+), 41 deletions(-)
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 77c7e87..8e44f83 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -60,6 +60,10 @@ static void inline
acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
u8 bit_width, u64 address);
+static acpi_physical_address
+acpi_tb_get_root_table_entry(u8 * table_entry,
+ acpi_native_uint table_entry_size);
+
/* Table used for conversion of FADT to common format */
typedef struct acpi_fadt_conversion {
@@ -126,10 +130,14 @@ acpi_tb_print_table_header(acpi_physical
ACPI_INFO((AE_INFO, "RSDP @ 0x%p/0x%04X (v%3.3d %6.6s)",
ACPI_CAST_PTR(void, address),
- (((struct acpi_table_rsdp *)header)->revision > 0) ?
- ((struct acpi_table_rsdp *)header)->length : 20,
- ((struct acpi_table_rsdp *)header)->revision,
- ((struct acpi_table_rsdp *)header)->oem_id));
+ (ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
+ revision >
+ 0) ? ACPI_CAST_PTR(struct acpi_table_rsdp,
+ header)->length : 20,
+ ACPI_CAST_PTR(struct acpi_table_rsdp,
+ header)->revision,
+ ACPI_CAST_PTR(struct acpi_table_rsdp,
+ header)->oem_id));
} else {
/* Standard ACPI table with full common header */
@@ -278,8 +286,8 @@ static void acpi_tb_convert_fadt(void)
}
/*
- * Expand the V1.0 addresses to the "X" generic address structs,
- * as necessary.
+ * Expand the 32-bit V1.0 addresses to the 64-bit "X" generic address
+ * structures as necessary.
*/
for (i = 0; i < ACPI_FADT_CONVERSION_ENTRIES; i++) {
target =
@@ -294,10 +302,11 @@ static void acpi_tb_convert_fadt(void)
&acpi_gbl_FADT,
fadt_conversion_table
[i].length),
- *ACPI_ADD_PTR(u32,
- &acpi_gbl_FADT,
- fadt_conversion_table
- [i].source));
+ (u64) * ACPI_ADD_PTR(u32,
+ &acpi_gbl_FADT,
+ fadt_conversion_table
+ [i].
+ source));
}
}
@@ -444,7 +453,7 @@ static void acpi_tb_parse_fadt(acpi_nati
/* Copy the entire FADT locally */
- ACPI_MEMSET(&acpi_gbl_FADT, sizeof(struct acpi_table_fadt), 0);
+ ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
ACPI_MEMCPY(&acpi_gbl_FADT, table,
ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
@@ -465,6 +474,61 @@ static void acpi_tb_parse_fadt(acpi_nati
/*******************************************************************************
*
+ * FUNCTION: acpi_tb_get_root_table_entry
+ *
+ * PARAMETERS: table_entry - Pointer to the RSDT/XSDT table entry
+ * table_entry_size - sizeof 32 or 64 (RSDT or XSDT)
+ *
+ * RETURN: Physical address extracted from the root table
+ *
+ * DESCRIPTION: Get one root table entry. Handles 32-bit and 64-bit cases on
+ * both 32-bit and 64-bit platforms
+ *
+ * NOTE: acpi_physical_address is 32-bit on 32-bit platforms, 64-bit on
+ * 64-bit platforms.
+ *
+ ******************************************************************************/
+
+static acpi_physical_address
+acpi_tb_get_root_table_entry(u8 * table_entry,
+ acpi_native_uint table_entry_size)
+{
+ u64 address64;
+
+ /*
+ * Get the table physical address (32-bit for RSDT, 64-bit for XSDT):
+ * Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT
+ */
+ if (table_entry_size == sizeof(u32)) {
+ /*
+ * 32-bit platform, RSDT: Return 32-bit table entry
+ * 64-bit platform, RSDT: Expand 32-bit to 64-bit and return
+ */
+ return ((acpi_physical_address)
+ (*ACPI_CAST_PTR(u32, table_entry)));
+ } else {
+ /*
+ * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return
+ * 64-bit platform, XSDT: Move (unaligned) 64-bit to local, return 64-bit
+ */
+ ACPI_MOVE_64_TO_64(&address64, table_entry);
+
+#if ACPI_MACHINE_WIDTH == 32
+ if (address64 > ACPI_UINT32_MAX) {
+
+ /* Will truncate 64-bit address to 32 bits */
+
+ ACPI_WARNING((AE_INFO,
+ "64-bit Physical Address in XSDT is too large (%8.8X%8.8X), truncating",
+ ACPI_FORMAT_UINT64(address64)));
+ }
+#endif
+ return ((acpi_physical_address) (address64));
+ }
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_tb_parse_root_table
*
* PARAMETERS: Rsdp - Pointer to the RSDP
@@ -567,8 +631,8 @@ acpi_tb_parse_root_table(acpi_physical_a
/* Calculate the number of tables described in the root table */
table_count =
- (table->length -
- sizeof(struct acpi_table_header)) / table_entry_size;
+ (u32) ((table->length -
+ sizeof(struct acpi_table_header)) / table_entry_size);
/*
* First two entries in the table array are reserved for the DSDT and FACS,
@@ -599,32 +663,11 @@ acpi_tb_parse_root_table(acpi_physical_a
}
}
- /*
- * Get the table physical address (32-bit for RSDT, 64-bit for XSDT)
- */
- if ((table_entry_size == sizeof(u32)) ||
- (sizeof(acpi_physical_address) == sizeof(u32))) {
- /*
- * 32-bit platform, RSDT: Move 32-bit to 32-bit
- * 32-bit platform, XSDT: Truncate 64-bit to 32-bit
- * 64-bit platform, RSDT: Expand 32-bit to 64-bit
- *
- * Note: Addresses are 32-bit aligned in both RSDT and XSDT
- */
- acpi_gbl_root_table_list.
- tables[acpi_gbl_root_table_list.count].address =
- (acpi_physical_address) (*ACPI_CAST_PTR
- (u32, table_entry));
- } else {
- /*
- * 64-bit platform, XSDT: Move 64-bit to 64-bit
- *
- * Note: 64-bit addresses are only 32-bit aligned in the XSDT
- */
- ACPI_MOVE_64_TO_64(&acpi_gbl_root_table_list.
- tables[acpi_gbl_root_table_list.
- count].address, table_entry);
- }
+ /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
+
+ acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count].
+ address =
+ acpi_tb_get_root_table_entry(table_entry, table_entry_size);
table_entry += table_entry_size;
acpi_gbl_root_table_list.count++;
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index c697d6d..6a401c2 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -102,9 +102,9 @@ acpi_initialize_tables(struct acpi_table
} else {
/* Root Table Array has been statically allocated by the host */
- ACPI_MEMSET(initial_table_array,
+ ACPI_MEMSET(initial_table_array, 0,
initial_table_count *
- sizeof(struct acpi_table_desc), 0);
+ sizeof(struct acpi_table_desc));
acpi_gbl_root_table_list.tables = initial_table_array;
acpi_gbl_root_table_list.size = initial_table_count;
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 17/65] ACPICA: Add support for DMAR table
[not found] ` <9e50272927495c4480e6476b686d1960b804c5ad.1164352293.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Implement support for ACPI DMAR table (DMA
Remapping Table) in header files and disassembler.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acdisasm.h | 14 +++++++--
include/acpi/actbl1.h | 73 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+), 3 deletions(-)
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 9a7d692..722583a 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -97,9 +97,10 @@ typedef const struct acpi_dmtable_info {
#define ACPI_DMT_CHKSUM 20
#define ACPI_DMT_SPACEID 21
#define ACPI_DMT_GAS 22
-#define ACPI_DMT_MADT 23
-#define ACPI_DMT_SRAT 24
-#define ACPI_DMT_EXIT 25
+#define ACPI_DMT_DMAR 23
+#define ACPI_DMT_MADT 24
+#define ACPI_DMT_SRAT 25
+#define ACPI_DMT_EXIT 26
typedef
void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
@@ -147,6 +148,11 @@ extern struct acpi_dmtable_info acpi_dm_
extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
@@ -201,6 +207,8 @@ void acpi_dm_dump_asf(struct acpi_table_
void acpi_dm_dump_cpep(struct acpi_table_header *table);
+void acpi_dm_dump_dmar(struct acpi_table_header *table);
+
void acpi_dm_dump_fadt(struct acpi_table_header *table);
void acpi_dm_dump_srat(struct acpi_table_header *table);
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 8ae30b7..515d82c 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -61,6 +61,7 @@
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
+#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
@@ -228,6 +229,78 @@ struct acpi_table_dbgp {
/*******************************************************************************
*
+ * DMAR - DMA Remapping table
+ *
+ ******************************************************************************/
+
+struct acpi_table_dmar {
+ struct acpi_table_header header; /* Common ACPI table header */
+ u8 width; /* Host Address Width */
+ u8 reserved[11];
+};
+
+/* DMAR subtable header */
+
+struct acpi_dmar_header {
+ u16 type;
+ u16 length;
+ u8 flags;
+ u8 reserved[3];
+};
+
+/* Values for subtable type in struct acpi_dmar_header */
+
+enum acpi_dmar_type {
+ ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
+ ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
+ ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+struct acpi_dmar_device_scope {
+ u8 entry_type;
+ u8 length;
+ u8 segment;
+ u8 bus;
+};
+
+/* Values for entry_type in struct acpi_dmar_device_scope */
+
+enum acpi_dmar_scope_type {
+ ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
+ ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
+ ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
+ ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+};
+
+/*
+ * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
+ */
+
+/* 0: Hardware Unit Definition */
+
+struct acpi_dmar_hardware_unit {
+ struct acpi_dmar_header header;
+ u64 address; /* Register Base Address */
+};
+
+/* Flags */
+
+#define ACPI_DMAR_INCLUDE_ALL (1)
+
+/* 1: Reserved Memory Defininition */
+
+struct acpi_dmar_reserved_memory {
+ struct acpi_dmar_header header;
+ u64 address; /* 4_k aligned base address */
+ u64 end_address; /* 4_k aligned limit address */
+};
+
+/* Flags */
+
+#define ACPI_DMAR_ALLOW_ALL (1)
+
+/*******************************************************************************
+ *
* ECDT - Embedded Controller Boot Resources Table
*
******************************************************************************/
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 18/65] ACPICA: Add acpi_gpe_count global to track the number of GPE events
[not found] ` <37c6794383d6d3c1c816a1ebedd0bcc49510c5d8.1164352293.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evgpe.c | 2 ++
drivers/acpi/utilities/utglobal.c | 2 ++
include/acpi/acglobal.h | 4 ++++
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index 1f98818..d9f71dd 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -618,6 +618,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
ACPI_FUNCTION_TRACE(ev_gpe_dispatch);
+ acpi_gpe_count++;
+
/*
* If edge-triggered, clear the GPE status bit now. Note that
* level-triggered events are cleared after the GPE is serviced.
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 8809306..a524e75 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -720,6 +720,7 @@ void acpi_ut_init_globals(void)
/* GPE support */
+ acpi_gpe_count = 0;
acpi_gbl_gpe_xrupt_list_head = NULL;
acpi_gbl_gpe_fadt_blocks[0] = NULL;
acpi_gbl_gpe_fadt_blocks[1] = NULL;
@@ -779,3 +780,4 @@ void acpi_ut_init_globals(void)
ACPI_EXPORT_SYMBOL(acpi_dbg_level)
ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
+ACPI_EXPORT_SYMBOL(acpi_gpe_count)
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 88ad8f4..019b86e 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -80,6 +80,10 @@ extern u32 acpi_dbg_layer;
extern u32 acpi_gbl_nesting_level;
+/* Event counters */
+
+ACPI_EXTERN u32 acpi_gpe_count;
+
/* Support for dynamic control method tracing mechanism */
ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 19/65] ACPICA: Disable all wake GPEs after first one recieved
[not found] ` <023eab64321d171542941abe76d9248d11a52778.1164352293.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Change for GPE support: when a wake GPE is
received, now all wake GPEs are immediately disabled to
prevent the waking GPE from firing again, and to prevent
other wake GPEs from interrupting the wake process.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evgpe.c | 78 +++++++++---------------------------------
include/acpi/acglobal.h | 68 ++++++++++++++++++-------------------
include/acpi/actypes.h | 6 +---
3 files changed, 51 insertions(+), 101 deletions(-)
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index d9f71dd..df92c9e 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -635,20 +635,23 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
}
}
- /* Save current system state */
-
- if (acpi_gbl_system_awake_and_running) {
- ACPI_SET_BIT(gpe_event_info->flags, ACPI_GPE_SYSTEM_RUNNING);
- } else {
- ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_SYSTEM_RUNNING);
+ if (!acpi_gbl_system_awake_and_running) {
+ /*
+ * We just woke up because of a wake GPE. Disable any further GPEs
+ * until we are fully up and running (Only wake GPEs should be enabled
+ * at this time, but we just brute-force disable them all.)
+ * 1) We must disable this particular wake GPE so it won't fire again
+ * 2) We want to disable all wake GPEs, since we are now awake
+ */
+ (void)acpi_hw_disable_all_gpes();
}
/*
- * Dispatch the GPE to either an installed handler, or the control
- * method associated with this GPE (_Lxx or _Exx).
- * If a handler exists, we invoke it and do not attempt to run the method.
- * If there is neither a handler nor a method, we disable the level to
- * prevent further events from coming in here.
+ * Dispatch the GPE to either an installed handler, or the control method
+ * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
+ * it and do not attempt to run the method. If there is neither a handler
+ * nor a method, we disable this GPE to prevent further such pointless
+ * events from firing.
*/
switch (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) {
case ACPI_GPE_DISPATCH_HANDLER:
@@ -679,8 +682,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
case ACPI_GPE_DISPATCH_METHOD:
/*
- * Disable GPE, so it doesn't keep firing before the method has a
- * chance to run.
+ * Disable the GPE, so it doesn't keep firing before the method has a
+ * chance to run (it runs asynchronously with interrupts enabled).
*/
status = acpi_ev_disable_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
@@ -713,7 +716,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
gpe_number));
/*
- * Disable the GPE. The GPE will remain disabled until the ACPI
+ * Disable the GPE. The GPE will remain disabled until the ACPI
* Core Subsystem is restarted, or a handler is installed.
*/
status = acpi_ev_disable_gpe(gpe_event_info);
@@ -728,50 +731,3 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
return_UINT32(ACPI_INTERRUPT_HANDLED);
}
-
-#ifdef ACPI_GPE_NOTIFY_CHECK
-/*******************************************************************************
- * TBD: NOT USED, PROTOTYPE ONLY AND WILL PROBABLY BE REMOVED
- *
- * FUNCTION: acpi_ev_check_for_wake_only_gpe
- *
- * PARAMETERS: gpe_event_info - info for this GPE
- *
- * RETURN: Status
- *
- * DESCRIPTION: Determine if a a GPE is "wake-only".
- *
- * Called from Notify() code in interpreter when a "DeviceWake"
- * Notify comes in.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info)
-{
- acpi_status status;
-
- ACPI_FUNCTION_TRACE(ev_check_for_wake_only_gpe);
-
- if ((gpe_event_info) && /* Only >0 for _Lxx/_Exx */
- ((gpe_event_info->flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) { /* System state at GPE time */
- /* This must be a wake-only GPE, disable it */
-
- status = acpi_ev_disable_gpe(gpe_event_info);
-
- /* Set GPE to wake-only. Do not change wake disabled/enabled status */
-
- acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);
-
- ACPI_INFO((AE_INFO,
- "GPE %p was updated from wake/run to wake-only",
- gpe_event_info));
-
- /* This was a wake-only GPE */
-
- return_ACPI_STATUS(AE_WAKE_ONLY_GPE);
- }
-
- return_ACPI_STATUS(AE_OK);
-}
-#endif
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 019b86e..a2b8340 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -58,41 +58,6 @@
#define ACPI_INIT_GLOBAL(a,b) a
#endif
-/*
- * Keep local copies of these FADT-based registers. NOTE: These globals
- * are first in this file for alignment reasons on 64-bit systems.
- */
-ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
-ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
-
-/*****************************************************************************
- *
- * Debug support
- *
- ****************************************************************************/
-
-/* Runtime configuration of debug print levels */
-
-extern u32 acpi_dbg_level;
-extern u32 acpi_dbg_layer;
-
-/* Procedure nesting level for debug output */
-
-extern u32 acpi_gbl_nesting_level;
-
-/* Event counters */
-
-ACPI_EXTERN u32 acpi_gpe_count;
-
-/* Support for dynamic control method tracing mechanism */
-
-ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
-ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
-ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
-ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
-ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
-ACPI_EXTERN u32 acpi_gbl_trace_flags;
-
/*****************************************************************************
*
* Runtime configuration (static defaults that can be overriden at runtime)
@@ -139,6 +104,34 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl
/*****************************************************************************
*
+ * Debug support
+ *
+ ****************************************************************************/
+
+/* Runtime configuration of debug print levels */
+
+extern u32 acpi_dbg_level;
+extern u32 acpi_dbg_layer;
+
+/* Procedure nesting level for debug output */
+
+extern u32 acpi_gbl_nesting_level;
+
+/* Event counters */
+
+ACPI_EXTERN u32 acpi_gpe_count;
+
+/* Support for dynamic control method tracing mechanism */
+
+ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
+ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
+ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
+ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
+ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
+ACPI_EXTERN u32 acpi_gbl_trace_flags;
+
+/*****************************************************************************
+ *
* ACPI Table globals
*
****************************************************************************/
@@ -153,6 +146,11 @@ ACPI_EXTERN struct acpi_internal_rsdt ac
ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
extern acpi_native_uint acpi_gbl_permanent_mmap;
+/* These addresses are calculated from FADT address values */
+
+ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
+ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
+
/*
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index b0cdee6..fe9eb0e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -592,7 +592,7 @@ typedef u32 acpi_event_status;
* | | | +--- Type of dispatch -- to method, handler, or none
* | | +--- Enabled for runtime?
* | +--- Enabled for wake?
- * +--- System state when GPE ocurred (running/waking)
+ * +--- Unused
*/
#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
@@ -618,10 +618,6 @@ typedef u32 acpi_event_status;
#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
-#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
-#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
-#define ACPI_GPE_SYSTEM_WAKING (u8) 0x00
-
/*
* Flags for GPE and Lock interfaces
*/
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 20/65] ACPICA: Fix unalignment in acpi_ut_repair_name
[not found] ` <fca6a1e6bd5f675d123948f9a4ca07defe24fad5.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Update interface to acpi_ut_repair_name() to avoid
alignment issues on IA64
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/namespace/nsdump.c | 2 +-
drivers/acpi/namespace/nssearch.c | 3 ++-
drivers/acpi/utilities/utglobal.c | 2 +-
drivers/acpi/utilities/utmisc.c | 11 +++++------
include/acpi/acutils.h | 2 +-
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index d72df66..da88834 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -205,7 +205,7 @@ acpi_ns_dump_one_object(acpi_handle obj_
if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
this_node->name.integer =
- acpi_ut_repair_name(this_node->name.integer);
+ acpi_ut_repair_name(this_node->name.ascii);
ACPI_WARNING((AE_INFO, "Invalid ACPI Name %08X",
this_node->name.integer));
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c
index 500e2bb..566f0a4 100644
--- a/drivers/acpi/namespace/nssearch.c
+++ b/drivers/acpi/namespace/nssearch.c
@@ -321,7 +321,8 @@ acpi_ns_search_and_enter(u32 target_name
* even though there are a few bad names.
*/
if (!acpi_ut_valid_acpi_name(target_name)) {
- target_name = acpi_ut_repair_name(target_name);
+ target_name =
+ acpi_ut_repair_name(ACPI_CAST_PTR(char, &target_name));
/* Report warning only if in strict mode or debug mode */
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index a524e75..855bc8f 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -566,7 +566,7 @@ char *acpi_ut_get_node_name(void *object
/* Name must be a valid ACPI name */
if (!acpi_ut_valid_acpi_name(node->name.integer)) {
- node->name.integer = acpi_ut_repair_name(node->name.integer);
+ node->name.integer = acpi_ut_repair_name(node->name.ascii);
}
/* Return the name */
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 4b03051..36d8815 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -582,26 +582,25 @@ u8 acpi_ut_valid_acpi_name(u32 name)
*
******************************************************************************/
-acpi_name acpi_ut_repair_name(acpi_name name)
+acpi_name acpi_ut_repair_name(char *name)
{
- char *name_ptr = ACPI_CAST_PTR(char, &name);
- char new_name[ACPI_NAME_SIZE];
acpi_native_uint i;
+ char new_name[ACPI_NAME_SIZE];
for (i = 0; i < ACPI_NAME_SIZE; i++) {
- new_name[i] = name_ptr[i];
+ new_name[i] = name[i];
/*
* Replace a bad character with something printable, yet technically
* still invalid. This prevents any collisions with existing "good"
* names in the namespace.
*/
- if (!acpi_ut_valid_acpi_char(name_ptr[i], i)) {
+ if (!acpi_ut_valid_acpi_char(name[i], i)) {
new_name[i] = '*';
}
}
- return (*ACPI_CAST_PTR(u32, new_name));
+ return (*(u32 *) new_name);
}
/*******************************************************************************
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index ba039ea..beb07ac 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -470,7 +470,7 @@ void acpi_ut_print_string(char *string,
u8 acpi_ut_valid_acpi_name(u32 name);
-acpi_name acpi_ut_repair_name(acpi_name name);
+acpi_name acpi_ut_repair_name(char *name);
u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 21/65] ACPICA: Store GPE number instead of bitmask
[not found] ` <50ae4c050de1b4052c93bb7c2501877e2ae2d383.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Bob Moore, Len Brown
From: Robert Moore <robert.moore@intel.com>
Update internal GPE data structure to simplify
debug, use gpe_number instead of register bitmask.
Signed-off-by: Bob Moore <bob.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evgpe.c | 7 ++++---
drivers/acpi/events/evgpeblk.c | 3 ++-
drivers/acpi/hardware/hwgpe.c | 13 +++++++++++--
drivers/acpi/utilities/utglobal.c | 2 --
include/acpi/acglobal.h | 1 -
include/acpi/aclocal.h | 2 +-
6 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index df92c9e..35933be 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -121,7 +121,9 @@ acpi_ev_update_gpe_enable_masks(struct a
if (!gpe_register_info) {
return_ACPI_STATUS(AE_NOT_EXIST);
}
- register_bit = gpe_event_info->register_bit;
+ register_bit = (u8)
+ (1 <<
+ (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));
/* 1) Disable case. Simply clear all enable bits */
@@ -458,8 +460,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_x
/* Examine one GPE bit */
- if (enabled_status_byte &
- acpi_gbl_decode_to8bit[j]) {
+ if (enabled_status_byte & (1 << j)) {
/*
* Found an active GPE. Dispatch the event to a handler
* or method.
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index bb0eb50..8a6f01a 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -819,7 +819,8 @@ acpi_ev_create_gpe_info_blocks(struct ac
/* Init the event_info for each GPE within this register */
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
- this_event->register_bit = acpi_gbl_decode_to8bit[j];
+ this_event->gpe_number =
+ (u8) (this_register->base_gpe_number + j);
this_event->register_info = this_register;
this_event++;
}
diff --git a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c
index 608a3a6..3d548b5 100644
--- a/drivers/acpi/hardware/hwgpe.c
+++ b/drivers/acpi/hardware/hwgpe.c
@@ -105,14 +105,20 @@ acpi_hw_write_gpe_enable_reg(struct acpi
acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
{
acpi_status status;
+ u8 register_bit;
ACPI_FUNCTION_ENTRY();
+ register_bit = (u8)
+ (1 <<
+ (gpe_event_info->gpe_number -
+ gpe_event_info->register_info->base_gpe_number));
+
/*
* Write a one to the appropriate bit in the status register to
* clear this GPE.
*/
- status = acpi_hw_low_level_write(8, gpe_event_info->register_bit,
+ status = acpi_hw_low_level_write(8, register_bit,
&gpe_event_info->register_info->
status_address);
@@ -155,7 +161,10 @@ acpi_hw_get_gpe_status(struct acpi_gpe_e
/* Get the register bitmask for this GPE */
- register_bit = gpe_event_info->register_bit;
+ register_bit = (u8)
+ (1 <<
+ (gpe_event_info->gpe_number -
+ gpe_event_info->register_info->base_gpe_number));
/* GPE currently enabled? (enabled for runtime?) */
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 855bc8f..5b83f86 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -164,8 +164,6 @@ u32 acpi_gbl_startup_flags = 0;
u8 acpi_gbl_shutdown = TRUE;
-const u8 acpi_gbl_decode_to8bit[8] = { 1, 2, 4, 8, 16, 32, 64, 128 };
-
const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = {
"\\_S0_",
"\\_S1_",
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index a2b8340..3ebf42d 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -239,7 +239,6 @@ ACPI_EXTERN u8 acpi_gbl_system_awake_and
extern u8 acpi_gbl_shutdown;
extern u32 acpi_gbl_startup_flags;
-extern const u8 acpi_gbl_decode_to8bit[8];
extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
extern const char *acpi_gbl_highest_dstate_names[4];
extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index a870484..553763d 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -367,7 +367,7 @@ struct acpi_gpe_event_info {
union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */
struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
u8 flags; /* Misc info about this GPE */
- u8 register_bit; /* This GPE bit within the register */
+ u8 gpe_number; /* This GPE */
};
/* Information about a GPE register pair, one per each status/enable pair in an array */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 22/65] ACPICA: Split acpi_format_exception into two parts
[not found] ` <03a5f10642d95d738db56368dff73566bb313a54.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Split acpi_format_exception into two parts. New
function is acpi_ut_verify_exception and will be used to
verify exception codes returned by user.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/utilities/utglobal.c | 118 +++++++++++-------------------------
drivers/acpi/utilities/utmisc.c | 73 +++++++++++++++++++++++
include/acpi/acglobal.h | 8 +++
include/acpi/acutils.h | 2 +
4 files changed, 119 insertions(+), 82 deletions(-)
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 5b83f86..509a85d 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -52,87 +52,6 @@ ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
/*******************************************************************************
*
- * FUNCTION: acpi_format_exception
- *
- * PARAMETERS: Status - The acpi_status code to be formatted
- *
- * RETURN: A string containing the exception text. A valid pointer is
- * always returned.
- *
- * DESCRIPTION: This function translates an ACPI exception into an ASCII string.
- *
- ******************************************************************************/
-const char *acpi_format_exception(acpi_status status)
-{
- acpi_status sub_status;
- const char *exception = NULL;
-
- ACPI_FUNCTION_ENTRY();
-
- /*
- * Status is composed of two parts, a "type" and an actual code
- */
- sub_status = (status & ~AE_CODE_MASK);
-
- switch (status & AE_CODE_MASK) {
- case AE_CODE_ENVIRONMENTAL:
-
- if (sub_status <= AE_CODE_ENV_MAX) {
- exception = acpi_gbl_exception_names_env[sub_status];
- }
- break;
-
- case AE_CODE_PROGRAMMER:
-
- if (sub_status <= AE_CODE_PGM_MAX) {
- exception =
- acpi_gbl_exception_names_pgm[sub_status - 1];
- }
- break;
-
- case AE_CODE_ACPI_TABLES:
-
- if (sub_status <= AE_CODE_TBL_MAX) {
- exception =
- acpi_gbl_exception_names_tbl[sub_status - 1];
- }
- break;
-
- case AE_CODE_AML:
-
- if (sub_status <= AE_CODE_AML_MAX) {
- exception =
- acpi_gbl_exception_names_aml[sub_status - 1];
- }
- break;
-
- case AE_CODE_CONTROL:
-
- if (sub_status <= AE_CODE_CTRL_MAX) {
- exception =
- acpi_gbl_exception_names_ctrl[sub_status - 1];
- }
- break;
-
- default:
- break;
- }
-
- if (!exception) {
-
- /* Exception code was not recognized */
-
- ACPI_ERROR((AE_INFO,
- "Unknown exception code: 0x%8.8X", status));
-
- exception = "UNKNOWN_STATUS_CODE";
- }
-
- return (ACPI_CAST_PTR(const char, exception));
-}
-
-/*******************************************************************************
- *
* Static global variable initialization.
*
******************************************************************************/
@@ -182,10 +101,45 @@ const char *acpi_gbl_highest_dstate_name
/*******************************************************************************
*
- * Namespace globals
+ * FUNCTION: acpi_format_exception
+ *
+ * PARAMETERS: Status - The acpi_status code to be formatted
+ *
+ * RETURN: A string containing the exception text. A valid pointer is
+ * always returned.
+ *
+ * DESCRIPTION: This function translates an ACPI exception into an ASCII string
+ * It is here instead of utxface.c so it is always present.
*
******************************************************************************/
+const char *acpi_format_exception(acpi_status status)
+{
+ const char *exception = NULL;
+
+ ACPI_FUNCTION_ENTRY();
+
+ exception = acpi_ut_validate_exception(status);
+ if (!exception) {
+
+ /* Exception code was not recognized */
+
+ ACPI_ERROR((AE_INFO,
+ "Unknown exception code: 0x%8.8X", status));
+
+ exception = "UNKNOWN_STATUS_CODE";
+ }
+
+ return (ACPI_CAST_PTR(const char, exception));
+}
+
+ACPI_EXPORT_SYMBOL(acpi_format_exception)
+
+/*******************************************************************************
+ *
+ * Namespace globals
+ *
+ ******************************************************************************/
/*
* Predefined ACPI Names (Built-in to the Interpreter)
*
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 36d8815..e437bc7 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -51,6 +51,78 @@ ACPI_MODULE_NAME("utmisc")
/*******************************************************************************
*
+ * FUNCTION: acpi_ut_validate_exception
+ *
+ * PARAMETERS: Status - The acpi_status code to be formatted
+ *
+ * RETURN: A string containing the exception text. NULL if exception is
+ * not valid.
+ *
+ * DESCRIPTION: This function validates and translates an ACPI exception into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+const char *acpi_ut_validate_exception(acpi_status status)
+{
+ acpi_status sub_status;
+ const char *exception = NULL;
+
+ ACPI_FUNCTION_ENTRY();
+
+ /*
+ * Status is composed of two parts, a "type" and an actual code
+ */
+ sub_status = (status & ~AE_CODE_MASK);
+
+ switch (status & AE_CODE_MASK) {
+ case AE_CODE_ENVIRONMENTAL:
+
+ if (sub_status <= AE_CODE_ENV_MAX) {
+ exception = acpi_gbl_exception_names_env[sub_status];
+ }
+ break;
+
+ case AE_CODE_PROGRAMMER:
+
+ if (sub_status <= AE_CODE_PGM_MAX) {
+ exception =
+ acpi_gbl_exception_names_pgm[sub_status - 1];
+ }
+ break;
+
+ case AE_CODE_ACPI_TABLES:
+
+ if (sub_status <= AE_CODE_TBL_MAX) {
+ exception =
+ acpi_gbl_exception_names_tbl[sub_status - 1];
+ }
+ break;
+
+ case AE_CODE_AML:
+
+ if (sub_status <= AE_CODE_AML_MAX) {
+ exception =
+ acpi_gbl_exception_names_aml[sub_status - 1];
+ }
+ break;
+
+ case AE_CODE_CONTROL:
+
+ if (sub_status <= AE_CODE_CTRL_MAX) {
+ exception =
+ acpi_gbl_exception_names_ctrl[sub_status - 1];
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return (ACPI_CAST_PTR(const char, exception));
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ut_is_aml_table
*
* PARAMETERS: Table - An ACPI table
@@ -62,6 +134,7 @@ ACPI_MODULE_NAME("utmisc")
* data tables that do not contain AML code.
*
******************************************************************************/
+
u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
{
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 3ebf42d..d1a5363 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -244,6 +244,14 @@ extern const char *acpi_gbl_highest_dsta
extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
+/* Exception codes */
+
+extern char const *acpi_gbl_exception_names_env[];
+extern char const *acpi_gbl_exception_names_pgm[];
+extern char const *acpi_gbl_exception_names_tbl[];
+extern char const *acpi_gbl_exception_names_aml[];
+extern char const *acpi_gbl_exception_names_ctrl[];
+
/*****************************************************************************
*
* Namespace globals
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index beb07ac..3c66f54 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -453,6 +453,8 @@ acpi_ut_short_divide(acpi_integer in_div
/*
* utmisc
*/
+const char *acpi_ut_validate_exception(acpi_status status);
+
u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 23/65] ACPICA: Update version to 20060831
[not found] ` <d09157670d9e199175b04cc5fc12fc6fb57a0ad2.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acconfig.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index ed181bc..82316e5 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20060828
+#define ACPI_CA_VERSION 0x20060831
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -158,8 +158,8 @@
/* Sizes for ACPI table headers */
-#define ACPI_OEM_ID_SIZE 6
-#define ACPI_OEM_TABLE_ID_SIZE 8
+#define ACPI_OEM_ID_SIZE 6
+#define ACPI_OEM_TABLE_ID_SIZE 8
/* Constants used in searching for the RSDP in low memory */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 24/65] ACPICA: Cleanup of FADT verification function.
[not found] ` <d6efb2b656ab13fa3a972e9f20310e4f7be5d1f8.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Removed offset display, not needed.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/utilities/utinit.c | 65 ++++++++++++++-------------------------
1 files changed, 23 insertions(+), 42 deletions(-)
diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index 2d2c4a3..5079f19 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -50,8 +50,7 @@
ACPI_MODULE_NAME("utinit")
/* Local prototypes */
-static void
-acpi_ut_fadt_register_error(char *register_name, u32 value, u8 offset);
+static void acpi_ut_fadt_register_error(char *register_name, u32 value);
static void acpi_ut_terminate(void);
@@ -61,21 +60,18 @@ static void acpi_ut_terminate(void);
*
* PARAMETERS: register_name - Pointer to string identifying register
* Value - Actual register contents value
- * Offset - Byte offset in the FADT
*
- * RETURN: AE_BAD_VALUE
+ * RETURN: None
*
* DESCRIPTION: Display failure message
*
******************************************************************************/
-static void
-acpi_ut_fadt_register_error(char *register_name, u32 value, u8 offset)
+static void acpi_ut_fadt_register_error(char *register_name, u32 value)
{
- ACPI_WARNING((AE_INFO,
- "Invalid FADT value %s=%X at offset %X in FADT=%p",
- register_name, value, offset, &acpi_gbl_FADT));
+ ACPI_WARNING((AE_INFO, "Invalid FADT value %s = %X",
+ register_name, value));
}
/******************************************************************************
@@ -98,69 +94,54 @@ acpi_status acpi_ut_validate_fadt(void)
* but don't abort on any problems, just display error
*/
if (acpi_gbl_FADT.pm1_event_length < 4) {
- acpi_ut_fadt_register_error("PM1_EVT_LEN",
+ acpi_ut_fadt_register_error("Pm1EventLength",
(u32) acpi_gbl_FADT.
- pm1_event_length,
- ACPI_FADT_OFFSET(pm1_event_length));
+ pm1_event_length);
+ }
+
+ if (acpi_gbl_FADT.pm_timer_length < 4) {
+ acpi_ut_fadt_register_error("PmTimerLength",
+ (u32) acpi_gbl_FADT.
+ pm_timer_length);
}
if (!acpi_gbl_FADT.pm1_control_length) {
- acpi_ut_fadt_register_error("PM1_CNT_LEN", 0,
- ACPI_FADT_OFFSET
- (pm1_control_length));
+ acpi_ut_fadt_register_error("Pm1ControlLength", 0);
}
if (!acpi_gbl_FADT.xpm1a_event_block.address) {
- acpi_ut_fadt_register_error("X_PM1a_EVT_BLK", 0,
- ACPI_FADT_OFFSET(xpm1a_event_block.
- address));
+ acpi_ut_fadt_register_error("XPm1aEventBlock.Address", 0);
}
if (!acpi_gbl_FADT.xpm1a_control_block.address) {
- acpi_ut_fadt_register_error("X_PM1a_CNT_BLK", 0,
- ACPI_FADT_OFFSET
- (xpm1a_control_block.address));
+ acpi_ut_fadt_register_error("XPm1aControlBlock.Address", 0);
}
if (!acpi_gbl_FADT.xpm_timer_block.address) {
- acpi_ut_fadt_register_error("X_PM_TMR_BLK", 0,
- ACPI_FADT_OFFSET(xpm_timer_block.
- address));
+ acpi_ut_fadt_register_error("XPmTimerBlock.Address", 0);
}
if ((acpi_gbl_FADT.xpm2_control_block.address &&
!acpi_gbl_FADT.pm2_control_length)) {
- acpi_ut_fadt_register_error("PM2_CNT_LEN",
+ acpi_ut_fadt_register_error("Pm2ControlLength",
(u32) acpi_gbl_FADT.
- pm2_control_length,
- ACPI_FADT_OFFSET
- (pm2_control_length));
- }
-
- if (acpi_gbl_FADT.pm_timer_length < 4) {
- acpi_ut_fadt_register_error("PM_TM_LEN",
- (u32) acpi_gbl_FADT.pm_timer_length,
- ACPI_FADT_OFFSET(pm_timer_length));
+ pm2_control_length);
}
/* Length of GPE blocks must be a multiple of 2 */
if (acpi_gbl_FADT.xgpe0_block.address &&
(acpi_gbl_FADT.gpe0_block_length & 1)) {
- acpi_ut_fadt_register_error("(x)GPE0_BLK_LEN",
+ acpi_ut_fadt_register_error("Gpe0BlockLength",
(u32) acpi_gbl_FADT.
- gpe0_block_length,
- ACPI_FADT_OFFSET
- (gpe0_block_length));
+ gpe0_block_length);
}
if (acpi_gbl_FADT.xgpe1_block.address &&
(acpi_gbl_FADT.gpe1_block_length & 1)) {
- acpi_ut_fadt_register_error("(x)GPE1_BLK_LEN",
+ acpi_ut_fadt_register_error("Gpe1BlockLength",
(u32) acpi_gbl_FADT.
- gpe1_block_length,
- ACPI_FADT_OFFSET
- (gpe1_block_length));
+ gpe1_block_length);
}
return (AE_OK);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 25/65] ACPICA: Create tbfadt.c to hold all FADT-related functions
[not found] ` <e065bf0eac9680e2f57707574a0f99feca29d4f6.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/Makefile | 2 +-
drivers/acpi/tables/tbfadt.c | 380 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 381 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/tables/Makefile b/drivers/acpi/tables/Makefile
index f08f1f3..0a7d7af 100644
--- a/drivers/acpi/tables/Makefile
+++ b/drivers/acpi/tables/Makefile
@@ -2,6 +2,6 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
-obj-y := tbxface.o tbinstal.o tbutils.o tbfind.o
+obj-y := tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
new file mode 100644
index 0000000..2336a72
--- /dev/null
+++ b/drivers/acpi/tables/tbfadt.c
@@ -0,0 +1,380 @@
+/******************************************************************************
+ *
+ * Module Name: tbfadt - FADT table utilities
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2006, R. Byron Moore
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <acpi/acpi.h>
+#include <acpi/actables.h>
+
+#define _COMPONENT ACPI_TABLES
+ACPI_MODULE_NAME("tbfadt")
+
+/* Local prototypes */
+static void inline
+acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
+ u8 bit_width, u64 address);
+
+static void acpi_tb_fadt_register_error(char *register_name, u32 value);
+
+static void acpi_tb_convert_fadt(void);
+
+static void acpi_tb_validate_fadt(void);
+
+/* Table used for conversion of FADT to common format */
+
+typedef struct acpi_fadt_conversion {
+ u8 target;
+ u8 source;
+ u8 length;
+
+} acpi_fadt_conversion;
+
+static struct acpi_fadt_conversion fadt_conversion_table[] = {
+ {ACPI_FADT_OFFSET(xpm1a_event_block),
+ ACPI_FADT_OFFSET(pm1a_event_block),
+ ACPI_FADT_OFFSET(pm1_event_length)},
+ {ACPI_FADT_OFFSET(xpm1b_event_block),
+ ACPI_FADT_OFFSET(pm1b_event_block),
+ ACPI_FADT_OFFSET(pm1_event_length)},
+ {ACPI_FADT_OFFSET(xpm1a_control_block),
+ ACPI_FADT_OFFSET(pm1a_control_block),
+ ACPI_FADT_OFFSET(pm1_control_length)},
+ {ACPI_FADT_OFFSET(xpm1b_control_block),
+ ACPI_FADT_OFFSET(pm1b_control_block),
+ ACPI_FADT_OFFSET(pm1_control_length)},
+ {ACPI_FADT_OFFSET(xpm2_control_block),
+ ACPI_FADT_OFFSET(pm2_control_block),
+ ACPI_FADT_OFFSET(pm2_control_length)},
+ {ACPI_FADT_OFFSET(xpm_timer_block), ACPI_FADT_OFFSET(pm_timer_block),
+ ACPI_FADT_OFFSET(pm_timer_length)},
+ {ACPI_FADT_OFFSET(xgpe0_block), ACPI_FADT_OFFSET(gpe0_block),
+ ACPI_FADT_OFFSET(gpe0_block_length)},
+ {ACPI_FADT_OFFSET(xgpe1_block), ACPI_FADT_OFFSET(gpe1_block),
+ ACPI_FADT_OFFSET(gpe1_block_length)}
+};
+
+#define ACPI_FADT_CONVERSION_ENTRIES (sizeof (fadt_conversion_table) / sizeof (struct acpi_fadt_conversion))
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_init_generic_address
+ *
+ * PARAMETERS: new_gas_struct - GAS struct to be initialized
+ * bit_width - Width of this register
+ * Address - Address of the register
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize a GAS structure.
+ *
+ ******************************************************************************/
+
+static void inline
+acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
+ u8 bit_width, u64 address)
+{
+
+ ACPI_MOVE_64_TO_64(&new_gas_struct->address, &address);
+ new_gas_struct->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
+ new_gas_struct->bit_width = bit_width;
+ new_gas_struct->bit_offset = 0;
+ new_gas_struct->access_width = 0;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_parse_fadt
+ *
+ * PARAMETERS: table_index - Index for the FADT
+ * Flags - Flags
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize the FADT, DSDT and FACS tables
+ * (FADT contains the addresses of the DSDT and FACS)
+ *
+ ******************************************************************************/
+
+void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
+{
+ u32 length;
+ struct acpi_table_header *table;
+
+ /*
+ * Special case for the FADT because of multiple versions and the fact
+ * that it contains pointers to both the DSDT and FACS tables.
+ *
+ * Get a local copy of the FADT and convert it to a common format
+ * Map entire FADT, assumed to be smaller than one page.
+ */
+ length = acpi_gbl_root_table_list.tables[table_index].length;
+
+ table =
+ acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index].
+ address, length);
+ if (!table) {
+ return;
+ }
+
+ /*
+ * Validate the FADT checksum before we copy the table. Ignore
+ * checksum error as we want to try to get the DSDT and FACS.
+ */
+ (void)acpi_tb_verify_checksum(table, length);
+
+ /* Copy the entire FADT locally */
+
+ ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
+
+ ACPI_MEMCPY(&acpi_gbl_FADT, table,
+ ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
+ acpi_os_unmap_memory(table, length);
+
+ /* Convert local FADT to the common internal format */
+
+ acpi_tb_convert_fadt();
+
+ /* Extract the DSDT and FACS tables from the FADT */
+
+ acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
+ flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
+
+ acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
+ flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+
+ /* Validate important FADT values */
+
+ acpi_tb_validate_fadt();
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_convert_fadt
+ *
+ * PARAMETERS: None, uses acpi_gbl_FADT
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Converts all versions of the FADT to a common internal format.
+ *
+ * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must contain
+ * a copy of the actual FADT.
+ *
+ * ACPICA will use the "X" fields of the FADT for all addresses.
+ *
+ * "X" fields are optional extensions to the original V1.0 fields. Even if
+ * they are present in the structure, they can be optionally not used by
+ * setting them to zero. Therefore, we must selectively expand V1.0 fields
+ * if the corresponding X field is zero.
+ *
+ * For ACPI 1.0 FADTs, all address fields are expanded to the corresponding
+ * "X" fields.
+ *
+ * For ACPI 2.0 FADTs, any "X" fields that are NULL are filled in by
+ * expanding the corresponding ACPI 1.0 field.
+ *
+ ******************************************************************************/
+
+static void acpi_tb_convert_fadt(void)
+{
+ u8 pm1_register_length;
+ struct acpi_generic_address *target;
+ acpi_native_uint i;
+
+ /* Expand the FACS and DSDT addresses as necessary */
+
+ if (!acpi_gbl_FADT.Xfacs) {
+ acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
+ }
+
+ if (!acpi_gbl_FADT.Xdsdt) {
+ acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
+ }
+
+ /*
+ * Expand the 32-bit V1.0 addresses to the 64-bit "X" generic address
+ * structures as necessary.
+ */
+ for (i = 0; i < ACPI_FADT_CONVERSION_ENTRIES; i++) {
+ target =
+ ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
+ fadt_conversion_table[i].target);
+
+ /* Expand only if the X target is null */
+
+ if (!target->address) {
+ acpi_tb_init_generic_address(target,
+ *ACPI_ADD_PTR(u8,
+ &acpi_gbl_FADT,
+ fadt_conversion_table
+ [i].length),
+ (u64) * ACPI_ADD_PTR(u32,
+ &acpi_gbl_FADT,
+ fadt_conversion_table
+ [i].
+ source));
+ }
+ }
+
+ /*
+ * Calculate separate GAS structs for the PM1 Enable registers.
+ * These addresses do not appear (directly) in the FADT, so it is
+ * useful to calculate them once, here.
+ *
+ * The PM event blocks are split into two register blocks, first is the
+ * PM Status Register block, followed immediately by the PM Enable Register
+ * block. Each is of length (pm1_event_length/2)
+ */
+ pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
+
+ /* PM1A is required */
+
+ acpi_tb_init_generic_address(&acpi_gbl_xpm1a_enable,
+ pm1_register_length,
+ (acpi_gbl_FADT.xpm1a_event_block.address +
+ pm1_register_length));
+
+ /* PM1B is optional; leave null if not present */
+
+ if (acpi_gbl_FADT.xpm1b_event_block.address) {
+ acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
+ pm1_register_length,
+ (acpi_gbl_FADT.xpm1b_event_block.
+ address + pm1_register_length));
+ }
+
+ /* Global FADT is the new common V2.0 FADT */
+
+ acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION: acpi_tb_validate_fadt
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Validate various ACPI registers in the FADT
+ *
+ ******************************************************************************/
+
+static void acpi_tb_validate_fadt(void)
+{
+
+ /* These length fields have a minimum value */
+
+ if (acpi_gbl_FADT.pm1_event_length < 4) {
+ acpi_tb_fadt_register_error("Pm1EventLength",
+ (u32) acpi_gbl_FADT.
+ pm1_event_length);
+ }
+
+ if (acpi_gbl_FADT.pm_timer_length < 4) {
+ acpi_tb_fadt_register_error("PmTimerLength",
+ (u32) acpi_gbl_FADT.
+ pm_timer_length);
+ }
+
+ /* These length and address fields must be non-zero */
+
+ if (!acpi_gbl_FADT.pm1_control_length) {
+ acpi_tb_fadt_register_error("Pm1ControlLength", 0);
+ }
+
+ if (!acpi_gbl_FADT.xpm1a_event_block.address) {
+ acpi_tb_fadt_register_error("XPm1aEventBlock.Address", 0);
+ }
+
+ if (!acpi_gbl_FADT.xpm1a_control_block.address) {
+ acpi_tb_fadt_register_error("XPm1aControlBlock.Address", 0);
+ }
+
+ if (!acpi_gbl_FADT.xpm_timer_block.address) {
+ acpi_tb_fadt_register_error("XPmTimerBlock.Address", 0);
+ }
+
+ /* If PM2 block is present, must have non-zero length */
+
+ if ((acpi_gbl_FADT.xpm2_control_block.address &&
+ !acpi_gbl_FADT.pm2_control_length)) {
+ acpi_tb_fadt_register_error("Pm2ControlLength",
+ (u32) acpi_gbl_FADT.
+ pm2_control_length);
+ }
+
+ /* Length of any valid GPE blocks must be a multiple of 2 */
+
+ if (acpi_gbl_FADT.xgpe0_block.address &&
+ (acpi_gbl_FADT.gpe0_block_length & 1)) {
+ acpi_tb_fadt_register_error("Gpe0BlockLength",
+ (u32) acpi_gbl_FADT.
+ gpe0_block_length);
+ }
+
+ if (acpi_gbl_FADT.xgpe1_block.address &&
+ (acpi_gbl_FADT.gpe1_block_length & 1)) {
+ acpi_tb_fadt_register_error("Gpe1BlockLength",
+ (u32) acpi_gbl_FADT.
+ gpe1_block_length);
+ }
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_fadt_register_error
+ *
+ * PARAMETERS: register_name - Pointer to string identifying register
+ * Value - Actual register contents value
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Display FADT warning message
+ *
+ ******************************************************************************/
+
+static void acpi_tb_fadt_register_error(char *register_name, u32 value)
+{
+
+ ACPI_WARNING((AE_INFO, "Invalid FADT value \"%s\" = %X",
+ register_name, value));
+}
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 26/65] ACPICA: Re-implement interpreters' "serialized mode"
[not found] ` <1ed5347751418ace666b50cc4c48ccb6949607c8.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Enhanced the implementation of the interpreters'
serialized mode (boot with "acpi_serialize" to set
acpi_glb_all_methods_serialized flag.)
When this mode is specified, instead of creating a serialization
semaphore per control method, the interpreter lock is
simply no longer released before a blocking operation
during control method execution. This effectively makes
the AML Interpreter single-threaded. The overhead of a
semaphore per-method is eliminated.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evregion.c | 15 ++----
drivers/acpi/events/evxface.c | 6 +--
drivers/acpi/executer/excreate.c | 5 +--
drivers/acpi/executer/exsystem.c | 30 +++--------
drivers/acpi/executer/exutils.c | 108 +++++++++++++++++++++++++++++-------
drivers/acpi/namespace/nseval.c | 11 +---
drivers/acpi/namespace/nsinit.c | 7 +--
drivers/acpi/namespace/nsxfeval.c | 11 ++---
include/acpi/acinterp.h | 6 ++-
9 files changed, 114 insertions(+), 85 deletions(-)
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 21caae0..ef45971 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -291,7 +291,6 @@ acpi_ev_address_space_dispatch(union acp
u32 bit_width, acpi_integer * value)
{
acpi_status status;
- acpi_status status2;
acpi_adr_space_handler handler;
acpi_adr_space_setup region_setup;
union acpi_operand_object *handler_desc;
@@ -345,7 +344,7 @@ acpi_ev_address_space_dispatch(union acp
* setup will potentially execute control methods
* (e.g., _REG method for this region)
*/
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
handler_desc->address_space.context,
@@ -353,10 +352,7 @@ acpi_ev_address_space_dispatch(union acp
/* Re-enter the interpreter */
- status2 = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
+ acpi_ex_reacquire_interpreter();
/* Check for failure of the Region Setup */
@@ -409,7 +405,7 @@ acpi_ev_address_space_dispatch(union acp
* exit the interpreter because the handler *might* block -- we don't
* know what it will do, so we can't hold the lock on the intepreter.
*/
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
}
/* Call the handler */
@@ -430,10 +426,7 @@ acpi_ev_address_space_dispatch(union acp
* We just returned from a non-default handler, we must re-enter the
* interpreter
*/
- status2 = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
+ acpi_ex_reacquire_interpreter();
}
return_ACPI_STATUS(status);
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 923fd2b..a2af48e 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -768,11 +768,9 @@ acpi_status acpi_acquire_global_lock(u16
return (AE_BAD_PARAMETER);
}
- status = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status)) {
- return (status);
- }
+ /* Must lock interpreter to prevent race conditions */
+ acpi_ex_enter_interpreter();
status = acpi_ev_acquire_global_lock(timeout);
acpi_ex_exit_interpreter();
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index a4d29b2..c665aa7 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -583,10 +583,7 @@ acpi_ex_create_method(u8 * aml_start,
* Get the sync_level. If method is serialized, a mutex will be
* created for this method when it is parsed.
*/
- if (acpi_gbl_all_methods_serialized) {
- obj_desc->method.sync_level = 0;
- obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
- } else if (method_flags & AML_METHOD_SERIALIZED) {
+ if (method_flags & AML_METHOD_SERIALIZED) {
/*
* ACPI 1.0: sync_level = 0
* ACPI 2.0: sync_level = sync_level in method declaration
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 3b9736a..7e5aeb1 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -66,7 +66,6 @@ ACPI_MODULE_NAME("exsystem")
acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
{
acpi_status status;
- acpi_status status2;
ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
@@ -79,7 +78,7 @@ acpi_status acpi_ex_system_wait_semaphor
/* We must wait, so unlock the interpreter */
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
status = acpi_os_wait_semaphore(semaphore, 1, timeout);
@@ -89,13 +88,7 @@ acpi_status acpi_ex_system_wait_semaphor
/* Reacquire the interpreter */
- status2 = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status2)) {
-
- /* Report fatal error, could not acquire interpreter */
-
- return_ACPI_STATUS(status2);
- }
+ acpi_ex_reacquire_interpreter();
}
return_ACPI_STATUS(status);
@@ -119,7 +112,6 @@ acpi_status acpi_ex_system_wait_semaphor
acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
{
acpi_status status;
- acpi_status status2;
ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
@@ -132,7 +124,7 @@ acpi_status acpi_ex_system_wait_mutex(ac
/* We must wait, so unlock the interpreter */
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
status = acpi_os_acquire_mutex(mutex, timeout);
@@ -142,13 +134,7 @@ acpi_status acpi_ex_system_wait_mutex(ac
/* Reacquire the interpreter */
- status2 = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status2)) {
-
- /* Report fatal error, could not acquire interpreter */
-
- return_ACPI_STATUS(status2);
- }
+ acpi_ex_reacquire_interpreter();
}
return_ACPI_STATUS(status);
@@ -209,20 +195,18 @@ acpi_status acpi_ex_system_do_stall(u32
acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
{
- acpi_status status;
-
ACPI_FUNCTION_ENTRY();
/* Since this thread will sleep, we must release the interpreter */
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
acpi_os_sleep(how_long);
/* And now we must get the interpreter again */
- status = acpi_ex_enter_interpreter();
- return (status);
+ acpi_ex_reacquire_interpreter();
+ return (AE_OK);
}
/*******************************************************************************
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 982c8b6..72adcf4 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -76,46 +76,72 @@ static u32 acpi_ex_digits_needed(acpi_in
*
* PARAMETERS: None
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: Enter the interpreter execution region. Failure to enter
- * the interpreter region is a fatal system error
+ * DESCRIPTION: Enter the interpreter execution region. Failure to enter
+ * the interpreter region is a fatal system error. Used in
+ * conjunction with exit_interpreter.
*
******************************************************************************/
-acpi_status acpi_ex_enter_interpreter(void)
+void acpi_ex_enter_interpreter(void)
{
acpi_status status;
- ACPI_FUNCTION_TRACE(ex_enter_interpreter);
+ ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
if (ACPI_FAILURE(status)) {
- ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex"));
+ ACPI_ERROR((AE_INFO,
+ "Could not acquire AML Interpreter mutex"));
}
- return_ACPI_STATUS(status);
+ return_VOID;
}
/*******************************************************************************
*
- * FUNCTION: acpi_ex_exit_interpreter
+ * FUNCTION: acpi_ex_reacquire_interpreter
*
* PARAMETERS: None
*
* RETURN: None
*
- * DESCRIPTION: Exit the interpreter execution region
+ * DESCRIPTION: Reacquire the interpreter execution region from within the
+ * interpreter code. Failure to enter the interpreter region is a
+ * fatal system error. Used in conjuction with
+ * relinquish_interpreter
+ *
+ ******************************************************************************/
+
+void acpi_ex_reacquire_interpreter(void)
+{
+
+ ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
+
+ /*
+ * If the global serialized flag is set, do not release the interpreter,
+ * since it was not actually released by acpi_ex_relinquish_interpreter.
+ * This forces the interpreter to be single threaded.
+ */
+ if (!acpi_gbl_all_methods_serialized) {
+ acpi_ex_enter_interpreter();
+ }
+
+ return_VOID;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ex_exit_interpreter
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
*
- * Cases where the interpreter is unlocked:
- * 1) Completion of the execution of a control method
- * 2) Method blocked on a Sleep() AML opcode
- * 3) Method blocked on an Acquire() AML opcode
- * 4) Method blocked on a Wait() AML opcode
- * 5) Method blocked to acquire the global lock
- * 6) Method blocked to execute a serialized control method that is
- * already executing
- * 7) About to invoke a user-installed opregion handler
+ * DESCRIPTION: Exit the interpreter execution region. This is the top level
+ * routine used to exit the interpreter when all processing has
+ * been completed.
*
******************************************************************************/
@@ -127,7 +153,47 @@ void acpi_ex_exit_interpreter(void)
status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
if (ACPI_FAILURE(status)) {
- ACPI_ERROR((AE_INFO, "Could not release interpreter mutex"));
+ ACPI_ERROR((AE_INFO,
+ "Could not release AML Interpreter mutex"));
+ }
+
+ return_VOID;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ex_relinquish_interpreter
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Exit the interpreter execution region, from within the
+ * interpreter - before attempting an operation that will possibly
+ * block the running thread.
+ *
+ * Cases where the interpreter is unlocked internally
+ * 1) Method to be blocked on a Sleep() AML opcode
+ * 2) Method to be blocked on an Acquire() AML opcode
+ * 3) Method to be blocked on a Wait() AML opcode
+ * 4) Method to be blocked to acquire the global lock
+ * 5) Method to be blocked waiting to execute a serialized control method
+ * that is currently executing
+ * 6) About to invoke a user-installed opregion handler
+ *
+ ******************************************************************************/
+
+void acpi_ex_relinquish_interpreter(void)
+{
+
+ ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
+
+ /*
+ * If the global serialized flag is set, do not release the interpreter.
+ * This forces the interpreter to be single threaded.
+ */
+ if (!acpi_gbl_all_methods_serialized) {
+ acpi_ex_exit_interpreter();
}
return_VOID;
@@ -141,8 +207,8 @@ void acpi_ex_exit_interpreter(void)
*
* RETURN: none
*
- * DESCRIPTION: Truncate a number to 32-bits if the currently executing method
- * belongs to a 32-bit ACPI table.
+ * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is
+ * 32-bit, as determined by the revision of the DSDT.
*
******************************************************************************/
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c
index 4b0a4a8..7156616 100644
--- a/drivers/acpi/namespace/nseval.c
+++ b/drivers/acpi/namespace/nseval.c
@@ -154,11 +154,7 @@ acpi_status acpi_ns_evaluate(struct acpi
* Execute the method via the interpreter. The interpreter is locked
* here before calling into the AML parser
*/
- status = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
-
+ acpi_ex_enter_interpreter();
status = acpi_ps_execute_method(info);
acpi_ex_exit_interpreter();
} else {
@@ -182,10 +178,7 @@ acpi_status acpi_ns_evaluate(struct acpi
* resolution, we must lock it because we could access an opregion.
* The opregion access code assumes that the interpreter is locked.
*/
- status = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
+ acpi_ex_enter_interpreter();
/* Function has a strange interface */
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c
index aec8488..0d3a42b 100644
--- a/drivers/acpi/namespace/nsinit.c
+++ b/drivers/acpi/namespace/nsinit.c
@@ -213,7 +213,7 @@ acpi_ns_init_one_object(acpi_handle obj_
u32 level, void *context, void **return_value)
{
acpi_object_type type;
- acpi_status status;
+ acpi_status status = AE_OK;
struct acpi_init_walk_info *info =
(struct acpi_init_walk_info *)context;
struct acpi_namespace_node *node =
@@ -267,10 +267,7 @@ acpi_ns_init_one_object(acpi_handle obj_
/*
* Must lock the interpreter before executing AML code
*/
- status = acpi_ex_enter_interpreter();
- if (ACPI_FAILURE(status)) {
- return (status);
- }
+ acpi_ex_enter_interpreter();
/*
* Each of these types can contain executable AML code within the
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index dca6799..6a0a46e 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -170,7 +170,6 @@ acpi_evaluate_object(acpi_handle handle,
struct acpi_buffer *return_buffer)
{
acpi_status status;
- acpi_status status2;
struct acpi_evaluate_info *info;
acpi_size buffer_space_needed;
u32 i;
@@ -329,14 +328,12 @@ acpi_evaluate_object(acpi_handle handle,
* Delete the internal return object. NOTE: Interpreter must be
* locked to avoid race condition.
*/
- status2 = acpi_ex_enter_interpreter();
- if (ACPI_SUCCESS(status2)) {
+ acpi_ex_enter_interpreter();
- /* Remove one reference on the return object (should delete it) */
+ /* Remove one reference on the return object (should delete it) */
- acpi_ut_remove_reference(info->return_object);
- acpi_ex_exit_interpreter();
- }
+ acpi_ut_remove_reference(info->return_object);
+ acpi_ex_exit_interpreter();
}
cleanup:
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index f266b38..8aebe57 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -445,10 +445,14 @@ acpi_ex_copy_integer_to_buffer_field(uni
/*
* exutils - interpreter/scanner utilities
*/
-acpi_status acpi_ex_enter_interpreter(void);
+void acpi_ex_enter_interpreter(void);
void acpi_ex_exit_interpreter(void);
+void acpi_ex_reacquire_interpreter(void);
+
+void acpi_ex_relinquish_interpreter(void);
+
void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
u8 acpi_ex_acquire_global_lock(u32 rule);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 27/65] ACPICA: Delete stale FADT functions outside tbfadt.c.
[not found] ` <dbd789f0d0b59443e5001cd3d2501e0d9ffd2ad2.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Moved all FADT-related functions to a new file, tbfadt.c.
Eliminated the acpi_hw_initialize function - the
FADT registers are now validated when the table is loaded.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/hardware/hwacpi.c | 29 -----
drivers/acpi/tables/tbutils.c | 238 +-------------------------------------
drivers/acpi/utilities/utinit.c | 95 ---------------
drivers/acpi/utilities/utxface.c | 14 ---
include/acpi/achware.h | 2 -
include/acpi/actables.h | 9 ++
include/acpi/acutils.h | 2 -
7 files changed, 10 insertions(+), 379 deletions(-)
diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c
index 14e8111..9c7df71 100644
--- a/drivers/acpi/hardware/hwacpi.c
+++ b/drivers/acpi/hardware/hwacpi.c
@@ -49,34 +49,6 @@ ACPI_MODULE_NAME("hwacpi")
/******************************************************************************
*
- * FUNCTION: acpi_hw_initialize
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Initialize and validate the various ACPI registers defined in
- * the FADT.
- *
- ******************************************************************************/
-acpi_status acpi_hw_initialize(void)
-{
- acpi_status status;
-
- ACPI_FUNCTION_TRACE(hw_initialize);
-
- /* Sanity check the FADT for valid values */
-
- status = acpi_ut_validate_fadt();
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
-
- return_ACPI_STATUS(AE_OK);
-}
-
-/******************************************************************************
- *
* FUNCTION: acpi_hw_set_mode
*
* PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY
@@ -86,7 +58,6 @@ acpi_status acpi_hw_initialize(void)
* DESCRIPTION: Transitions the system into the requested mode.
*
******************************************************************************/
-
acpi_status acpi_hw_set_mode(u32 mode)
{
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 61d6d80..45ef82c 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -48,57 +48,10 @@
ACPI_MODULE_NAME("tbutils")
/* Local prototypes */
-static void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
-
-static void acpi_tb_convert_fadt(void);
-
-static void
-acpi_tb_install_table(acpi_physical_address address,
- u8 flags, char *signature, acpi_native_uint table_index);
-
-static void inline
-acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
- u8 bit_width, u64 address);
-
static acpi_physical_address
acpi_tb_get_root_table_entry(u8 * table_entry,
acpi_native_uint table_entry_size);
-/* Table used for conversion of FADT to common format */
-
-typedef struct acpi_fadt_conversion {
- u8 target;
- u8 source;
- u8 length;
-
-} acpi_fadt_conversion;
-
-static struct acpi_fadt_conversion fadt_conversion_table[] = {
- {ACPI_FADT_OFFSET(xpm1a_event_block),
- ACPI_FADT_OFFSET(pm1a_event_block),
- ACPI_FADT_OFFSET(pm1_event_length)},
- {ACPI_FADT_OFFSET(xpm1b_event_block),
- ACPI_FADT_OFFSET(pm1b_event_block),
- ACPI_FADT_OFFSET(pm1_event_length)},
- {ACPI_FADT_OFFSET(xpm1a_control_block),
- ACPI_FADT_OFFSET(pm1a_control_block),
- ACPI_FADT_OFFSET(pm1_control_length)},
- {ACPI_FADT_OFFSET(xpm1b_control_block),
- ACPI_FADT_OFFSET(pm1b_control_block),
- ACPI_FADT_OFFSET(pm1_control_length)},
- {ACPI_FADT_OFFSET(xpm2_control_block),
- ACPI_FADT_OFFSET(pm2_control_block),
- ACPI_FADT_OFFSET(pm2_control_length)},
- {ACPI_FADT_OFFSET(xpm_timer_block), ACPI_FADT_OFFSET(pm_timer_block),
- ACPI_FADT_OFFSET(pm_timer_length)},
- {ACPI_FADT_OFFSET(xgpe0_block), ACPI_FADT_OFFSET(gpe0_block),
- ACPI_FADT_OFFSET(gpe0_block_length)},
- {ACPI_FADT_OFFSET(xgpe1_block), ACPI_FADT_OFFSET(gpe1_block),
- ACPI_FADT_OFFSET(gpe1_block_length)}
-};
-
-#define ACPI_FADT_CONVERSION_ENTRIES (sizeof (fadt_conversion_table) / sizeof (struct acpi_fadt_conversion))
-
/*******************************************************************************
*
* FUNCTION: acpi_tb_print_table_header
@@ -153,32 +106,6 @@ acpi_tb_print_table_header(acpi_physical
/*******************************************************************************
*
- * FUNCTION: acpi_tb_init_generic_address
- *
- * PARAMETERS: new_gas_struct - GAS struct to be initialized
- * bit_width - Width of this register
- * Address - Address of the register
- *
- * RETURN: None
- *
- * DESCRIPTION: Initialize a GAS structure.
- *
- ******************************************************************************/
-
-static void inline
-acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
- u8 bit_width, u64 address)
-{
-
- ACPI_MOVE_64_TO_64(&new_gas_struct->address, &address);
- new_gas_struct->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
- new_gas_struct->bit_width = bit_width;
- new_gas_struct->bit_offset = 0;
- new_gas_struct->access_width = 0;
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_tb_validate_checksum
*
* PARAMETERS: Table - ACPI table to verify
@@ -241,107 +168,6 @@ u8 acpi_tb_checksum(u8 * buffer, acpi_na
/*******************************************************************************
*
- * FUNCTION: acpi_tb_convert_fadt
- *
- * PARAMETERS: None, uses acpi_gbl_FADT
- *
- * RETURN: None
- *
- * DESCRIPTION: Converts all versions of the FADT to a common internal format.
- *
- * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must contain
- * a copy of the actual FADT.
- *
- * ACPICA will use the "X" fields of the FADT for all addresses.
- *
- * "X" fields are optional extensions to the original V1.0 fields. Even if
- * they are present in the structure, they can be optionally not used by
- * setting them to zero. Therefore, we must selectively expand V1.0 fields
- * if the corresponding X field is zero.
- *
- * For ACPI 1.0 FADTs, all address fields are expanded to the corresponding
- * "X" fields.
- *
- * For ACPI 2.0 FADTs, any "X" fields that are NULL are filled in by
- * expanding the corresponding ACPI 1.0 field.
- *
- ******************************************************************************/
-
-static void acpi_tb_convert_fadt(void)
-{
- u8 pm1_register_length;
- struct acpi_generic_address *target;
- acpi_native_uint i;
-
- /* Expand the FACS and DSDT addresses as necessary */
-
- if (!acpi_gbl_FADT.Xfacs) {
- acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
- }
-
- if (!acpi_gbl_FADT.Xdsdt) {
- acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
- }
-
- /*
- * Expand the 32-bit V1.0 addresses to the 64-bit "X" generic address
- * structures as necessary.
- */
- for (i = 0; i < ACPI_FADT_CONVERSION_ENTRIES; i++) {
- target =
- ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
- fadt_conversion_table[i].target);
-
- /* Expand only if the X target is null */
-
- if (!target->address) {
- acpi_tb_init_generic_address(target,
- *ACPI_ADD_PTR(u8,
- &acpi_gbl_FADT,
- fadt_conversion_table
- [i].length),
- (u64) * ACPI_ADD_PTR(u32,
- &acpi_gbl_FADT,
- fadt_conversion_table
- [i].
- source));
- }
- }
-
- /*
- * Calculate separate GAS structs for the PM1 Enable registers.
- * These addresses do not appear (directly) in the FADT, so it is
- * useful to calculate them once, here.
- *
- * The PM event blocks are split into two register blocks, first is the
- * PM Status Register block, followed immediately by the PM Enable Register
- * block. Each is of length (pm1_event_length/2)
- */
- pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
-
- /* PM1A is required */
-
- acpi_tb_init_generic_address(&acpi_gbl_xpm1a_enable,
- pm1_register_length,
- (acpi_gbl_FADT.xpm1a_event_block.address +
- pm1_register_length));
-
- /* PM1B is optional; leave null if not present */
-
- if (acpi_gbl_FADT.xpm1b_event_block.address) {
- acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
- pm1_register_length,
- (acpi_gbl_FADT.xpm1b_event_block.
- address + pm1_register_length));
- }
-
- /* Global FADT is the new common V2.0 FADT */
-
- acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_tb_install_table
*
* PARAMETERS: Address - Physical address of DSDT or FACS
@@ -356,7 +182,7 @@ static void acpi_tb_convert_fadt(void)
*
******************************************************************************/
-static void
+void
acpi_tb_install_table(acpi_physical_address address,
u8 flags, char *signature, acpi_native_uint table_index)
{
@@ -410,68 +236,6 @@ acpi_tb_install_table(acpi_physical_addr
/*******************************************************************************
*
- * FUNCTION: acpi_tb_parse_fadt
- *
- * PARAMETERS: table_index - Index for the FADT
- * Flags - Flags
- *
- * RETURN: None
- *
- * DESCRIPTION: Initialize the FADT, DSDT and FACS tables
- * (FADT contains the addresses of the DSDT and FACS)
- *
- ******************************************************************************/
-
-static void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
-{
- u32 length;
- struct acpi_table_header *table;
-
- /*
- * Special case for the FADT because of multiple versions and the fact
- * that it contains pointers to both the DSDT and FACS tables.
- *
- * Get a local copy of the FADT and convert it to a common format
- * Map entire FADT, assumed to be smaller than one page.
- */
- length = acpi_gbl_root_table_list.tables[table_index].length;
-
- table =
- acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index].
- address, length);
- if (!table) {
- return;
- }
-
- /*
- * Validate the FADT checksum before we copy the table. Ignore
- * checksum error as we want to try to get the DSDT and FACS.
- */
- (void)acpi_tb_verify_checksum(table, length);
-
- /* Copy the entire FADT locally */
-
- ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
-
- ACPI_MEMCPY(&acpi_gbl_FADT, table,
- ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
- acpi_os_unmap_memory(table, length);
-
- /* Convert local FADT to the common internal format */
-
- acpi_tb_convert_fadt();
-
- /* Extract the DSDT and FACS tables from the FADT */
-
- acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
- flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
-
- acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
- flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_tb_get_root_table_entry
*
* PARAMETERS: table_entry - Pointer to the RSDT/XSDT table entry
diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index 5079f19..303bde7 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -50,103 +50,8 @@
ACPI_MODULE_NAME("utinit")
/* Local prototypes */
-static void acpi_ut_fadt_register_error(char *register_name, u32 value);
-
static void acpi_ut_terminate(void);
-/*******************************************************************************
- *
- * FUNCTION: acpi_ut_fadt_register_error
- *
- * PARAMETERS: register_name - Pointer to string identifying register
- * Value - Actual register contents value
- *
- * RETURN: None
- *
- * DESCRIPTION: Display failure message
- *
- ******************************************************************************/
-
-static void acpi_ut_fadt_register_error(char *register_name, u32 value)
-{
-
- ACPI_WARNING((AE_INFO, "Invalid FADT value %s = %X",
- register_name, value));
-}
-
-/******************************************************************************
- *
- * FUNCTION: acpi_ut_validate_fadt
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Validate various ACPI registers in the FADT
- *
- ******************************************************************************/
-
-acpi_status acpi_ut_validate_fadt(void)
-{
-
- /*
- * Verify Fixed ACPI Description Table fields,
- * but don't abort on any problems, just display error
- */
- if (acpi_gbl_FADT.pm1_event_length < 4) {
- acpi_ut_fadt_register_error("Pm1EventLength",
- (u32) acpi_gbl_FADT.
- pm1_event_length);
- }
-
- if (acpi_gbl_FADT.pm_timer_length < 4) {
- acpi_ut_fadt_register_error("PmTimerLength",
- (u32) acpi_gbl_FADT.
- pm_timer_length);
- }
-
- if (!acpi_gbl_FADT.pm1_control_length) {
- acpi_ut_fadt_register_error("Pm1ControlLength", 0);
- }
-
- if (!acpi_gbl_FADT.xpm1a_event_block.address) {
- acpi_ut_fadt_register_error("XPm1aEventBlock.Address", 0);
- }
-
- if (!acpi_gbl_FADT.xpm1a_control_block.address) {
- acpi_ut_fadt_register_error("XPm1aControlBlock.Address", 0);
- }
-
- if (!acpi_gbl_FADT.xpm_timer_block.address) {
- acpi_ut_fadt_register_error("XPmTimerBlock.Address", 0);
- }
-
- if ((acpi_gbl_FADT.xpm2_control_block.address &&
- !acpi_gbl_FADT.pm2_control_length)) {
- acpi_ut_fadt_register_error("Pm2ControlLength",
- (u32) acpi_gbl_FADT.
- pm2_control_length);
- }
-
- /* Length of GPE blocks must be a multiple of 2 */
-
- if (acpi_gbl_FADT.xgpe0_block.address &&
- (acpi_gbl_FADT.gpe0_block_length & 1)) {
- acpi_ut_fadt_register_error("Gpe0BlockLength",
- (u32) acpi_gbl_FADT.
- gpe0_block_length);
- }
-
- if (acpi_gbl_FADT.xgpe1_block.address &&
- (acpi_gbl_FADT.gpe1_block_length & 1)) {
- acpi_ut_fadt_register_error("Gpe1BlockLength",
- (u32) acpi_gbl_FADT.
- gpe1_block_length);
- }
-
- return (AE_OK);
-}
-
/******************************************************************************
*
* FUNCTION: acpi_ut_terminate
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index 7ea2981..bec0f54 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -127,20 +127,6 @@ acpi_status acpi_enable_subsystem(u32 fl
ACPI_FUNCTION_TRACE(acpi_enable_subsystem);
- /*
- * We must initialize the hardware before we can enable ACPI.
- * The values from the FADT are validated here.
- */
- if (!(flags & ACPI_NO_HARDWARE_INIT)) {
- ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
- "[Init] Initializing ACPI hardware\n"));
-
- status = acpi_hw_initialize();
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
- }
-
/* Enable ACPI mode */
if (!(flags & ACPI_NO_ACPI_ENABLE)) {
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 29b60a8..f3e9a03 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -61,8 +61,6 @@
/*
* hwacpi - high level functions
*/
-acpi_status acpi_hw_initialize(void);
-
acpi_status acpi_hw_set_mode(u32 mode);
u32 acpi_hw_get_mode(void);
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 9183de1..6294734 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -45,6 +45,11 @@
#define __ACTABLES_H__
/*
+ * tbfadt - FADT parse/convert/validate
+ */
+void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
+
+/*
* tbfind - find ACPI table
*/
acpi_status
@@ -97,6 +102,10 @@ u8 acpi_tb_checksum(u8 * buffer, acpi_na
acpi_status
acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
+void
+acpi_tb_install_table(acpi_physical_address address,
+ u8 flags, char *signature, acpi_native_uint table_index);
+
acpi_status
acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 3c66f54..ba7d7e9 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -141,8 +141,6 @@ acpi_status acpi_ut_hardware_initialize(
void acpi_ut_subsystem_shutdown(void);
-acpi_status acpi_ut_validate_fadt(void);
-
/*
* utclib - Local implementations of C library functions
*/
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 28/65] ACPICA: Update comments in tbfadt.c
[not found] ` <f9be8a6f16cc421158078ede60ccb24c06267704.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbfadt.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index 2336a72..62485d3 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -195,8 +195,8 @@ void acpi_tb_parse_fadt(acpi_native_uint
*
* DESCRIPTION: Converts all versions of the FADT to a common internal format.
*
- * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must contain
- * a copy of the actual FADT.
+ * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt),
+ * and must contain a copy of the actual FADT.
*
* ACPICA will use the "X" fields of the FADT for all addresses.
*
@@ -292,9 +292,10 @@ static void acpi_tb_convert_fadt(void)
*
* PARAMETERS: None
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: Validate various ACPI registers in the FADT
+ * DESCRIPTION: Validate various ACPI registers in the FADT. For problems,
+ * issue a message, but no status is returned.
*
******************************************************************************/
@@ -375,6 +376,6 @@ static void acpi_tb_validate_fadt(void)
static void acpi_tb_fadt_register_error(char *register_name, u32 value)
{
- ACPI_WARNING((AE_INFO, "Invalid FADT value \"%s\" = %X",
+ ACPI_WARNING((AE_INFO, "Invalid FADT value in field \"%s\" = %X",
register_name, value));
}
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 29/65] ACPICA: add ASF comment
[not found] ` <1041493b499fda1e537b685ee65c35feba6e60d5.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/actbl1.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 515d82c..8494c42 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -97,6 +97,8 @@ struct acpi_subtable_header {
*
* ASF - Alert Standard Format table (Signature "ASF!")
*
+ * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
+ *
******************************************************************************/
struct acpi_table_asf {
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 30/65] ACPICA: re-factor table init routines for benefit of iASL
[not found] ` <ff81896d6f21cfd03e168b175a6bce110fb73983.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Required new table init interface since iASL does not use RSDP/XSDT.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbxface.c | 30 +++++++++++++++++++++++++-----
include/acpi/actables.h | 2 ++
2 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 3540fe6..c5009f5 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -54,6 +54,29 @@ static acpi_status acpi_tb_load_namespac
/*******************************************************************************
*
+ * FUNCTION: acpi_allocate_root_table
+ *
+ * PARAMETERS: initial_table_count - Size of initial_table_array, in number of
+ * struct acpi_table_desc structures
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Allocate a root table array. Used by i_aSL compiler and
+ * acpi_initialize_tables.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_allocate_root_table(u32 initial_table_count)
+{
+
+ acpi_gbl_root_table_list.size = initial_table_count;
+ acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE;
+
+ return (acpi_tb_resize_root_table_list());
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_initialize_tables
*
* PARAMETERS: initial_table_array - Pointer to an array of pre-allocated
@@ -79,7 +102,7 @@ static acpi_status acpi_tb_load_namespac
******************************************************************************/
acpi_status
-acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
+acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
u32 initial_table_count, u8 allow_resize)
{
acpi_physical_address rsdp_address;
@@ -92,10 +115,7 @@ acpi_initialize_tables(struct acpi_table
* Allocate the table array if requested
*/
if (!initial_table_array) {
- acpi_gbl_root_table_list.size = initial_table_count;
- acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE;
-
- status = acpi_tb_resize_root_table_list();
+ status = acpi_allocate_root_table(initial_table_count);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 6294734..99fa51a 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -44,6 +44,8 @@
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
+acpi_status acpi_allocate_root_table(u32 initial_table_count);
+
/*
* tbfadt - FADT parse/convert/validate
*/
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 31/65] ACPICA: Allow type ANY to be the target of the Scope operator.
[not found] ` <4026bee38fc195a7bec6ac14f832867dbc5ce314.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Useful during disassembly where the target may
be in a different table and thus the type is unknown.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dswload.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index e3ca7f6..d60d062 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -196,6 +196,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_
* one of the opcodes that actually opens a scope
*/
switch (node->type) {
+ case ACPI_TYPE_ANY:
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER:
@@ -669,6 +670,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_
* one of the opcodes that actually opens a scope
*/
switch (node->type) {
+ case ACPI_TYPE_ANY:
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER:
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 32/65] ACPICA: IsResourceTemplate now returns ACPI_STATUS
[not found] ` <595830000ed536d250568af7fec2a54136a65f36.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
to differentiate the failure modes.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acdisasm.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 722583a..b29d77a 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -140,7 +140,9 @@ extern const char *acpi_gbl_match_ops[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf1a[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf2a[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
@@ -322,7 +324,7 @@ acpi_dm_resource_template(struct acpi_op
union acpi_parse_object *op,
u8 * byte_data, u32 byte_count);
-u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
+acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
void acpi_dm_indent(u32 level);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 33/65] ACPICA: Add declarations for ASF! sub-tables
[not found] ` <0441d700442eb4c9345d4f2b6700c8fda5c1288b.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/actbl1.h | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 8494c42..3156d1a 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -148,7 +148,21 @@ struct acpi_asf_alert {
u8 deassert_mask;
u8 alerts;
u8 data_length;
- u8 array[1];
+};
+
+struct acpi_asf_alert_data {
+ u8 address;
+ u8 command;
+ u8 mask;
+ u8 value;
+ u8 sensor_type;
+ u8 type;
+ u8 offset;
+ u8 source_type;
+ u8 severity;
+ u8 sensor_number;
+ u8 entity;
+ u8 instance;
};
/* 2: ASF Remote Control */
@@ -158,7 +172,13 @@ struct acpi_asf_remote {
u8 controls;
u8 data_length;
u16 reserved2;
- u8 array[1];
+};
+
+struct acpi_asf_control_data {
+ u8 function;
+ u8 address;
+ u8 command;
+ u8 value;
};
/* 3: ASF RMCP Boot Options */
@@ -180,7 +200,6 @@ struct acpi_asf_address {
struct acpi_asf_header header;
u8 eprom_address;
u8 devices;
- u8 smbus_addresses[1];
};
/*******************************************************************************
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 34/65] ACPICA: FADT verification is now table driven.
[not found] ` <c2ed0e4b2171e6991fe8a0ce8e8961ccdc9527da.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Disassembler now verifies an input
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbfadt.c | 289 ++++++++++++++++++++++-------------------
drivers/acpi/tables/tbutils.c | 2 +-
include/acpi/actables.h | 4 +
3 files changed, 158 insertions(+), 137 deletions(-)
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index 62485d3..8816bab 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -49,74 +49,92 @@ ACPI_MODULE_NAME("tbfadt")
/* Local prototypes */
static void inline
-acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
+acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
u8 bit_width, u64 address);
-static void acpi_tb_fadt_register_error(char *register_name, u32 value);
+/* Table for conversion of FADT to common internal format and FADT validation */
-static void acpi_tb_convert_fadt(void);
-
-static void acpi_tb_validate_fadt(void);
-
-/* Table used for conversion of FADT to common format */
-
-typedef struct acpi_fadt_conversion {
+typedef struct acpi_fadt_info {
+ char *name;
u8 target;
u8 source;
u8 length;
+ u8 type;
-} acpi_fadt_conversion;
+} acpi_fadt_info;
-static struct acpi_fadt_conversion fadt_conversion_table[] = {
- {ACPI_FADT_OFFSET(xpm1a_event_block),
+#define ACPI_FADT_REQUIRED 1
+#define ACPI_FADT_SEPARATE_LENGTH 2
+
+static struct acpi_fadt_info fadt_info_table[] = {
+ {"Pm1aEventBlock", ACPI_FADT_OFFSET(xpm1a_event_block),
ACPI_FADT_OFFSET(pm1a_event_block),
- ACPI_FADT_OFFSET(pm1_event_length)},
- {ACPI_FADT_OFFSET(xpm1b_event_block),
+ ACPI_FADT_OFFSET(pm1_event_length), ACPI_FADT_REQUIRED},
+
+ {"Pm1bEventBlock", ACPI_FADT_OFFSET(xpm1b_event_block),
ACPI_FADT_OFFSET(pm1b_event_block),
- ACPI_FADT_OFFSET(pm1_event_length)},
- {ACPI_FADT_OFFSET(xpm1a_control_block),
+ ACPI_FADT_OFFSET(pm1_event_length), 0},
+
+ {"Pm1aControlBlock", ACPI_FADT_OFFSET(xpm1a_control_block),
ACPI_FADT_OFFSET(pm1a_control_block),
- ACPI_FADT_OFFSET(pm1_control_length)},
- {ACPI_FADT_OFFSET(xpm1b_control_block),
+ ACPI_FADT_OFFSET(pm1_control_length), ACPI_FADT_REQUIRED},
+
+ {"Pm1bControlBlock", ACPI_FADT_OFFSET(xpm1b_control_block),
ACPI_FADT_OFFSET(pm1b_control_block),
- ACPI_FADT_OFFSET(pm1_control_length)},
- {ACPI_FADT_OFFSET(xpm2_control_block),
+ ACPI_FADT_OFFSET(pm1_control_length), 0},
+
+ {"Pm2ControlBlock", ACPI_FADT_OFFSET(xpm2_control_block),
ACPI_FADT_OFFSET(pm2_control_block),
- ACPI_FADT_OFFSET(pm2_control_length)},
- {ACPI_FADT_OFFSET(xpm_timer_block), ACPI_FADT_OFFSET(pm_timer_block),
- ACPI_FADT_OFFSET(pm_timer_length)},
- {ACPI_FADT_OFFSET(xgpe0_block), ACPI_FADT_OFFSET(gpe0_block),
- ACPI_FADT_OFFSET(gpe0_block_length)},
- {ACPI_FADT_OFFSET(xgpe1_block), ACPI_FADT_OFFSET(gpe1_block),
- ACPI_FADT_OFFSET(gpe1_block_length)}
+ ACPI_FADT_OFFSET(pm2_control_length), ACPI_FADT_SEPARATE_LENGTH},
+
+ {"PmTimerBlock", ACPI_FADT_OFFSET(xpm_timer_block),
+ ACPI_FADT_OFFSET(pm_timer_block),
+ ACPI_FADT_OFFSET(pm_timer_length), ACPI_FADT_REQUIRED},
+
+ {"Gpe0Block", ACPI_FADT_OFFSET(xgpe0_block),
+ ACPI_FADT_OFFSET(gpe0_block),
+ ACPI_FADT_OFFSET(gpe0_block_length), ACPI_FADT_SEPARATE_LENGTH},
+
+ {"Gpe1Block", ACPI_FADT_OFFSET(xgpe1_block),
+ ACPI_FADT_OFFSET(gpe1_block),
+ ACPI_FADT_OFFSET(gpe1_block_length), ACPI_FADT_SEPARATE_LENGTH}
};
-#define ACPI_FADT_CONVERSION_ENTRIES (sizeof (fadt_conversion_table) / sizeof (struct acpi_fadt_conversion))
+#define ACPI_FADT_INFO_ENTRIES (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
/*******************************************************************************
*
* FUNCTION: acpi_tb_init_generic_address
*
- * PARAMETERS: new_gas_struct - GAS struct to be initialized
+ * PARAMETERS: generic_address - GAS struct to be initialized
* bit_width - Width of this register
* Address - Address of the register
*
* RETURN: None
*
- * DESCRIPTION: Initialize a GAS structure.
+ * DESCRIPTION: Initialize a Generic Address Structure (GAS)
+ * See the ACPI specification for a full description and
+ * definition of this structure.
*
******************************************************************************/
static void inline
-acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
+acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
u8 bit_width, u64 address)
{
- ACPI_MOVE_64_TO_64(&new_gas_struct->address, &address);
- new_gas_struct->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
- new_gas_struct->bit_width = bit_width;
- new_gas_struct->bit_offset = 0;
- new_gas_struct->access_width = 0;
+ /*
+ * The 64-bit Address field is non-aligned in the byte packed
+ * GAS struct.
+ */
+ ACPI_MOVE_64_TO_64(&generic_address->address, &address);
+
+ /* All other fields are byte-wide */
+
+ generic_address->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
+ generic_address->bit_width = bit_width;
+ generic_address->bit_offset = 0;
+ generic_address->access_width = 0;
}
/*******************************************************************************
@@ -139,8 +157,8 @@ void acpi_tb_parse_fadt(acpi_native_uint
struct acpi_table_header *table;
/*
- * Special case for the FADT because of multiple versions and the fact
- * that it contains pointers to both the DSDT and FACS tables.
+ * The FADT has multiple versions with different lengths,
+ * and it contains pointers to both the DSDT and FACS tables.
*
* Get a local copy of the FADT and convert it to a common format
* Map entire FADT, assumed to be smaller than one page.
@@ -160,29 +178,41 @@ void acpi_tb_parse_fadt(acpi_native_uint
*/
(void)acpi_tb_verify_checksum(table, length);
- /* Copy the entire FADT locally */
+ /*
+ * If the FADT is larger than what we know about, we have a problem.
+ * Truncate the table, but make some noise.
+ */
+ if (length > sizeof(struct acpi_table_fadt)) {
+ ACPI_WARNING((AE_INFO,
+ "FADT (revision %u) is too large, truncating length 0x%X to 0x%X",
+ table->revision, length,
+ sizeof(struct acpi_table_fadt)));
+ }
- ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
+ /* Copy the entire FADT locally. Zero first for tb_convert_fadt */
+ ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
ACPI_MEMCPY(&acpi_gbl_FADT, table,
ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
- acpi_os_unmap_memory(table, length);
- /* Convert local FADT to the common internal format */
+ /* All done with the real FADT, unmap it */
+
+ acpi_os_unmap_memory(table, length);
+ /*
+ * 1) Convert the local copy of the FADT to the common internal format
+ * 2) Validate some of the important values within the FADT
+ */
acpi_tb_convert_fadt();
+ acpi_tb_validate_fadt(&acpi_gbl_FADT);
- /* Extract the DSDT and FACS tables from the FADT */
+ /* Obtain the DSDT and FACS tables via their addresses within the FADT */
acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
-
- /* Validate important FADT values */
-
- acpi_tb_validate_fadt();
}
/*******************************************************************************
@@ -194,6 +224,7 @@ void acpi_tb_parse_fadt(acpi_native_uint
* RETURN: None
*
* DESCRIPTION: Converts all versions of the FADT to a common internal format.
+ * -> Expand all 32-bit addresses to 64-bit.
*
* NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt),
* and must contain a copy of the actual FADT.
@@ -213,13 +244,17 @@ void acpi_tb_parse_fadt(acpi_native_uint
*
******************************************************************************/
-static void acpi_tb_convert_fadt(void)
+void acpi_tb_convert_fadt(void)
{
u8 pm1_register_length;
struct acpi_generic_address *target;
acpi_native_uint i;
- /* Expand the FACS and DSDT addresses as necessary */
+ /* Update the local FADT table header length */
+
+ acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
+
+ /* Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary */
if (!acpi_gbl_FADT.Xfacs) {
acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
@@ -233,10 +268,10 @@ static void acpi_tb_convert_fadt(void)
* Expand the 32-bit V1.0 addresses to the 64-bit "X" generic address
* structures as necessary.
*/
- for (i = 0; i < ACPI_FADT_CONVERSION_ENTRIES; i++) {
+ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
target =
ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
- fadt_conversion_table[i].target);
+ fadt_info_table[i].target);
/* Expand only if the X target is null */
@@ -244,11 +279,11 @@ static void acpi_tb_convert_fadt(void)
acpi_tb_init_generic_address(target,
*ACPI_ADD_PTR(u8,
&acpi_gbl_FADT,
- fadt_conversion_table
+ fadt_info_table
[i].length),
(u64) * ACPI_ADD_PTR(u32,
&acpi_gbl_FADT,
- fadt_conversion_table
+ fadt_info_table
[i].
source));
}
@@ -265,14 +300,14 @@ static void acpi_tb_convert_fadt(void)
*/
pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
- /* PM1A is required */
+ /* The PM1A register block is required */
acpi_tb_init_generic_address(&acpi_gbl_xpm1a_enable,
pm1_register_length,
(acpi_gbl_FADT.xpm1a_event_block.address +
pm1_register_length));
- /* PM1B is optional; leave null if not present */
+ /* The PM1B register block is optional, ignore if not present */
if (acpi_gbl_FADT.xpm1b_event_block.address) {
acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
@@ -280,102 +315,84 @@ static void acpi_tb_convert_fadt(void)
(acpi_gbl_FADT.xpm1b_event_block.
address + pm1_register_length));
}
-
- /* Global FADT is the new common V2.0 FADT */
-
- acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
}
/******************************************************************************
*
* FUNCTION: acpi_tb_validate_fadt
*
- * PARAMETERS: None
+ * PARAMETERS: Table - Pointer to the FADT to be validated
*
* RETURN: None
*
- * DESCRIPTION: Validate various ACPI registers in the FADT. For problems,
- * issue a message, but no status is returned.
+ * DESCRIPTION: Validate various important fields within the FADT. If a problem
+ * is found, issue a message, but no status is returned.
+ * Used by both the table manager and the disassembler.
+ *
+ * Possible additional checks:
+ * (acpi_gbl_FADT.pm1_event_length >= 4)
+ * (acpi_gbl_FADT.pm1_control_length >= 2)
+ * (acpi_gbl_FADT.pm_timer_length >= 4)
+ * Gpe block lengths must be multiple of 2
*
******************************************************************************/
-static void acpi_tb_validate_fadt(void)
+void acpi_tb_validate_fadt(struct acpi_table_fadt *table)
{
+ u32 *address32;
+ struct acpi_generic_address *address64;
+ u8 length;
+ acpi_native_uint i;
- /* These length fields have a minimum value */
-
- if (acpi_gbl_FADT.pm1_event_length < 4) {
- acpi_tb_fadt_register_error("Pm1EventLength",
- (u32) acpi_gbl_FADT.
- pm1_event_length);
- }
-
- if (acpi_gbl_FADT.pm_timer_length < 4) {
- acpi_tb_fadt_register_error("PmTimerLength",
- (u32) acpi_gbl_FADT.
- pm_timer_length);
- }
-
- /* These length and address fields must be non-zero */
-
- if (!acpi_gbl_FADT.pm1_control_length) {
- acpi_tb_fadt_register_error("Pm1ControlLength", 0);
- }
-
- if (!acpi_gbl_FADT.xpm1a_event_block.address) {
- acpi_tb_fadt_register_error("XPm1aEventBlock.Address", 0);
- }
-
- if (!acpi_gbl_FADT.xpm1a_control_block.address) {
- acpi_tb_fadt_register_error("XPm1aControlBlock.Address", 0);
- }
-
- if (!acpi_gbl_FADT.xpm_timer_block.address) {
- acpi_tb_fadt_register_error("XPmTimerBlock.Address", 0);
- }
-
- /* If PM2 block is present, must have non-zero length */
-
- if ((acpi_gbl_FADT.xpm2_control_block.address &&
- !acpi_gbl_FADT.pm2_control_length)) {
- acpi_tb_fadt_register_error("Pm2ControlLength",
- (u32) acpi_gbl_FADT.
- pm2_control_length);
- }
-
- /* Length of any valid GPE blocks must be a multiple of 2 */
+ /* Examine all of the 64-bit extended address fields (X fields) */
+
+ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
+
+ /* Generate pointers to the 32-bit and 64-bit addresses and get the length */
+
+ address64 =
+ ACPI_ADD_PTR(struct acpi_generic_address, table,
+ fadt_info_table[i].target);
+ address32 = ACPI_ADD_PTR(u32, table, fadt_info_table[i].source);
+ length = *ACPI_ADD_PTR(u8, table, fadt_info_table[i].length);
+
+ if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
+ /*
+ * Field is required (Pm1a_event, Pm1a_control, pm_timer).
+ * Both the address and length must be non-zero.
+ */
+ if (!address64->address || !length) {
+ ACPI_ERROR((AE_INFO,
+ "Required field \"%s\" has zero address and/or length: %8.8X%8.8X/%X",
+ fadt_info_table[i].name,
+ ACPI_FORMAT_UINT64(address64->
+ address),
+ length));
+ }
+ } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {
+ /*
+ * Field is optional (PM2Control, GPE0, GPE1) AND has its own
+ * length field. If present, both the address and length must be valid.
+ */
+ if ((address64->address && !length)
+ || (!address64->address && length)) {
+ ACPI_WARNING((AE_INFO,
+ "Optional field \"%s\" has zero address or length: %8.8X%8.8X/%X",
+ fadt_info_table[i].name,
+ ACPI_FORMAT_UINT64(address64->
+ address),
+ length));
+ }
+ }
- if (acpi_gbl_FADT.xgpe0_block.address &&
- (acpi_gbl_FADT.gpe0_block_length & 1)) {
- acpi_tb_fadt_register_error("Gpe0BlockLength",
- (u32) acpi_gbl_FADT.
- gpe0_block_length);
- }
+ /* If both 32- and 64-bit addresses are valid (non-zero), they must match */
- if (acpi_gbl_FADT.xgpe1_block.address &&
- (acpi_gbl_FADT.gpe1_block_length & 1)) {
- acpi_tb_fadt_register_error("Gpe1BlockLength",
- (u32) acpi_gbl_FADT.
- gpe1_block_length);
+ if (address64->address && *address32 &&
+ (address64->address != (u64) * address32)) {
+ ACPI_ERROR((AE_INFO,
+ "32/64X address mismatch in \"%s\": [%8.8X] [%8.8X%8.8X], using 64X",
+ fadt_info_table[i].name, *address32,
+ ACPI_FORMAT_UINT64(address64->address)));
+ }
}
}
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_tb_fadt_register_error
- *
- * PARAMETERS: register_name - Pointer to string identifying register
- * Value - Actual register contents value
- *
- * RETURN: None
- *
- * DESCRIPTION: Display FADT warning message
- *
- ******************************************************************************/
-
-static void acpi_tb_fadt_register_error(char *register_name, u32 value)
-{
-
- ACPI_WARNING((AE_INFO, "Invalid FADT value in field \"%s\" = %X",
- register_name, value));
-}
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 45ef82c..f97b70e 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -278,7 +278,7 @@ acpi_tb_get_root_table_entry(u8 * table_
#if ACPI_MACHINE_WIDTH == 32
if (address64 > ACPI_UINT32_MAX) {
- /* Will truncate 64-bit address to 32 bits */
+ /* Will truncate 64-bit address to 32 bits, issue warning */
ACPI_WARNING((AE_INFO,
"64-bit Physical Address in XSDT is too large (%8.8X%8.8X), truncating",
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 99fa51a..65a69ca 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -51,6 +51,10 @@ acpi_status acpi_allocate_root_table(u32
*/
void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
+void acpi_tb_convert_fadt(void);
+
+void acpi_tb_validate_fadt(struct acpi_table_fadt *table);
+
/*
* tbfind - find ACPI table
*/
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 35/65] ACPICA: Report error if method creates 2 objects with the same name
[not found] ` <c2b3bf4643dbb78eb201b921c55d8a842d7f4d7b.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Fixed a regression where an error was no
longer emitted if a control method attempts to create 2
objects of the same name. This previously and now returns
AE_ALREADY_EXISTS. When this exception occurs, it invokes
the mechanism that will dynamically serialize the control
method to possible prevent future errors. (BZ 440)
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dswload.c | 15 ++++++++++++---
drivers/acpi/parser/psparse.c | 5 +++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index d60d062..565d455 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -547,6 +547,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_
acpi_status status;
acpi_object_type object_type;
char *buffer_ptr;
+ u32 flags;
ACPI_FUNCTION_TRACE(ds_load2_begin_op);
@@ -752,12 +753,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_
break;
}
- /* Add new entry into namespace */
+ flags = ACPI_NS_NO_UPSEARCH;
+ if (walk_state->pass_number == 3) {
+
+ /* Execution mode, node cannot already exist */
+
+ flags |= ACPI_NS_ERROR_IF_FOUND;
+ }
+
+ /* Add new entry or lookup existing entry */
status =
acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
- object_type, ACPI_IMODE_LOAD_PASS2,
- ACPI_NS_NO_UPSEARCH, walk_state, &(node));
+ object_type, ACPI_IMODE_LOAD_PASS2, flags,
+ walk_state, &node);
break;
}
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index a02aa62..6e875ce 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -540,6 +540,11 @@ acpi_status acpi_ps_parse_aml(struct acp
if ((status == AE_ALREADY_EXISTS) &&
(!walk_state->method_desc->method.mutex)) {
+ ACPI_INFO((AE_INFO,
+ "Marking method %4.4s as Serialized",
+ walk_state->method_node->name.
+ ascii));
+
/*
* Method tried to create an object twice. The probable cause is
* that the method cannot handle reentrancy.
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 36/65] ACPICA: New common routine for creating and verifying a local FADT.
[not found] ` <755518e665a471847860fece68e49ef7da20ed65.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbfadt.c | 71 ++++++++++++++++++++++++++++++------------
include/acpi/actables.h | 4 +--
2 files changed, 52 insertions(+), 23 deletions(-)
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index 8816bab..31a4a00 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -52,6 +52,10 @@ static void inline
acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
u8 bit_width, u64 address);
+static void acpi_tb_convert_fadt(void);
+
+static void acpi_tb_validate_fadt(void);
+
/* Table for conversion of FADT to common internal format and FADT validation */
typedef struct acpi_fadt_info {
@@ -178,13 +182,47 @@ void acpi_tb_parse_fadt(acpi_native_uint
*/
(void)acpi_tb_verify_checksum(table, length);
+ /* Obtain a local copy of the FADT in common ACPI 2.0+ format */
+
+ acpi_tb_create_local_fadt(table, length);
+
+ /* All done with the real FADT, unmap it */
+
+ acpi_os_unmap_memory(table, length);
+
+ /* Obtain the DSDT and FACS tables via their addresses within the FADT */
+
+ acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
+ flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
+
+ acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
+ flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_create_local_fadt
+ *
+ * PARAMETERS: Table - Pointer to BIOS FADT
+ * Length - Length of the table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Get a local copy of the FADT and convert it to a common format.
+ * Performs validation on some important FADT fields.
+ *
+ ******************************************************************************/
+
+void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
+{
+
/*
- * If the FADT is larger than what we know about, we have a problem.
+ * Check if the FADT is larger than what we know about (ACPI 2.0 version).
* Truncate the table, but make some noise.
*/
if (length > sizeof(struct acpi_table_fadt)) {
ACPI_WARNING((AE_INFO,
- "FADT (revision %u) is too large, truncating length 0x%X to 0x%X",
+ "FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%X",
table->revision, length,
sizeof(struct acpi_table_fadt)));
}
@@ -192,27 +230,16 @@ void acpi_tb_parse_fadt(acpi_native_uint
/* Copy the entire FADT locally. Zero first for tb_convert_fadt */
ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
+
ACPI_MEMCPY(&acpi_gbl_FADT, table,
ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
- /* All done with the real FADT, unmap it */
-
- acpi_os_unmap_memory(table, length);
-
/*
* 1) Convert the local copy of the FADT to the common internal format
* 2) Validate some of the important values within the FADT
*/
acpi_tb_convert_fadt();
- acpi_tb_validate_fadt(&acpi_gbl_FADT);
-
- /* Obtain the DSDT and FACS tables via their addresses within the FADT */
-
- acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
- flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
-
- acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
- flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+ acpi_tb_validate_fadt();
}
/*******************************************************************************
@@ -244,7 +271,7 @@ void acpi_tb_parse_fadt(acpi_native_uint
*
******************************************************************************/
-void acpi_tb_convert_fadt(void)
+static void acpi_tb_convert_fadt(void)
{
u8 pm1_register_length;
struct acpi_generic_address *target;
@@ -337,7 +364,7 @@ void acpi_tb_convert_fadt(void)
*
******************************************************************************/
-void acpi_tb_validate_fadt(struct acpi_table_fadt *table)
+static void acpi_tb_validate_fadt(void)
{
u32 *address32;
struct acpi_generic_address *address64;
@@ -351,10 +378,14 @@ void acpi_tb_validate_fadt(struct acpi_t
/* Generate pointers to the 32-bit and 64-bit addresses and get the length */
address64 =
- ACPI_ADD_PTR(struct acpi_generic_address, table,
+ ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
fadt_info_table[i].target);
- address32 = ACPI_ADD_PTR(u32, table, fadt_info_table[i].source);
- length = *ACPI_ADD_PTR(u8, table, fadt_info_table[i].length);
+ address32 =
+ ACPI_ADD_PTR(u32, &acpi_gbl_FADT,
+ fadt_info_table[i].source);
+ length =
+ *ACPI_ADD_PTR(u8, &acpi_gbl_FADT,
+ fadt_info_table[i].length);
if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
/*
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 65a69ca..4079f8a 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -51,9 +51,7 @@ acpi_status acpi_allocate_root_table(u32
*/
void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
-void acpi_tb_convert_fadt(void);
-
-void acpi_tb_validate_fadt(struct acpi_table_fadt *table);
+void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
/*
* tbfind - find ACPI table
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 37/65] ACPICA: Fix memory leak in table load error path
[not found] ` <6f4be3a14fbbe2a248fbc61984bf7cbd20bd281f.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/executer/exconfig.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index dd43b00..20a5ab8 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -413,7 +413,7 @@ acpi_ex_load_op(union acpi_operand_objec
*/
status = acpi_tb_add_table(table_ptr, &table_index);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto cleanup;
}
status =
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 38/65] ACPICA: Fix trace output name and whitespace
[not found] ` <73b9e5384bfbd85f9b28ac667d1f26e6a40bae1d.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/executer/exutils.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 72adcf4..e32d489 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -88,7 +88,7 @@ void acpi_ex_enter_interpreter(void)
{
acpi_status status;
- ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
+ ACPI_FUNCTION_TRACE(ex_enter_interpreter);
status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
if (ACPI_FAILURE(status)) {
@@ -116,7 +116,6 @@ void acpi_ex_enter_interpreter(void)
void acpi_ex_reacquire_interpreter(void)
{
-
ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
/*
@@ -185,7 +184,6 @@ void acpi_ex_exit_interpreter(void)
void acpi_ex_relinquish_interpreter(void)
{
-
ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
/*
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 39/65] ACPICA: Update version to 20060912
[not found] ` <a8d7bebea250db7caed8d250706cbfe6332cf505.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acconfig.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 82316e5..e5dad85 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20060831
+#define ACPI_CA_VERSION 0x20060912
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 40/65] ACPICA: Add full table name to disassembler output
[not found] ` <f2eec4942e2547d5dc3c45e0c6811ab941b4708b.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acdisasm.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index b29d77a..ea35f1f 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -101,6 +101,7 @@ typedef const struct acpi_dmtable_info {
#define ACPI_DMT_MADT 24
#define ACPI_DMT_SRAT 25
#define ACPI_DMT_EXIT 26
+#define ACPI_DMT_SIG 27
typedef
void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
@@ -109,6 +110,7 @@ struct acpi_dmtable_data {
char *signature;
struct acpi_dmtable_info *table_info;
ACPI_TABLE_HANDLER table_handler;
+ char *name;
};
struct acpi_op_walk_info {
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 41/65] ACPICA: Fix for Global Lock semaphore.
[not found] ` <d2b75254597975c3b34d6d2efd27029764e83e4c.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Fixed a problem with the Global Lock where the lock could appear to be obtained before it is actually obtained, semaphore created with one unit.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/namespace/nsaccess.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index b2ef673..2529ae9 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -214,7 +214,7 @@ acpi_status acpi_ns_root_initialize(void
/* Create additional counting semaphore for global lock */
status =
- acpi_os_create_semaphore(1, 1,
+ acpi_os_create_semaphore(1, 0,
&acpi_gbl_global_lock_semaphore);
if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 42/65] ACPICA: Remove obsolete Flags parameter.
[not found] ` <6ccc4ddcc4790ad35ecc1b433d693cd9a356d8b1.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Remove flags parameter for acpi_{get,set}_register().
It is no longer necessary now that these functions use a
spinlock for mutual exclusion.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
arch/i386/kernel/cpu/cpufreq/longhaul.c | 9 +++------
drivers/acpi/events/evevent.c | 8 +++-----
drivers/acpi/events/evmisc.c | 2 +-
drivers/acpi/events/evxfevnt.c | 12 ++++++------
drivers/acpi/hardware/hwacpi.c | 3 +--
drivers/acpi/hardware/hwregs.c | 18 +++++-------------
drivers/acpi/hardware/hwsleep.c | 22 ++++++++--------------
drivers/acpi/pci_link.c | 2 +-
drivers/acpi/processor_idle.c | 21 +++++++--------------
include/acpi/achware.h | 2 +-
include/acpi/acpixf.h | 4 ++--
11 files changed, 38 insertions(+), 65 deletions(-)
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index 1797ce7..43fcee4 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -245,8 +245,7 @@ static void longhaul_setstate(unsigned i
if (pr->flags.bm_control) {
/* Disable bus master arbitration */
- acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1);
} else if (port22_en) {
/* Disable AGP and PCI arbiters */
outb(3, 0x22);
@@ -279,16 +278,14 @@ static void longhaul_setstate(unsigned i
*/
case TYPE_POWERSAVER:
/* Don't allow wakeup */
- acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
do_powersaver(cx->address, clock_ratio_index);
break;
}
if (pr->flags.bm_control) {
/* Enable bus master arbitration */
- acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
} else if (port22_en) {
/* Enable arbiters */
outb(0, 0x22);
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
index 6b4bc99..f09d1aa 100644
--- a/drivers/acpi/events/evevent.c
+++ b/drivers/acpi/events/evevent.c
@@ -204,8 +204,7 @@ static acpi_status acpi_ev_fixed_event_i
if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) {
status =
acpi_set_register(acpi_gbl_fixed_event_info[i].
- enable_register_id, 0,
- ACPI_MTX_LOCK);
+ enable_register_id, 0);
if (ACPI_FAILURE(status)) {
return (status);
}
@@ -291,7 +290,7 @@ static u32 acpi_ev_fixed_event_dispatch(
/* Clear the status bit */
(void)acpi_set_register(acpi_gbl_fixed_event_info[event].
- status_register_id, 1, ACPI_MTX_DO_NOT_LOCK);
+ status_register_id, 1);
/*
* Make sure we've got a handler. If not, report an error.
@@ -299,8 +298,7 @@ static u32 acpi_ev_fixed_event_dispatch(
*/
if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
(void)acpi_set_register(acpi_gbl_fixed_event_info[event].
- enable_register_id, 0,
- ACPI_MTX_DO_NOT_LOCK);
+ enable_register_id, 0);
ACPI_ERROR((AE_INFO,
"No installed handler for fixed event [%08X]",
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 484d219..1d7a327 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -495,7 +495,7 @@ acpi_status acpi_ev_release_global_lock(
if (pending) {
status =
acpi_set_register(ACPI_BITREG_GLOBAL_LOCK_RELEASE,
- 1, ACPI_MTX_LOCK);
+ 1);
}
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index 91e5f5b..a3d148e 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -157,7 +157,7 @@ acpi_status acpi_enable_event(u32 event,
*/
status =
acpi_set_register(acpi_gbl_fixed_event_info[event].
- enable_register_id, 1, ACPI_MTX_LOCK);
+ enable_register_id, 1);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -166,7 +166,7 @@ acpi_status acpi_enable_event(u32 event,
status =
acpi_get_register(acpi_gbl_fixed_event_info[event].
- enable_register_id, &value, ACPI_MTX_LOCK);
+ enable_register_id, &value);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -356,14 +356,14 @@ acpi_status acpi_disable_event(u32 event
*/
status =
acpi_set_register(acpi_gbl_fixed_event_info[event].
- enable_register_id, 0, ACPI_MTX_LOCK);
+ enable_register_id, 0);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
status =
acpi_get_register(acpi_gbl_fixed_event_info[event].
- enable_register_id, &value, ACPI_MTX_LOCK);
+ enable_register_id, &value);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -409,7 +409,7 @@ acpi_status acpi_clear_event(u32 event)
*/
status =
acpi_set_register(acpi_gbl_fixed_event_info[event].
- status_register_id, 1, ACPI_MTX_LOCK);
+ status_register_id, 1);
return_ACPI_STATUS(status);
}
@@ -498,7 +498,7 @@ acpi_status acpi_get_event_status(u32 ev
status =
acpi_get_register(acpi_gbl_fixed_event_info[event].
- status_register_id, event_status, ACPI_MTX_LOCK);
+ status_register_id, event_status);
return_ACPI_STATUS(status);
}
diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c
index 9c7df71..dbcc4c0 100644
--- a/drivers/acpi/hardware/hwacpi.c
+++ b/drivers/acpi/hardware/hwacpi.c
@@ -171,8 +171,7 @@ u32 acpi_hw_get_mode(void)
return_UINT32(ACPI_SYS_MODE_ACPI);
}
- status =
- acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK);
+ status = acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value);
if (ACPI_FAILURE(status)) {
return_UINT32(ACPI_SYS_MODE_LEGACY);
}
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
index 9fe7adf..716e4ae 100644
--- a/drivers/acpi/hardware/hwregs.c
+++ b/drivers/acpi/hardware/hwregs.c
@@ -54,17 +54,15 @@ ACPI_MODULE_NAME("hwregs")
*
* FUNCTION: acpi_hw_clear_acpi_status
*
- * PARAMETERS: Flags - Lock the hardware or not
+ * PARAMETERS: None
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Clears all fixed and general purpose status bits
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
- * NOTE: TBD: Flags parameter is obsolete, to be removed
- *
******************************************************************************/
-acpi_status acpi_hw_clear_acpi_status(u32 flags)
+acpi_status acpi_hw_clear_acpi_status(void)
{
acpi_status status;
acpi_cpu_flags lock_flags = 0;
@@ -253,18 +251,15 @@ struct acpi_bit_register_info *acpi_hw_g
*
* PARAMETERS: register_id - ID of ACPI bit_register to access
* return_value - Value that was read from the register
- * Flags - Lock the hardware or not
*
* RETURN: Status and the value read from specified Register. Value
* returned is normalized to bit0 (is shifted all the way right)
*
* DESCRIPTION: ACPI bit_register read function.
*
- * NOTE: TBD: Flags parameter is obsolete, to be removed
- *
******************************************************************************/
-acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags)
+acpi_status acpi_get_register(u32 register_id, u32 * return_value)
{
u32 register_value = 0;
struct acpi_bit_register_info *bit_reg_info;
@@ -312,16 +307,13 @@ ACPI_EXPORT_SYMBOL(acpi_get_register)
* PARAMETERS: register_id - ID of ACPI bit_register to access
* Value - (only used on write) value to write to the
* Register, NOT pre-normalized to the bit pos
- * Flags - Lock the hardware or not
*
* RETURN: Status
*
* DESCRIPTION: ACPI Bit Register write function.
*
- * NOTE: TBD: Flags parameter is obsolete, to be removed
- *
******************************************************************************/
-acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags)
+acpi_status acpi_set_register(u32 register_id, u32 value)
{
u32 register_value = 0;
struct acpi_bit_register_info *bit_reg_info;
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index 6faa76b..7c96451 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -277,15 +277,14 @@ acpi_status asmlinkage acpi_enter_sleep_
/* Clear wake status */
- status =
- acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
+ status = acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Clear all fixed and general purpose status bits */
- status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
+ status = acpi_hw_clear_acpi_status();
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -398,8 +397,7 @@ acpi_status asmlinkage acpi_enter_sleep_
/* Wait until we enter sleep state */
do {
- status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value,
- ACPI_MTX_DO_NOT_LOCK);
+ status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -432,13 +430,12 @@ acpi_status asmlinkage acpi_enter_sleep_
ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios);
- status =
- acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
+ status = acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
- status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
+ status = acpi_hw_clear_acpi_status();
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -465,8 +462,7 @@ acpi_status asmlinkage acpi_enter_sleep_
do {
acpi_os_stall(1000);
- status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value,
- ACPI_MTX_DO_NOT_LOCK);
+ status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -599,13 +595,11 @@ acpi_status acpi_leave_sleep_state(u8 sl
(void)
acpi_set_register(acpi_gbl_fixed_event_info
- [ACPI_EVENT_POWER_BUTTON].enable_register_id, 1,
- ACPI_MTX_DO_NOT_LOCK);
+ [ACPI_EVENT_POWER_BUTTON].enable_register_id, 1);
(void)
acpi_set_register(acpi_gbl_fixed_event_info
- [ACPI_EVENT_POWER_BUTTON].status_register_id, 1,
- ACPI_MTX_DO_NOT_LOCK);
+ [ACPI_EVENT_POWER_BUTTON].status_register_id, 1);
arg.integer.value = ACPI_SST_WORKING;
status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 5aaf358..5f5a9c0 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -787,7 +787,7 @@ static int irqrouter_resume(struct sys_d
/* Make sure SCI is enabled again (Apple firmware bug?) */
- acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
list_for_each(node, &acpi_link.entries) {
link = list_entry(node, struct acpi_pci_link, node);
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 4208ab7..b419586 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -187,8 +187,7 @@ acpi_processor_power_activate(struct acp
case ACPI_STATE_C3:
/* Disable bus master reload */
if (new->type != ACPI_STATE_C3 && pr->flags.bm_check)
- acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
break;
}
}
@@ -198,8 +197,7 @@ acpi_processor_power_activate(struct acp
case ACPI_STATE_C3:
/* Enable bus master reload */
if (old->type != ACPI_STATE_C3 && pr->flags.bm_check)
- acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
break;
}
@@ -287,12 +285,10 @@ static void acpi_processor_idle(void)
pr->power.bm_activity <<= diff;
- acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
- &bm_status, ACPI_MTX_DO_NOT_LOCK);
+ acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
if (bm_status) {
pr->power.bm_activity |= 0x1;
- acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS,
- 1, ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
}
/*
* PIIX4 Erratum #18: Note that BM_STS doesn't always reflect
@@ -404,8 +400,7 @@ static void acpi_processor_idle(void)
* All CPUs are trying to go to C3
* Disable bus master arbitration
*/
- acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1);
}
} else {
/* SMP with no shared cache... Invalidate cache */
@@ -421,8 +416,7 @@ static void acpi_processor_idle(void)
if (pr->flags.bm_check) {
/* Enable bus master arbitration */
atomic_dec(&c3_cpu_count);
- acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
- ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
}
#ifdef CONFIG_GENERIC_TIME
@@ -882,8 +876,7 @@ static void acpi_processor_power_verify_
" for C3 to be enabled on SMP systems\n"));
return;
}
- acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD,
- 0, ACPI_MTX_DO_NOT_LOCK);
+ acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
}
/*
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index f3e9a03..ae449f2 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -82,7 +82,7 @@ acpi_hw_low_level_read(u32 width,
acpi_status
acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
-acpi_status acpi_hw_clear_acpi_status(u32 flags);
+acpi_status acpi_hw_clear_acpi_status(void);
/*
* hwgpe - GPE support
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 4a5b14b..035a5a8 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -306,9 +306,9 @@ acpi_resource_to_address64(struct acpi_r
/*
* Hardware (ACPI device) interfaces
*/
-acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags);
+acpi_status acpi_get_register(u32 register_id, u32 * return_value);
-acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags);
+acpi_status acpi_set_register(u32 register_id, u32 value);
acpi_status
acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 43/65] ACPICA: Use faster ByIndex interface to get FACS
[not found] ` <d24e96ccb3551ff33821c306179ed02ad89fb041.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evmisc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 1d7a327..a2dbcb9 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -349,8 +349,8 @@ acpi_status acpi_ev_init_global_lock_han
ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
status =
- acpi_get_table(ACPI_SIG_FACS, 0,
- (struct acpi_table_header **)&facs);
+ acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+ (struct acpi_table_header **)&facs);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 44/65] ACPICA: On AML mutex force-release, set depth to zero (was 1).
[not found] ` <bbdd9137672564c57f2c4bf8a00ca1e9c0b8d455.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/executer/exmutex.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index e30cc53..4ae1d83 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -329,6 +329,12 @@ acpi_ex_release_mutex(union acpi_operand
*
* DESCRIPTION: Release all mutexes held by this thread
*
+ * NOTE: This function is called as the thread is exiting the interpreter.
+ * Mutexes are not released when an individual control method is exited, but
+ * only when the parent thread actually exits the interpreter. This allows one
+ * method to acquire a mutex, and a different method to release it, as long as
+ * this is performed underneath a single parent control method.
+ *
******************************************************************************/
void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
@@ -346,7 +352,7 @@ void acpi_ex_release_all_mutexes(struct
obj_desc->mutex.prev = NULL;
obj_desc->mutex.next = NULL;
- obj_desc->mutex.acquisition_depth = 1;
+ obj_desc->mutex.acquisition_depth = 0;
/* Release the mutex, special case for Global Lock */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 45/65] ACPICA: Update interpreter error paths to always report the error
[not found] ` <fe21784a741d247ff18c34d67d56f5d374a0b5cb.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dswexec.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index d7a616c..b5b8f16 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -219,7 +219,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_s
if (!op) {
status = acpi_ds_load2_begin_op(walk_state, out_op);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto error_exit;
}
op = *out_op;
@@ -238,7 +238,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_s
status = acpi_ds_scope_stack_pop(walk_state);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto error_exit;
}
}
}
@@ -287,7 +287,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_s
status = acpi_ds_result_stack_push(walk_state);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto error_exit;
}
status = acpi_ds_exec_begin_control_op(walk_state, op);
@@ -328,6 +328,10 @@ acpi_ds_exec_begin_op(struct acpi_walk_s
/* Nothing to do here during method execution */
return_ACPI_STATUS(status);
+
+ error_exit:
+ status = acpi_ds_method_error(status, walk_state);
+ return_ACPI_STATUS(status);
}
/*****************************************************************************
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 46/65] ACPICA: Fix for possible memory leak and fault.
[not found] ` <d9debf4714e309c46d37e11d73f3eef7bdff67ff.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Fixed a possible memory leak and fault in acpi_ex_resolve_object_to_value()
during a read from a buffer or region field. (BZ 458)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/executer/exresolv.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 6499de8..fa17f55 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -141,7 +141,7 @@ acpi_ex_resolve_object_to_value(union ac
acpi_status status = AE_OK;
union acpi_operand_object *stack_desc;
void *temp_node;
- union acpi_operand_object *obj_desc;
+ union acpi_operand_object *obj_desc = NULL;
u16 opcode;
ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
@@ -299,8 +299,6 @@ acpi_ex_resolve_object_to_value(union ac
status = acpi_ds_get_package_arguments(stack_desc);
break;
- /* These cases may never happen here, but just in case.. */
-
case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
@@ -314,6 +312,10 @@ acpi_ex_resolve_object_to_value(union ac
status =
acpi_ex_read_data_from_field(walk_state, stack_desc,
&obj_desc);
+
+ /* Remove a reference to the original operand, then override */
+
+ acpi_ut_remove_reference(*stack_ptr);
*stack_ptr = (void *)obj_desc;
break;
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 47/65] ACPICA: Add new subsystem state bit that is set after SubsystemInitialize is called
[not found] ` <128d1711966b7242572b7b68e1522a21790a372c.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/utilities/utxface.c | 1 +
include/acpi/actypes.h | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index bec0f54..0a3202d 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -67,6 +67,7 @@ acpi_status acpi_initialize_subsystem(vo
ACPI_FUNCTION_TRACE(acpi_initialize_subsystem);
+ acpi_gbl_startup_flags = ACPI_SUBSYSTEM_INITIALIZE;
ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace());
/* Initialize the OS-Dependent layer */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index fe9eb0e..6fa3f2a 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -412,7 +412,8 @@ typedef u64 acpi_integer;
/*
* Initialization state
*/
-#define ACPI_INITIALIZED_OK 0x01
+#define ACPI_SUBSYSTEM_INITIALIZE 0x01
+#define ACPI_INITIALIZED_OK 0x02
/*
* Power state values
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 48/65] ACPICA: Update version to 20060927
[not found] ` <92e90a77b802be0d2d0f3e1ace087fc5ccbaad39.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acconfig.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index e5dad85..5f1ce1f 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20060912
+#define ACPI_CA_VERSION 0x20060927
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 49/65] ACPICA: Restructured module into multiple functions.
[not found] ` <e885033cdaa6db92d00b3ea53e69763ba45ef7df.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:18 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:18 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Restructured the AML ParseLoop function, breaking it into several
subfunctions in order to reduce CPU stack use and improve maintainability
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/parser/psloop.c | 1406 +++++++++++++++++++++++-------------------
include/acpi/acexcep.h | 8 +-
2 files changed, 789 insertions(+), 625 deletions(-)
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index e1541db..a83be52 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -42,12 +42,11 @@
*/
/*
- * Parse the AML and build an operation tree as most interpreters,
- * like Perl, do. Parsing is done by hand rather than with a YACC
- * generated parser to tightly constrain stack and dynamic memory
- * usage. At the same time, parsing is kept flexible and the code
- * fairly compact by parsing based on a list of AML opcode
- * templates in aml_op_info[]
+ * Parse the AML and build an operation tree as most interpreters, (such as
+ * Perl) do. Parsing is done by hand rather than with a YACC generated parser
+ * to tightly constrain stack and dynamic memory usage. Parsing is kept
+ * flexible and the code fairly compact by parsing based on a list of AML
+ * opcode templates in aml_op_info[].
*/
#include <acpi/acpi.h>
@@ -60,766 +59,679 @@ ACPI_MODULE_NAME("psloop")
static u32 acpi_gbl_depth = 0;
+/* Local prototypes */
+
+static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state);
+
+static acpi_status
+acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
+ u8 * aml_op_start,
+ union acpi_parse_object *unnamed_op,
+ union acpi_parse_object **op);
+
+static acpi_status
+acpi_ps_create_op(struct acpi_walk_state *walk_state,
+ u8 * aml_op_start, union acpi_parse_object **new_op);
+
+static acpi_status
+acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
+ u8 * aml_op_start, union acpi_parse_object *op);
+
+static acpi_status
+acpi_ps_complete_op(struct acpi_walk_state *walk_state,
+ union acpi_parse_object **op, acpi_status status);
+
+static acpi_status
+acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
+ union acpi_parse_object *op, acpi_status status);
+
/*******************************************************************************
*
- * FUNCTION: acpi_ps_parse_loop
+ * FUNCTION: acpi_ps_get_aml_opcode
*
* PARAMETERS: walk_state - Current state
*
* RETURN: Status
*
- * DESCRIPTION: Parse AML (pointed to by the current parser state) and return
- * a tree of ops.
+ * DESCRIPTION: Extract the next AML opcode from the input stream.
*
******************************************************************************/
-acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
+static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
{
- acpi_status status = AE_OK;
- acpi_status status2;
- union acpi_parse_object *op = NULL; /* current op */
- union acpi_parse_object *arg = NULL;
- union acpi_parse_object *pre_op = NULL;
- struct acpi_parse_state *parser_state;
- u8 *aml_op_start = NULL;
- ACPI_FUNCTION_TRACE_PTR(ps_parse_loop, walk_state);
+ ACPI_FUNCTION_TRACE_PTR(ps_get_aml_opcode, walk_state);
- if (walk_state->descending_callback == NULL) {
- return_ACPI_STATUS(AE_BAD_PARAMETER);
- }
+ walk_state->aml_offset =
+ (u32) ACPI_PTR_DIFF(walk_state->parser_state.aml,
+ walk_state->parser_state.aml_start);
+ walk_state->opcode = acpi_ps_peek_opcode(&(walk_state->parser_state));
- parser_state = &walk_state->parser_state;
- walk_state->arg_types = 0;
+ /*
+ * First cut to determine what we have found:
+ * 1) A valid AML opcode
+ * 2) A name string
+ * 3) An unknown/invalid opcode
+ */
+ walk_state->op_info = acpi_ps_get_opcode_info(walk_state->opcode);
-#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
+ switch (walk_state->op_info->class) {
+ case AML_CLASS_ASCII:
+ case AML_CLASS_PREFIX:
+ /*
+ * Starts with a valid prefix or ASCII char, this is a name
+ * string. Convert the bare name string to a namepath.
+ */
+ walk_state->opcode = AML_INT_NAMEPATH_OP;
+ walk_state->arg_types = ARGP_NAMESTRING;
+ break;
- if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) {
+ case AML_CLASS_UNKNOWN:
- /* We are restarting a preempted control method */
+ /* The opcode is unrecognized. Just skip unknown opcodes */
- if (acpi_ps_has_completed_scope(parser_state)) {
- /*
- * We must check if a predicate to an IF or WHILE statement
- * was just completed
- */
- if ((parser_state->scope->parse_scope.op) &&
- ((parser_state->scope->parse_scope.op->common.
- aml_opcode == AML_IF_OP)
- || (parser_state->scope->parse_scope.op->common.
- aml_opcode == AML_WHILE_OP))
- && (walk_state->control_state)
- && (walk_state->control_state->common.state ==
- ACPI_CONTROL_PREDICATE_EXECUTING)) {
- /*
- * A predicate was just completed, get the value of the
- * predicate and branch based on that value
- */
- walk_state->op = NULL;
- status =
- acpi_ds_get_predicate_value(walk_state,
- ACPI_TO_POINTER
- (TRUE));
- if (ACPI_FAILURE(status)
- && ((status & AE_CODE_MASK) !=
- AE_CODE_CONTROL)) {
- if (status == AE_AML_NO_RETURN_VALUE) {
- ACPI_EXCEPTION((AE_INFO, status,
- "Invoked method did not return a value"));
+ ACPI_ERROR((AE_INFO,
+ "Found unknown opcode %X at AML address %p offset %X, ignoring",
+ walk_state->opcode, walk_state->parser_state.aml,
+ walk_state->aml_offset));
- }
- ACPI_EXCEPTION((AE_INFO, status,
- "GetPredicate Failed"));
- return_ACPI_STATUS(status);
- }
+ ACPI_DUMP_BUFFER(walk_state->parser_state.aml, 128);
- status =
- acpi_ps_next_parse_state(walk_state, op,
- status);
- }
+ /* Assume one-byte bad opcode */
- acpi_ps_pop_scope(parser_state, &op,
- &walk_state->arg_types,
- &walk_state->arg_count);
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
- "Popped scope, Op=%p\n", op));
- } else if (walk_state->prev_op) {
+ walk_state->parser_state.aml++;
+ return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
- /* We were in the middle of an op */
+ default:
- op = walk_state->prev_op;
- walk_state->arg_types = walk_state->prev_arg_types;
- }
+ /* Found opcode info, this is a normal opcode */
+
+ walk_state->parser_state.aml +=
+ acpi_ps_get_opcode_size(walk_state->opcode);
+ walk_state->arg_types = walk_state->op_info->parse_args;
+ break;
}
-#endif
- /* Iterative parsing loop, while there is more AML to process: */
+ return_ACPI_STATUS(AE_OK);
+}
- while ((parser_state->aml < parser_state->aml_end) || (op)) {
- aml_op_start = parser_state->aml;
- if (!op) {
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_build_named_op
+ *
+ * PARAMETERS: walk_state - Current state
+ * aml_op_start - Begin of named Op in AML
+ * unnamed_op - Early Op (not a named Op)
+ * Op - Returned Op
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse a named Op
+ *
+ ******************************************************************************/
- /* Get the next opcode from the AML stream */
+static acpi_status
+acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
+ u8 * aml_op_start,
+ union acpi_parse_object *unnamed_op,
+ union acpi_parse_object **op)
+{
+ acpi_status status = AE_OK;
+ union acpi_parse_object *arg = NULL;
- walk_state->aml_offset =
- (u32) ACPI_PTR_DIFF(parser_state->aml,
- parser_state->aml_start);
- walk_state->opcode = acpi_ps_peek_opcode(parser_state);
+ ACPI_FUNCTION_TRACE_PTR(ps_build_named_op, walk_state);
- /*
- * First cut to determine what we have found:
- * 1) A valid AML opcode
- * 2) A name string
- * 3) An unknown/invalid opcode
- */
- walk_state->op_info =
- acpi_ps_get_opcode_info(walk_state->opcode);
- switch (walk_state->op_info->class) {
- case AML_CLASS_ASCII:
- case AML_CLASS_PREFIX:
- /*
- * Starts with a valid prefix or ASCII char, this is a name
- * string. Convert the bare name string to a namepath.
- */
- walk_state->opcode = AML_INT_NAMEPATH_OP;
- walk_state->arg_types = ARGP_NAMESTRING;
- break;
+ unnamed_op->common.value.arg = NULL;
+ unnamed_op->common.aml_opcode = walk_state->opcode;
- case AML_CLASS_UNKNOWN:
+ /*
+ * Get and append arguments until we find the node that contains
+ * the name (the type ARGP_NAME).
+ */
+ while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) &&
+ (GET_CURRENT_ARG_TYPE(walk_state->arg_types) != ARGP_NAME)) {
+ status =
+ acpi_ps_get_next_arg(walk_state,
+ &(walk_state->parser_state),
+ GET_CURRENT_ARG_TYPE(walk_state->
+ arg_types), &arg);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
- /* The opcode is unrecognized. Just skip unknown opcodes */
+ acpi_ps_append_arg(unnamed_op, arg);
+ INCREMENT_ARG_LIST(walk_state->arg_types);
+ }
- ACPI_ERROR((AE_INFO,
- "Found unknown opcode %X at AML address %p offset %X, ignoring",
- walk_state->opcode,
- parser_state->aml,
- walk_state->aml_offset));
+ /*
+ * Make sure that we found a NAME and didn't run out of arguments
+ */
+ if (!GET_CURRENT_ARG_TYPE(walk_state->arg_types)) {
+ return_ACPI_STATUS(AE_AML_NO_OPERAND);
+ }
- ACPI_DUMP_BUFFER(parser_state->aml, 128);
+ /* We know that this arg is a name, move to next arg */
- /* Assume one-byte bad opcode */
+ INCREMENT_ARG_LIST(walk_state->arg_types);
- parser_state->aml++;
- continue;
+ /*
+ * Find the object. This will either insert the object into
+ * the namespace or simply look it up
+ */
+ walk_state->op = NULL;
- default:
+ status = walk_state->descending_callback(walk_state, op);
+ if (ACPI_FAILURE(status)) {
+ ACPI_EXCEPTION((AE_INFO, status, "During name lookup/catalog"));
+ return_ACPI_STATUS(status);
+ }
- /* Found opcode info, this is a normal opcode */
+ if (!op) {
+ return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
+ }
- parser_state->aml +=
- acpi_ps_get_opcode_size(walk_state->opcode);
- walk_state->arg_types =
- walk_state->op_info->parse_args;
- break;
- }
+ status = acpi_ps_next_parse_state(walk_state, *op, status);
+ if (ACPI_FAILURE(status)) {
+ if (status == AE_CTRL_PENDING) {
+ return_ACPI_STATUS(AE_CTRL_PARSE_PENDING);
+ }
+ return_ACPI_STATUS(status);
+ }
- /* Create Op structure and append to parent's argument list */
+ acpi_ps_append_arg(*op, unnamed_op->common.value.arg);
+ acpi_gbl_depth++;
- if (walk_state->op_info->flags & AML_NAMED) {
+ if ((*op)->common.aml_opcode == AML_REGION_OP) {
+ /*
+ * Defer final parsing of an operation_region body, because we don't
+ * have enough info in the first pass to parse it correctly (i.e.,
+ * there may be method calls within the term_arg elements of the body.)
+ *
+ * However, we must continue parsing because the opregion is not a
+ * standalone package -- we don't know where the end is at this point.
+ *
+ * (Length is unknown until parse of the body complete)
+ */
+ (*op)->named.data = aml_op_start;
+ (*op)->named.length = 0;
+ }
- /* Allocate a new pre_op if necessary */
+ return_ACPI_STATUS(AE_OK);
+}
- if (!pre_op) {
- pre_op =
- acpi_ps_alloc_op(walk_state->
- opcode);
- if (!pre_op) {
- status = AE_NO_MEMORY;
- goto close_this_op;
- }
- }
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_create_op
+ *
+ * PARAMETERS: walk_state - Current state
+ * aml_op_start - Op start in AML
+ * new_op - Returned Op
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get Op from AML
+ *
+ ******************************************************************************/
- pre_op->common.value.arg = NULL;
- pre_op->common.aml_opcode = walk_state->opcode;
+static acpi_status
+acpi_ps_create_op(struct acpi_walk_state *walk_state,
+ u8 * aml_op_start, union acpi_parse_object **new_op)
+{
+ acpi_status status = AE_OK;
+ union acpi_parse_object *op;
+ union acpi_parse_object *named_op = NULL;
- /*
- * Get and append arguments until we find the node that contains
- * the name (the type ARGP_NAME).
- */
- while (GET_CURRENT_ARG_TYPE
- (walk_state->arg_types)
- &&
- (GET_CURRENT_ARG_TYPE
- (walk_state->arg_types) != ARGP_NAME)) {
- status =
- acpi_ps_get_next_arg(walk_state,
- parser_state,
- GET_CURRENT_ARG_TYPE
- (walk_state->
- arg_types),
- &arg);
- if (ACPI_FAILURE(status)) {
- goto close_this_op;
- }
+ ACPI_FUNCTION_TRACE_PTR(ps_create_op, walk_state);
- acpi_ps_append_arg(pre_op, arg);
- INCREMENT_ARG_LIST(walk_state->
- arg_types);
- }
+ status = acpi_ps_get_aml_opcode(walk_state);
+ if (status == AE_CTRL_PARSE_CONTINUE) {
+ return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
+ }
- /*
- * Make sure that we found a NAME and didn't run out of
- * arguments
- */
- if (!GET_CURRENT_ARG_TYPE
- (walk_state->arg_types)) {
- status = AE_AML_NO_OPERAND;
- goto close_this_op;
- }
+ /* Create Op structure and append to parent's argument list */
- /* We know that this arg is a name, move to next arg */
+ walk_state->op_info = acpi_ps_get_opcode_info(walk_state->opcode);
+ op = acpi_ps_alloc_op(walk_state->opcode);
+ if (!op) {
+ return_ACPI_STATUS(AE_NO_MEMORY);
+ }
- INCREMENT_ARG_LIST(walk_state->arg_types);
+ if (walk_state->op_info->flags & AML_NAMED) {
+ status =
+ acpi_ps_build_named_op(walk_state, aml_op_start, op,
+ &named_op);
+ acpi_ps_free_op(op);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
- /*
- * Find the object. This will either insert the object into
- * the namespace or simply look it up
- */
- walk_state->op = NULL;
+ *new_op = named_op;
+ return_ACPI_STATUS(AE_OK);
+ }
- status =
- walk_state->descending_callback(walk_state,
- &op);
- if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status,
- "During name lookup/catalog"));
- goto close_this_op;
- }
+ /* Not a named opcode, just allocate Op and append to parent */
- if (!op) {
- continue;
- }
+ if (walk_state->op_info->flags & AML_CREATE) {
+ /*
+ * Backup to beginning of create_xXXfield declaration
+ * body_length is unknown until we parse the body
+ */
+ op->named.data = aml_op_start;
+ op->named.length = 0;
+ }
- status =
- acpi_ps_next_parse_state(walk_state, op,
- status);
- if (status == AE_CTRL_PENDING) {
- status = AE_OK;
- goto close_this_op;
- }
+ acpi_ps_append_arg(acpi_ps_get_parent_scope
+ (&(walk_state->parser_state)), op);
- if (ACPI_FAILURE(status)) {
- goto close_this_op;
- }
+ if (walk_state->descending_callback != NULL) {
+ /*
+ * Find the object. This will either insert the object into
+ * the namespace or simply look it up
+ */
+ walk_state->op = *new_op = op;
- acpi_ps_append_arg(op,
- pre_op->common.value.arg);
- acpi_gbl_depth++;
-
- if (op->common.aml_opcode == AML_REGION_OP) {
- /*
- * Defer final parsing of an operation_region body,
- * because we don't have enough info in the first pass
- * to parse it correctly (i.e., there may be method
- * calls within the term_arg elements of the body.)
- *
- * However, we must continue parsing because
- * the opregion is not a standalone package --
- * we don't know where the end is at this point.
- *
- * (Length is unknown until parse of the body complete)
- */
- op->named.data = aml_op_start;
- op->named.length = 0;
- }
- } else {
- /* Not a named opcode, just allocate Op and append to parent */
+ status = walk_state->descending_callback(walk_state, &op);
+ status = acpi_ps_next_parse_state(walk_state, op, status);
+ if (status == AE_CTRL_PENDING) {
+ status = AE_CTRL_PARSE_PENDING;
+ }
+ }
- walk_state->op_info =
- acpi_ps_get_opcode_info(walk_state->opcode);
- op = acpi_ps_alloc_op(walk_state->opcode);
- if (!op) {
- status = AE_NO_MEMORY;
- goto close_this_op;
- }
+ return_ACPI_STATUS(status);
+}
- if (walk_state->op_info->flags & AML_CREATE) {
- /*
- * Backup to beginning of create_xXXfield declaration
- * body_length is unknown until we parse the body
- */
- op->named.data = aml_op_start;
- op->named.length = 0;
- }
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_get_arguments
+ *
+ * PARAMETERS: walk_state - Current state
+ * aml_op_start - Op start in AML
+ * Op - Current Op
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get arguments for passed Op.
+ *
+ ******************************************************************************/
- acpi_ps_append_arg(acpi_ps_get_parent_scope
- (parser_state), op);
+static acpi_status
+acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
+ u8 * aml_op_start, union acpi_parse_object *op)
+{
+ acpi_status status = AE_OK;
+ union acpi_parse_object *arg = NULL;
- if ((walk_state->descending_callback != NULL)) {
- /*
- * Find the object. This will either insert the object into
- * the namespace or simply look it up
- */
- walk_state->op = op;
+ ACPI_FUNCTION_TRACE_PTR(ps_get_arguments, walk_state);
- status =
- walk_state->
- descending_callback(walk_state,
- &op);
- status =
- acpi_ps_next_parse_state(walk_state,
- op,
- status);
- if (status == AE_CTRL_PENDING) {
- status = AE_OK;
- goto close_this_op;
- }
+ switch (op->common.aml_opcode) {
+ case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
+ case AML_WORD_OP: /* AML_WORDDATA_ARG */
+ case AML_DWORD_OP: /* AML_DWORDATA_ARG */
+ case AML_QWORD_OP: /* AML_QWORDATA_ARG */
+ case AML_STRING_OP: /* AML_ASCIICHARLIST_ARG */
- if (ACPI_FAILURE(status)) {
- goto close_this_op;
- }
- }
- }
+ /* Fill in constant or string argument directly */
- op->common.aml_offset = walk_state->aml_offset;
+ acpi_ps_get_next_simple_arg(&(walk_state->parser_state),
+ GET_CURRENT_ARG_TYPE(walk_state->
+ arg_types),
+ op);
+ break;
- if (walk_state->op_info) {
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
- "Opcode %4.4X [%s] Op %p Aml %p AmlOffset %5.5X\n",
- (u32) op->common.aml_opcode,
- walk_state->op_info->name, op,
- parser_state->aml,
- op->common.aml_offset));
- }
+ case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
+
+ status =
+ acpi_ps_get_next_namepath(walk_state,
+ &(walk_state->parser_state), op,
+ 1);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
}
+ walk_state->arg_types = 0;
+ break;
+
+ default:
/*
- * Start arg_count at zero because we don't know if there are
- * any args yet
+ * Op is not a constant or string, append each argument to the Op
*/
- walk_state->arg_count = 0;
-
- /* Are there any arguments that must be processed? */
-
- if (walk_state->arg_types) {
-
- /* Get arguments */
-
- switch (op->common.aml_opcode) {
- case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
- case AML_WORD_OP: /* AML_WORDDATA_ARG */
- case AML_DWORD_OP: /* AML_DWORDATA_ARG */
- case AML_QWORD_OP: /* AML_QWORDATA_ARG */
- case AML_STRING_OP: /* AML_ASCIICHARLIST_ARG */
-
- /* Fill in constant or string argument directly */
-
- acpi_ps_get_next_simple_arg(parser_state,
- GET_CURRENT_ARG_TYPE
- (walk_state->
- arg_types), op);
- break;
-
- case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
-
- status =
- acpi_ps_get_next_namepath(walk_state,
- parser_state, op,
- 1);
- if (ACPI_FAILURE(status)) {
- goto close_this_op;
- }
-
- walk_state->arg_types = 0;
- break;
+ while (GET_CURRENT_ARG_TYPE(walk_state->arg_types)
+ && !walk_state->arg_count) {
+ walk_state->aml_offset =
+ (u32) ACPI_PTR_DIFF(walk_state->parser_state.aml,
+ walk_state->parser_state.
+ aml_start);
- default:
- /*
- * Op is not a constant or string, append each argument
- * to the Op
- */
- while (GET_CURRENT_ARG_TYPE
- (walk_state->arg_types)
- && !walk_state->arg_count) {
- walk_state->aml_offset = (u32)
- ACPI_PTR_DIFF(parser_state->aml,
- parser_state->
- aml_start);
+ status =
+ acpi_ps_get_next_arg(walk_state,
+ &(walk_state->parser_state),
+ GET_CURRENT_ARG_TYPE
+ (walk_state->arg_types), &arg);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
- status =
- acpi_ps_get_next_arg(walk_state,
- parser_state,
- GET_CURRENT_ARG_TYPE
- (walk_state->
- arg_types),
- &arg);
- if (ACPI_FAILURE(status)) {
- goto close_this_op;
- }
+ if (arg) {
+ arg->common.aml_offset = walk_state->aml_offset;
+ acpi_ps_append_arg(op, arg);
+ }
- if (arg) {
- arg->common.aml_offset =
- walk_state->aml_offset;
- acpi_ps_append_arg(op, arg);
- }
- INCREMENT_ARG_LIST(walk_state->
- arg_types);
- }
+ INCREMENT_ARG_LIST(walk_state->arg_types);
+ }
- /* Special processing for certain opcodes */
+ /* Special processing for certain opcodes */
- /* TBD (remove): Temporary mechanism to disable this code if needed */
+ /* TBD (remove): Temporary mechanism to disable this code if needed */
#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
- if ((walk_state->pass_number <=
- ACPI_IMODE_LOAD_PASS1)
- &&
- ((walk_state->
- parse_flags & ACPI_PARSE_DISASSEMBLE) ==
- 0)) {
- /*
- * We want to skip If/Else/While constructs during Pass1
- * because we want to actually conditionally execute the
- * code during Pass2.
- *
- * Except for disassembly, where we always want to
- * walk the If/Else/While packages
- */
- switch (op->common.aml_opcode) {
- case AML_IF_OP:
- case AML_ELSE_OP:
- case AML_WHILE_OP:
-
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
- "Pass1: Skipping an If/Else/While body\n"));
-
- /* Skip body of if/else/while in pass 1 */
-
- parser_state->aml =
- parser_state->pkg_end;
- walk_state->arg_count = 0;
- break;
-
- default:
- break;
- }
- }
-#endif
- switch (op->common.aml_opcode) {
- case AML_METHOD_OP:
-
- /*
- * Skip parsing of control method
- * because we don't have enough info in the first pass
- * to parse it correctly.
- *
- * Save the length and address of the body
- */
- op->named.data = parser_state->aml;
- op->named.length =
- (u32) (parser_state->pkg_end -
- parser_state->aml);
-
- /* Skip body of method */
-
- parser_state->aml =
- parser_state->pkg_end;
- walk_state->arg_count = 0;
- break;
-
- case AML_BUFFER_OP:
- case AML_PACKAGE_OP:
- case AML_VAR_PACKAGE_OP:
-
- if ((op->common.parent) &&
- (op->common.parent->common.
- aml_opcode == AML_NAME_OP)
- && (walk_state->pass_number <=
- ACPI_IMODE_LOAD_PASS2)) {
- /*
- * Skip parsing of Buffers and Packages
- * because we don't have enough info in the first pass
- * to parse them correctly.
- */
- op->named.data = aml_op_start;
- op->named.length =
- (u32) (parser_state->
- pkg_end -
- aml_op_start);
-
- /* Skip body */
-
- parser_state->aml =
- parser_state->pkg_end;
- walk_state->arg_count = 0;
- }
- break;
+ if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
+ ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
+ /*
+ * We want to skip If/Else/While constructs during Pass1 because we
+ * want to actually conditionally execute the code during Pass2.
+ *
+ * Except for disassembly, where we always want to walk the
+ * If/Else/While packages
+ */
+ switch (op->common.aml_opcode) {
+ case AML_IF_OP:
+ case AML_ELSE_OP:
+ case AML_WHILE_OP:
- case AML_WHILE_OP:
+ ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
+ "Pass1: Skipping an If/Else/While body\n"));
- if (walk_state->control_state) {
- walk_state->control_state->
- control.package_end =
- parser_state->pkg_end;
- }
- break;
+ /* Skip body of if/else/while in pass 1 */
- default:
+ walk_state->parser_state.aml =
+ walk_state->parser_state.pkg_end;
+ walk_state->arg_count = 0;
+ break;
- /* No action for all other opcodes */
- break;
- }
+ default:
break;
}
}
+#endif
- /* Check for arguments that need to be processed */
-
- if (walk_state->arg_count) {
+ switch (op->common.aml_opcode) {
+ case AML_METHOD_OP:
/*
- * There are arguments (complex ones), push Op and
- * prepare for argument
+ * Skip parsing of control method because we don't have enough
+ * info in the first pass to parse it correctly.
+ *
+ * Save the length and address of the body
*/
- status = acpi_ps_push_scope(parser_state, op,
- walk_state->arg_types,
- walk_state->arg_count);
- if (ACPI_FAILURE(status)) {
- goto close_this_op;
- }
- op = NULL;
- continue;
- }
+ op->named.data = walk_state->parser_state.aml;
+ op->named.length = (u32)
+ (walk_state->parser_state.pkg_end -
+ walk_state->parser_state.aml);
- /*
- * All arguments have been processed -- Op is complete,
- * prepare for next
- */
- walk_state->op_info =
- acpi_ps_get_opcode_info(op->common.aml_opcode);
- if (walk_state->op_info->flags & AML_NAMED) {
- if (acpi_gbl_depth) {
- acpi_gbl_depth--;
- }
+ /* Skip body of method */
- if (op->common.aml_opcode == AML_REGION_OP) {
+ walk_state->parser_state.aml =
+ walk_state->parser_state.pkg_end;
+ walk_state->arg_count = 0;
+ break;
+
+ case AML_BUFFER_OP:
+ case AML_PACKAGE_OP:
+ case AML_VAR_PACKAGE_OP:
+
+ if ((op->common.parent) &&
+ (op->common.parent->common.aml_opcode ==
+ AML_NAME_OP)
+ && (walk_state->pass_number <=
+ ACPI_IMODE_LOAD_PASS2)) {
/*
- * Skip parsing of control method or opregion body,
- * because we don't have enough info in the first pass
- * to parse them correctly.
- *
- * Completed parsing an op_region declaration, we now
- * know the length.
+ * Skip parsing of Buffers and Packages because we don't have
+ * enough info in the first pass to parse them correctly.
*/
- op->named.length =
- (u32) (parser_state->aml - op->named.data);
- }
- }
+ op->named.data = aml_op_start;
+ op->named.length = (u32)
+ (walk_state->parser_state.pkg_end -
+ aml_op_start);
- if (walk_state->op_info->flags & AML_CREATE) {
- /*
- * Backup to beginning of create_xXXfield declaration (1 for
- * Opcode)
- *
- * body_length is unknown until we parse the body
- */
- op->named.length =
- (u32) (parser_state->aml - op->named.data);
- }
+ /* Skip body */
- /* This op complete, notify the dispatcher */
+ walk_state->parser_state.aml =
+ walk_state->parser_state.pkg_end;
+ walk_state->arg_count = 0;
+ }
+ break;
- if (walk_state->ascending_callback != NULL) {
- walk_state->op = op;
- walk_state->opcode = op->common.aml_opcode;
+ case AML_WHILE_OP:
- status = walk_state->ascending_callback(walk_state);
- status =
- acpi_ps_next_parse_state(walk_state, op, status);
- if (status == AE_CTRL_PENDING) {
- status = AE_OK;
- goto close_this_op;
+ if (walk_state->control_state) {
+ walk_state->control_state->control.package_end =
+ walk_state->parser_state.pkg_end;
}
- }
-
- close_this_op:
- /*
- * Finished one argument of the containing scope
- */
- parser_state->scope->parse_scope.arg_count--;
+ break;
- /* Finished with pre_op */
+ default:
- if (pre_op) {
- acpi_ps_free_op(pre_op);
- pre_op = NULL;
+ /* No action for all other opcodes */
+ break;
}
- /* Close this Op (will result in parse subtree deletion) */
+ break;
+ }
- status2 = acpi_ps_complete_this_op(walk_state, op);
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
- op = NULL;
+ return_ACPI_STATUS(AE_OK);
+}
- switch (status) {
- case AE_OK:
- break;
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_complete_op
+ *
+ * PARAMETERS: walk_state - Current state
+ * Op - Returned Op
+ * Status - Parse status before complete Op
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Complete Op
+ *
+ ******************************************************************************/
- case AE_CTRL_TRANSFER:
+static acpi_status
+acpi_ps_complete_op(struct acpi_walk_state *walk_state,
+ union acpi_parse_object **op, acpi_status status)
+{
+ acpi_status status2;
- /* We are about to transfer to a called method. */
+ ACPI_FUNCTION_TRACE_PTR(ps_complete_op, walk_state);
- walk_state->prev_op = op;
- walk_state->prev_arg_types = walk_state->arg_types;
- return_ACPI_STATUS(status);
+ /*
+ * Finished one argument of the containing scope
+ */
+ walk_state->parser_state.scope->parse_scope.arg_count--;
- case AE_CTRL_END:
+ /* Close this Op (will result in parse subtree deletion) */
- acpi_ps_pop_scope(parser_state, &op,
- &walk_state->arg_types,
- &walk_state->arg_count);
+ status2 = acpi_ps_complete_this_op(walk_state, *op);
+ if (ACPI_FAILURE(status2)) {
+ return_ACPI_STATUS(status2);
+ }
- if (op) {
- walk_state->op = op;
- walk_state->op_info =
- acpi_ps_get_opcode_info(op->common.
- aml_opcode);
- walk_state->opcode = op->common.aml_opcode;
+ *op = NULL;
- status =
- walk_state->ascending_callback(walk_state);
- status =
- acpi_ps_next_parse_state(walk_state, op,
- status);
+ switch (status) {
+ case AE_OK:
+ break;
- status2 =
- acpi_ps_complete_this_op(walk_state, op);
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
- op = NULL;
- }
- status = AE_OK;
- break;
+ case AE_CTRL_TRANSFER:
- case AE_CTRL_BREAK:
- case AE_CTRL_CONTINUE:
+ /* We are about to transfer to a called method */
- /* Pop off scopes until we find the While */
+ walk_state->prev_op = NULL;
+ walk_state->prev_arg_types = walk_state->arg_types;
+ return_ACPI_STATUS(status);
- while (!op || (op->common.aml_opcode != AML_WHILE_OP)) {
- acpi_ps_pop_scope(parser_state, &op,
- &walk_state->arg_types,
- &walk_state->arg_count);
+ case AE_CTRL_END:
- if (op->common.aml_opcode != AML_WHILE_OP) {
- status2 =
- acpi_ds_result_stack_pop
- (walk_state);
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
- }
- }
-
- /* Close this iteration of the While loop */
+ acpi_ps_pop_scope(&(walk_state->parser_state), op,
+ &walk_state->arg_types,
+ &walk_state->arg_count);
- walk_state->op = op;
+ if (*op) {
+ walk_state->op = *op;
walk_state->op_info =
- acpi_ps_get_opcode_info(op->common.aml_opcode);
- walk_state->opcode = op->common.aml_opcode;
+ acpi_ps_get_opcode_info((*op)->common.aml_opcode);
+ walk_state->opcode = (*op)->common.aml_opcode;
status = walk_state->ascending_callback(walk_state);
status =
- acpi_ps_next_parse_state(walk_state, op, status);
+ acpi_ps_next_parse_state(walk_state, *op, status);
- status2 = acpi_ps_complete_this_op(walk_state, op);
+ status2 = acpi_ps_complete_this_op(walk_state, *op);
if (ACPI_FAILURE(status2)) {
return_ACPI_STATUS(status2);
}
- op = NULL;
-
- status = AE_OK;
- break;
+ }
- case AE_CTRL_TERMINATE:
+ status = AE_OK;
+ break;
- status = AE_OK;
+ case AE_CTRL_BREAK:
+ case AE_CTRL_CONTINUE:
- /* Clean up */
- do {
- if (op) {
- status2 =
- acpi_ps_complete_this_op(walk_state,
- op);
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
+ /* Pop off scopes until we find the While */
- status2 =
- acpi_ds_result_stack_pop
- (walk_state);
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
+ while (!(*op) || ((*op)->common.aml_opcode != AML_WHILE_OP)) {
+ acpi_ps_pop_scope(&(walk_state->parser_state), op,
+ &walk_state->arg_types,
+ &walk_state->arg_count);
- acpi_ut_delete_generic_state
- (acpi_ut_pop_generic_state
- (&walk_state->control_state));
+ if ((*op)->common.aml_opcode != AML_WHILE_OP) {
+ status2 = acpi_ds_result_stack_pop(walk_state);
+ if (ACPI_FAILURE(status2)) {
+ return_ACPI_STATUS(status2);
}
+ }
+ }
- acpi_ps_pop_scope(parser_state, &op,
- &walk_state->arg_types,
- &walk_state->arg_count);
+ /* Close this iteration of the While loop */
- } while (op);
+ walk_state->op = *op;
+ walk_state->op_info =
+ acpi_ps_get_opcode_info((*op)->common.aml_opcode);
+ walk_state->opcode = (*op)->common.aml_opcode;
- return_ACPI_STATUS(status);
+ status = walk_state->ascending_callback(walk_state);
+ status = acpi_ps_next_parse_state(walk_state, *op, status);
- default: /* All other non-AE_OK status */
+ status2 = acpi_ps_complete_this_op(walk_state, *op);
+ if (ACPI_FAILURE(status2)) {
+ return_ACPI_STATUS(status2);
+ }
- do {
- if (op) {
- status2 =
- acpi_ps_complete_this_op(walk_state,
- op);
- if (ACPI_FAILURE(status2)) {
- return_ACPI_STATUS(status2);
- }
+ status = AE_OK;
+ break;
+
+ case AE_CTRL_TERMINATE:
+
+ /* Clean up */
+ do {
+ if (*op) {
+ status2 =
+ acpi_ps_complete_this_op(walk_state, *op);
+ if (ACPI_FAILURE(status2)) {
+ return_ACPI_STATUS(status2);
+ }
+ status2 = acpi_ds_result_stack_pop(walk_state);
+ if (ACPI_FAILURE(status2)) {
+ return_ACPI_STATUS(status2);
}
- acpi_ps_pop_scope(parser_state, &op,
- &walk_state->arg_types,
- &walk_state->arg_count);
+ acpi_ut_delete_generic_state
+ (acpi_ut_pop_generic_state
+ (&walk_state->control_state));
+ }
- } while (op);
+ acpi_ps_pop_scope(&(walk_state->parser_state), op,
+ &walk_state->arg_types,
+ &walk_state->arg_count);
- /*
- * TBD: Cleanup parse ops on error
- */
-#if 0
- if (op == NULL) {
- acpi_ps_pop_scope(parser_state, &op,
- &walk_state->arg_types,
- &walk_state->arg_count);
+ } while (*op);
+
+ return_ACPI_STATUS(AE_OK);
+
+ default: /* All other non-AE_OK status */
+
+ do {
+ if (*op) {
+ status2 =
+ acpi_ps_complete_this_op(walk_state, *op);
+ if (ACPI_FAILURE(status2)) {
+ return_ACPI_STATUS(status2);
+ }
}
-#endif
- walk_state->prev_op = op;
- walk_state->prev_arg_types = walk_state->arg_types;
- return_ACPI_STATUS(status);
- }
- /* This scope complete? */
+ acpi_ps_pop_scope(&(walk_state->parser_state), op,
+ &walk_state->arg_types,
+ &walk_state->arg_count);
- if (acpi_ps_has_completed_scope(parser_state)) {
- acpi_ps_pop_scope(parser_state, &op,
+ } while (*op);
+
+#if 0
+ /*
+ * TBD: Cleanup parse ops on error
+ */
+ if (*op == NULL) {
+ acpi_ps_pop_scope(parser_state, op,
&walk_state->arg_types,
&walk_state->arg_count);
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
- "Popped scope, Op=%p\n", op));
- } else {
- op = NULL;
}
+#endif
+ walk_state->prev_op = NULL;
+ walk_state->prev_arg_types = walk_state->arg_types;
+ return_ACPI_STATUS(status);
+ }
- } /* while parser_state->Aml */
+ /* This scope complete? */
+
+ if (acpi_ps_has_completed_scope(&(walk_state->parser_state))) {
+ acpi_ps_pop_scope(&(walk_state->parser_state), op,
+ &walk_state->arg_types,
+ &walk_state->arg_count);
+ ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "Popped scope, Op=%p\n", *op));
+ } else {
+ *op = NULL;
+ }
+
+ return_ACPI_STATUS(AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_complete_final_op
+ *
+ * PARAMETERS: walk_state - Current state
+ * Op - Current Op
+ * Status - Current parse status before complete last
+ * Op
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Complete last Op.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
+ union acpi_parse_object *op, acpi_status status)
+{
+ acpi_status status2;
+
+ ACPI_FUNCTION_TRACE_PTR(ps_complete_final_op, walk_state);
/*
* Complete the last Op (if not completed), and clear the scope stack.
* It is easily possible to end an AML "package" with an unbounded number
* of open scopes (such as when several ASL blocks are closed with
- * sequential closing braces). We want to terminate each one cleanly.
+ * sequential closing braces). We want to terminate each one cleanly.
*/
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "AML package complete at Op %p\n",
op));
@@ -838,8 +750,12 @@ acpi_status acpi_ps_parse_loop(struct ac
acpi_ps_next_parse_state(walk_state, op,
status);
if (status == AE_CTRL_PENDING) {
- status = AE_OK;
- goto close_this_op;
+ status =
+ acpi_ps_complete_op(walk_state, &op,
+ AE_OK);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
}
if (status == AE_CTRL_TERMINATE) {
@@ -858,7 +774,9 @@ acpi_status acpi_ps_parse_loop(struct ac
}
}
- acpi_ps_pop_scope(parser_state,
+ acpi_ps_pop_scope(&
+ (walk_state->
+ parser_state),
&op,
&walk_state->
arg_types,
@@ -887,10 +805,252 @@ acpi_status acpi_ps_parse_loop(struct ac
}
}
- acpi_ps_pop_scope(parser_state, &op, &walk_state->arg_types,
+ acpi_ps_pop_scope(&(walk_state->parser_state), &op,
+ &walk_state->arg_types,
&walk_state->arg_count);
} while (op);
return_ACPI_STATUS(status);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_parse_loop
+ *
+ * PARAMETERS: walk_state - Current state
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse AML (pointed to by the current parser state) and return
+ * a tree of ops.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
+{
+ acpi_status status = AE_OK;
+ union acpi_parse_object *op = NULL; /* current op */
+ struct acpi_parse_state *parser_state;
+ u8 *aml_op_start = NULL;
+
+ ACPI_FUNCTION_TRACE_PTR(ps_parse_loop, walk_state);
+
+ if (walk_state->descending_callback == NULL) {
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
+
+ parser_state = &walk_state->parser_state;
+ walk_state->arg_types = 0;
+
+#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
+
+ if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) {
+
+ /* We are restarting a preempted control method */
+
+ if (acpi_ps_has_completed_scope(parser_state)) {
+ /*
+ * We must check if a predicate to an IF or WHILE statement
+ * was just completed
+ */
+ if ((parser_state->scope->parse_scope.op) &&
+ ((parser_state->scope->parse_scope.op->common.
+ aml_opcode == AML_IF_OP)
+ || (parser_state->scope->parse_scope.op->common.
+ aml_opcode == AML_WHILE_OP))
+ && (walk_state->control_state)
+ && (walk_state->control_state->common.state ==
+ ACPI_CONTROL_PREDICATE_EXECUTING)) {
+ /*
+ * A predicate was just completed, get the value of the
+ * predicate and branch based on that value
+ */
+ walk_state->op = NULL;
+ status =
+ acpi_ds_get_predicate_value(walk_state,
+ ACPI_TO_POINTER
+ (TRUE));
+ if (ACPI_FAILURE(status)
+ && ((status & AE_CODE_MASK) !=
+ AE_CODE_CONTROL)) {
+ if (status == AE_AML_NO_RETURN_VALUE) {
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Invoked method did not return a value"));
+
+ }
+
+ ACPI_EXCEPTION((AE_INFO, status,
+ "GetPredicate Failed"));
+ return_ACPI_STATUS(status);
+ }
+
+ status =
+ acpi_ps_next_parse_state(walk_state, op,
+ status);
+ }
+
+ acpi_ps_pop_scope(parser_state, &op,
+ &walk_state->arg_types,
+ &walk_state->arg_count);
+ ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
+ "Popped scope, Op=%p\n", op));
+ } else if (walk_state->prev_op) {
+
+ /* We were in the middle of an op */
+
+ op = walk_state->prev_op;
+ walk_state->arg_types = walk_state->prev_arg_types;
+ }
+ }
+#endif
+
+ /* Iterative parsing loop, while there is more AML to process: */
+
+ while ((parser_state->aml < parser_state->aml_end) || (op)) {
+ aml_op_start = parser_state->aml;
+ if (!op) {
+ status =
+ acpi_ps_create_op(walk_state, aml_op_start, &op);
+ if (ACPI_FAILURE(status)) {
+ if (status == AE_CTRL_PARSE_CONTINUE) {
+ continue;
+ }
+
+ if (status == AE_CTRL_PARSE_PENDING) {
+ status = AE_OK;
+ }
+
+ status =
+ acpi_ps_complete_op(walk_state, &op,
+ status);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ continue;
+ }
+
+ op->common.aml_offset = walk_state->aml_offset;
+
+ if (walk_state->op_info) {
+ ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
+ "Opcode %4.4X [%s] Op %p Aml %p AmlOffset %5.5X\n",
+ (u32) op->common.aml_opcode,
+ walk_state->op_info->name, op,
+ parser_state->aml,
+ op->common.aml_offset));
+ }
+ }
+
+ /*
+ * Start arg_count at zero because we don't know if there are
+ * any args yet
+ */
+ walk_state->arg_count = 0;
+
+ /* Are there any arguments that must be processed? */
+
+ if (walk_state->arg_types) {
+
+ /* Get arguments */
+
+ status =
+ acpi_ps_get_arguments(walk_state, aml_op_start, op);
+ if (ACPI_FAILURE(status)) {
+ status =
+ acpi_ps_complete_op(walk_state, &op,
+ status);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ continue;
+ }
+ }
+
+ /* Check for arguments that need to be processed */
+
+ if (walk_state->arg_count) {
+ /*
+ * There are arguments (complex ones), push Op and
+ * prepare for argument
+ */
+ status = acpi_ps_push_scope(parser_state, op,
+ walk_state->arg_types,
+ walk_state->arg_count);
+ if (ACPI_FAILURE(status)) {
+ status =
+ acpi_ps_complete_op(walk_state, &op,
+ status);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ continue;
+ }
+
+ op = NULL;
+ continue;
+ }
+
+ /*
+ * All arguments have been processed -- Op is complete,
+ * prepare for next
+ */
+ walk_state->op_info =
+ acpi_ps_get_opcode_info(op->common.aml_opcode);
+ if (walk_state->op_info->flags & AML_NAMED) {
+ if (acpi_gbl_depth) {
+ acpi_gbl_depth--;
+ }
+
+ if (op->common.aml_opcode == AML_REGION_OP) {
+ /*
+ * Skip parsing of control method or opregion body,
+ * because we don't have enough info in the first pass
+ * to parse them correctly.
+ *
+ * Completed parsing an op_region declaration, we now
+ * know the length.
+ */
+ op->named.length =
+ (u32) (parser_state->aml - op->named.data);
+ }
+ }
+
+ if (walk_state->op_info->flags & AML_CREATE) {
+ /*
+ * Backup to beginning of create_xXXfield declaration (1 for
+ * Opcode)
+ *
+ * body_length is unknown until we parse the body
+ */
+ op->named.length =
+ (u32) (parser_state->aml - op->named.data);
+ }
+
+ /* This op complete, notify the dispatcher */
+
+ if (walk_state->ascending_callback != NULL) {
+ walk_state->op = op;
+ walk_state->opcode = op->common.aml_opcode;
+
+ status = walk_state->ascending_callback(walk_state);
+ status =
+ acpi_ps_next_parse_state(walk_state, op, status);
+ if (status == AE_CTRL_PENDING) {
+ status = AE_OK;
+ }
+ }
+
+ status = acpi_ps_complete_op(walk_state, &op, status);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ } /* while parser_state->Aml */
+
+ status = acpi_ps_complete_final_op(walk_state, op, status);
+ return_ACPI_STATUS(status);
+}
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 797ca1e..8fa00e8 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -178,8 +178,10 @@
#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL)
#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL)
#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL)
+#define AE_CTRL_PARSE_CONTINUE (acpi_status) (0x000C | AE_CODE_CONTROL)
+#define AE_CTRL_PARSE_PENDING (acpi_status) (0x000D | AE_CODE_CONTROL)
-#define AE_CODE_CTRL_MAX 0x000B
+#define AE_CODE_CTRL_MAX 0x000D
#ifdef DEFINE_ACPI_GLOBALS
@@ -291,7 +293,9 @@ char const *acpi_gbl_exception_names_ctr
"AE_CTRL_TRANSFER",
"AE_CTRL_BREAK",
"AE_CTRL_CONTINUE",
- "AE_CTRL_SKIP"
+ "AE_CTRL_SKIP",
+ "AE_CTRL_PARSE_CONTINUE",
+ "AE_CTRL_PARSE_PENDING"
};
#endif /* ACPI GLOBALS */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 50/65] ACPICA: Eliminate control method 2-pass parse/execute.
[not found] ` <debc56bf59819095a2e54a41c2a25d6475a6e761.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Completed an AML interpreter performance enhancement for control method
execution. Previously a 2-pass parse/execution, control methods are now
completely parsed and executed in single pass. This improves overall
interpreter performance by ~25%, reduces code size, and reduces CPU stack use.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dsmethod.c | 50 +--------------
drivers/acpi/parser/psloop.c | 2 +-
drivers/acpi/parser/psxface.c | 114 ++++++++++++------------------------
3 files changed, 42 insertions(+), 124 deletions(-)
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index cf888ad..aa60dca 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -327,7 +327,7 @@ acpi_ds_call_control_method(struct acpi_
ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state);
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
- "Execute method %p, currentstate=%p\n",
+ "Calling method %p, currentstate=%p\n",
this_walk_state->prev_op, this_walk_state));
/*
@@ -351,49 +351,7 @@ acpi_ds_call_control_method(struct acpi_
return_ACPI_STATUS(status);
}
- /*
- * 1) Parse the method. All "normal" methods are parsed for each execution.
- * Internal methods (_OSI, etc.) do not require parsing.
- */
- if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
-
- /* Create a new walk state for the parse */
-
- next_walk_state =
- acpi_ds_create_walk_state(obj_desc->method.owner_id, op,
- obj_desc, NULL);
- if (!next_walk_state) {
- status = AE_NO_MEMORY;
- goto cleanup;
- }
-
- /* Create and init a parse tree root */
-
- op = acpi_ps_create_scope_op();
- if (!op) {
- status = AE_NO_MEMORY;
- goto cleanup;
- }
-
- status = acpi_ds_init_aml_walk(next_walk_state, op, method_node,
- obj_desc->method.aml_start,
- obj_desc->method.aml_length,
- NULL, 1);
- if (ACPI_FAILURE(status)) {
- acpi_ps_delete_parse_tree(op);
- goto cleanup;
- }
-
- /* Begin AML parse (deletes next_walk_state) */
-
- status = acpi_ps_parse_aml(next_walk_state);
- acpi_ps_delete_parse_tree(op);
- if (ACPI_FAILURE(status)) {
- goto cleanup;
- }
- }
-
- /* 2) Begin method execution. Create a new walk state */
+ /* Begin method parse/execution. Create a new walk state */
next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id,
NULL, obj_desc, thread);
@@ -445,8 +403,8 @@ acpi_ds_call_control_method(struct acpi_
this_walk_state->num_operands = 0;
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
- "Starting nested execution, newstate=%p\n",
- next_walk_state));
+ "**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
+ method_node->name.ascii, next_walk_state));
/* Invoke an internal method if necessary */
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index a83be52..881687c 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -226,7 +226,7 @@ acpi_ps_build_named_op(struct acpi_walk_
return_ACPI_STATUS(status);
}
- if (!op) {
+ if (!*op) {
return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
}
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c
index 5d996c1..9069c69 100644
--- a/drivers/acpi/parser/psxface.c
+++ b/drivers/acpi/parser/psxface.c
@@ -54,8 +54,6 @@ static void acpi_ps_start_trace(struct a
static void acpi_ps_stop_trace(struct acpi_evaluate_info *info);
-static acpi_status acpi_ps_execute_pass(struct acpi_evaluate_info *info);
-
static void
acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action);
@@ -215,6 +213,8 @@ static void acpi_ps_stop_trace(struct ac
acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
{
acpi_status status;
+ union acpi_parse_object *op;
+ struct acpi_walk_state *walk_state;
ACPI_FUNCTION_TRACE(ps_execute_method);
@@ -234,8 +234,7 @@ acpi_status acpi_ps_execute_method(struc
}
/*
- * The caller "owns" the parameters, so give each one an extra
- * reference
+ * The caller "owns" the parameters, so give each one an extra reference
*/
acpi_ps_update_parameter_list(info, REF_INCREMENT);
@@ -244,30 +243,50 @@ acpi_status acpi_ps_execute_method(struc
acpi_ps_start_trace(info);
/*
- * 1) Perform the first pass parse of the method to enter any
- * named objects that it creates into the namespace
+ * Execute the method. Performs parse simultaneously
*/
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
- "**** Begin Method Parse **** Entry=%p obj=%p\n",
- info->resolved_node, info->obj_desc));
+ "**** Begin Method Parse/Execute [%4.4s] **** Node=%p Obj=%p\n",
+ info->resolved_node->name.ascii, info->resolved_node,
+ info->obj_desc));
- info->pass_number = 1;
- status = acpi_ps_execute_pass(info);
- if (ACPI_FAILURE(status)) {
+ /* Create and init a Root Node */
+
+ op = acpi_ps_create_scope_op();
+ if (!op) {
+ status = AE_NO_MEMORY;
goto cleanup;
}
- /*
- * 2) Execute the method. Performs second pass parse simultaneously
- */
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
- "**** Begin Method Execution **** Entry=%p obj=%p\n",
- info->resolved_node, info->obj_desc));
+ /* Create and initialize a new walk state */
info->pass_number = 3;
- status = acpi_ps_execute_pass(info);
+ walk_state =
+ acpi_ds_create_walk_state(info->obj_desc->method.owner_id, NULL,
+ NULL, NULL);
+ if (!walk_state) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
+
+ status = acpi_ds_init_aml_walk(walk_state, op, info->resolved_node,
+ info->obj_desc->method.aml_start,
+ info->obj_desc->method.aml_length, info,
+ info->pass_number);
+ if (ACPI_FAILURE(status)) {
+ acpi_ds_delete_walk_state(walk_state);
+ goto cleanup;
+ }
+
+ /* Parse the AML */
+
+ status = acpi_ps_parse_aml(walk_state);
+
+ /* walk_state was deleted by parse_aml */
cleanup:
+ acpi_ps_delete_parse_tree(op);
+
/* End optional tracing */
acpi_ps_stop_trace(info);
@@ -330,62 +349,3 @@ acpi_ps_update_parameter_list(struct acp
}
}
}
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_ps_execute_pass
- *
- * PARAMETERS: Info - See struct acpi_evaluate_info
- * (Used: pass_number, Node, and obj_desc)
- *
- * RETURN: Status
- *
- * DESCRIPTION: Single AML pass: Parse or Execute a control method
- *
- ******************************************************************************/
-
-static acpi_status acpi_ps_execute_pass(struct acpi_evaluate_info *info)
-{
- acpi_status status;
- union acpi_parse_object *op;
- struct acpi_walk_state *walk_state;
-
- ACPI_FUNCTION_TRACE(ps_execute_pass);
-
- /* Create and init a Root Node */
-
- op = acpi_ps_create_scope_op();
- if (!op) {
- return_ACPI_STATUS(AE_NO_MEMORY);
- }
-
- /* Create and initialize a new walk state */
-
- walk_state =
- acpi_ds_create_walk_state(info->obj_desc->method.owner_id, NULL,
- NULL, NULL);
- if (!walk_state) {
- status = AE_NO_MEMORY;
- goto cleanup;
- }
-
- status = acpi_ds_init_aml_walk(walk_state, op, info->resolved_node,
- info->obj_desc->method.aml_start,
- info->obj_desc->method.aml_length,
- info->pass_number == 1 ? NULL : info,
- info->pass_number);
- if (ACPI_FAILURE(status)) {
- acpi_ds_delete_walk_state(walk_state);
- goto cleanup;
- }
-
- /* Parse the AML */
-
- status = acpi_ps_parse_aml(walk_state);
-
- /* Walk state was deleted by parse_aml */
-
- cleanup:
- acpi_ps_delete_parse_tree(op);
- return_ACPI_STATUS(status);
-}
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 51/65] ACPICA: Fix race condition with AcpiWalkNamespace.
[not found] ` <de2576c39bf22ea81e46280dee9a7543176852b1.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Fixed a problem with a possible race condition between threads executing
AcpiWalkNamespace and the AML interpreter. This condition was removed by
modifying AcpiWalkNamespace to (by default) ignore all temporary
namespace entries created during any concurrent control method execution
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dswload.c | 4 ++--
drivers/acpi/namespace/nsdump.c | 9 ++++++++-
drivers/acpi/namespace/nssearch.c | 4 ++++
drivers/acpi/namespace/nswalk.c | 13 ++++++++-----
include/acpi/aclocal.h | 2 +-
include/acpi/acnamesp.h | 10 +++++++---
6 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index 565d455..4ed0868 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -756,9 +756,9 @@ acpi_ds_load2_begin_op(struct acpi_walk_
flags = ACPI_NS_NO_UPSEARCH;
if (walk_state->pass_number == 3) {
- /* Execution mode, node cannot already exist */
+ /* Execution mode, node cannot already exist, node is temporary */
- flags |= ACPI_NS_ERROR_IF_FOUND;
+ flags |= (ACPI_NS_ERROR_IF_FOUND | ACPI_NS_TEMPORARY);
}
/* Add new entry or lookup existing entry */
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index da88834..ec5ce59 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -226,6 +226,12 @@ acpi_ns_dump_one_object(acpi_handle obj_
obj_desc = acpi_ns_get_attached_object(this_node);
acpi_dbg_level = dbg_level;
+ /* Temp nodes are those nodes created by a control method */
+
+ if (this_node->flags & ANOBJ_TEMPORARY) {
+ acpi_os_printf("(T) ");
+ }
+
switch (info->display_type & ACPI_DISPLAY_MASK) {
case ACPI_DISPLAY_SUMMARY:
@@ -623,7 +629,8 @@ acpi_ns_dump_objects(acpi_object_type ty
info.display_type = display_type;
(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
- ACPI_NS_WALK_NO_UNLOCK,
+ ACPI_NS_WALK_NO_UNLOCK |
+ ACPI_NS_WALK_TEMP_NODES,
acpi_ns_dump_one_object, (void *)&info,
NULL);
}
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c
index 566f0a4..d261c9b 100644
--- a/drivers/acpi/namespace/nssearch.c
+++ b/drivers/acpi/namespace/nssearch.c
@@ -402,6 +402,10 @@ acpi_ns_search_and_enter(u32 target_name
}
#endif
+ if (flags & ACPI_NS_TEMPORARY) {
+ new_node->flags |= ANOBJ_TEMPORARY;
+ }
+
/* Install the new object into the parent's list of children */
acpi_ns_install_node(walk_state, node, new_node, type);
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index c8f6bef..a138fcb 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -126,7 +126,7 @@ struct acpi_namespace_node *acpi_ns_get_
* PARAMETERS: Type - acpi_object_type to search for
* start_node - Handle in namespace where search begins
* max_depth - Depth to which search is to reach
- * unlock_before_callback- Whether to unlock the NS before invoking
+ * Flags - Whether to unlock the NS before invoking
* the callback routine
* user_function - Called when an object of "Type" is found
* Context - Passed to user function
@@ -153,7 +153,7 @@ acpi_status
acpi_ns_walk_namespace(acpi_object_type type,
acpi_handle start_node,
u32 max_depth,
- u8 unlock_before_callback,
+ u32 flags,
acpi_walk_callback user_function,
void *context, void **return_value)
{
@@ -201,12 +201,15 @@ acpi_ns_walk_namespace(acpi_object_type
child_type = child_node->type;
}
- if (child_type == type) {
+ if ((child_type == type) &&
+ (!(child_node->flags & ANOBJ_TEMPORARY) ||
+ (child_node->flags & ANOBJ_TEMPORARY)
+ && (flags & ACPI_NS_WALK_TEMP_NODES))) {
/*
* Found a matching node, invoke the user
* callback function
*/
- if (unlock_before_callback) {
+ if (flags & ACPI_NS_WALK_UNLOCK) {
mutex_status =
acpi_ut_release_mutex
(ACPI_MTX_NAMESPACE);
@@ -219,7 +222,7 @@ acpi_ns_walk_namespace(acpi_object_type
status = user_function(child_node, level,
context, return_value);
- if (unlock_before_callback) {
+ if (flags & ACPI_NS_WALK_UNLOCK) {
mutex_status =
acpi_ut_acquire_mutex
(ACPI_MTX_NAMESPACE);
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 553763d..287da6f 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -204,7 +204,7 @@ struct acpi_namespace_node {
/* Namespace Node flags */
#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
-#define ANOBJ_RESERVED 0x02 /* Available for future use */
+#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index b3b9f0e..19a6129 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -65,9 +65,13 @@
#define ACPI_NS_ERROR_IF_FOUND 0x08
#define ACPI_NS_PREFIX_IS_SCOPE 0x10
#define ACPI_NS_EXTERNAL 0x20
+#define ACPI_NS_TEMPORARY 0x40
-#define ACPI_NS_WALK_UNLOCK TRUE
-#define ACPI_NS_WALK_NO_UNLOCK FALSE
+/* Flags for acpi_ns_walk_namespace */
+
+#define ACPI_NS_WALK_NO_UNLOCK 0
+#define ACPI_NS_WALK_UNLOCK 0x01
+#define ACPI_NS_WALK_TEMP_NODES 0x02
/*
* nsinit - Namespace initialization
@@ -92,7 +96,7 @@ acpi_status
acpi_ns_walk_namespace(acpi_object_type type,
acpi_handle start_object,
u32 max_depth,
- u8 unlock_before_callback,
+ u32 flags,
acpi_walk_callback user_function,
void *context, void **return_value);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 52/65] ACPICA: _CID support for PCI Root Bridge detection.
[not found] ` <14b975ea77e0241f7867bca815b0eec71fb155d6.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Implemented _CID support for PCI Root Bridge detection. If the _HID
does not match the predefined root bridge IDs, the _CID list (if present)
is now obtained and also checked for an ID match
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evrgnini.c | 163 ++++++++++++++++++++++++++++++---------
1 files changed, 125 insertions(+), 38 deletions(-)
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index 790d49b..6176602 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -48,6 +48,11 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME("evrgnini")
+/* Local prototypes */
+static u8 acpi_ev_match_pci_root_bridge(char *id);
+
+static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node);
+
/*******************************************************************************
*
* FUNCTION: acpi_ev_system_memory_region_setup
@@ -62,6 +67,7 @@ ACPI_MODULE_NAME("evrgnini")
* DESCRIPTION: Setup a system_memory operation region
*
******************************************************************************/
+
acpi_status
acpi_ev_system_memory_region_setup(acpi_handle handle,
u32 function,
@@ -168,9 +174,9 @@ acpi_ev_pci_config_region_setup(acpi_han
union acpi_operand_object *handler_obj;
struct acpi_namespace_node *parent_node;
struct acpi_namespace_node *pci_root_node;
+ struct acpi_namespace_node *pci_device_node;
union acpi_operand_object *region_obj =
(union acpi_operand_object *)handle;
- struct acpi_device_id object_hID;
ACPI_FUNCTION_TRACE(ev_pci_config_region_setup);
@@ -215,45 +221,30 @@ acpi_ev_pci_config_region_setup(acpi_han
pci_root_node = parent_node;
while (pci_root_node != acpi_gbl_root_node) {
- status =
- acpi_ut_execute_HID(pci_root_node, &object_hID);
- if (ACPI_SUCCESS(status)) {
- /*
- * Got a valid _HID string, check if this is a PCI root.
- * New for ACPI 3.0: check for a PCI Express root also.
- */
- if (!
- (ACPI_STRNCMP
- (object_hID.value, PCI_ROOT_HID_STRING,
- sizeof(PCI_ROOT_HID_STRING)))
- ||
- !(ACPI_STRNCMP
- (object_hID.value,
- PCI_EXPRESS_ROOT_HID_STRING,
- sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) {
-
- /* Install a handler for this PCI root bridge */
- status =
- acpi_install_address_space_handler((acpi_handle) pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL);
- if (ACPI_FAILURE(status)) {
- if (status == AE_SAME_HANDLER) {
- /*
- * It is OK if the handler is already installed on the root
- * bridge. Still need to return a context object for the
- * new PCI_Config operation region, however.
- */
- status = AE_OK;
- } else {
- ACPI_EXCEPTION((AE_INFO,
- status,
- "Could not install PciConfig handler for Root Bridge %4.4s",
- acpi_ut_get_node_name
- (pci_root_node)));
- }
+ /* Get the _HID/_CID in order to detect a root_bridge */
+
+ if (acpi_ev_is_pci_root_bridge(pci_root_node)) {
+
+ /* Install a handler for this PCI root bridge */
+
+ status = acpi_install_address_space_handler((acpi_handle) pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL);
+ if (ACPI_FAILURE(status)) {
+ if (status == AE_SAME_HANDLER) {
+ /*
+ * It is OK if the handler is already installed on the root
+ * bridge. Still need to return a context object for the
+ * new PCI_Config operation region, however.
+ */
+ status = AE_OK;
+ } else {
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Could not install PciConfig handler for Root Bridge %4.4s",
+ acpi_ut_get_node_name
+ (pci_root_node)));
}
- break;
}
+ break;
}
pci_root_node = acpi_ns_get_parent_node(pci_root_node);
@@ -282,14 +273,25 @@ acpi_ev_pci_config_region_setup(acpi_han
/*
* For PCI_Config space access, we need the segment, bus,
* device and function numbers. Acquire them here.
+ *
+ * Find the parent device object. (This allows the operation region to be
+ * within a subscope under the device, such as a control method.)
*/
+ pci_device_node = region_obj->region.node;
+ while (pci_device_node && (pci_device_node->type != ACPI_TYPE_DEVICE)) {
+ pci_device_node = acpi_ns_get_parent_node(pci_device_node);
+ }
+
+ if (!pci_device_node) {
+ return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
+ }
/*
* Get the PCI device and function numbers from the _ADR object
* contained in the parent's scope.
*/
status =
- acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, parent_node,
+ acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node,
&pci_value);
/*
@@ -329,6 +331,91 @@ acpi_ev_pci_config_region_setup(acpi_han
/*******************************************************************************
*
+ * FUNCTION: acpi_ev_match_pci_root_bridge
+ *
+ * PARAMETERS: Id - The HID/CID in string format
+ *
+ * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
+ *
+ * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
+ *
+ ******************************************************************************/
+
+static u8 acpi_ev_match_pci_root_bridge(char *id)
+{
+
+ /*
+ * Check if this is a PCI root.
+ * ACPI 3.0+: check for a PCI Express root also.
+ */
+ if (!(ACPI_STRNCMP(id,
+ PCI_ROOT_HID_STRING,
+ sizeof(PCI_ROOT_HID_STRING))) ||
+ !(ACPI_STRNCMP(id,
+ PCI_EXPRESS_ROOT_HID_STRING,
+ sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) {
+ return (TRUE);
+ }
+
+ return (FALSE);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ev_is_pci_root_bridge
+ *
+ * PARAMETERS: Node - Device node being examined
+ *
+ * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge
+ *
+ * DESCRIPTION: Determine if the input device represents a PCI Root Bridge by
+ * examining the _HID and _CID for the device.
+ *
+ ******************************************************************************/
+
+static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
+{
+ acpi_status status;
+ struct acpi_device_id hid;
+ struct acpi_compatible_id_list *cid;
+ acpi_native_uint i;
+
+ /*
+ * Get the _HID and check for a PCI Root Bridge
+ */
+ status = acpi_ut_execute_HID(node, &hid);
+ if (ACPI_FAILURE(status)) {
+ return (FALSE);
+ }
+
+ if (acpi_ev_match_pci_root_bridge(hid.value)) {
+ return (TRUE);
+ }
+
+ /*
+ * The _HID did not match.
+ * Get the _CID and check for a PCI Root Bridge
+ */
+ status = acpi_ut_execute_CID(node, &cid);
+ if (ACPI_FAILURE(status)) {
+ return (FALSE);
+ }
+
+ /* Check all _CIDs in the returned list */
+
+ for (i = 0; i < cid->count; i++) {
+ if (acpi_ev_match_pci_root_bridge(cid->id[i].value)) {
+ ACPI_FREE(cid);
+ return (TRUE);
+ }
+ }
+
+ ACPI_FREE(cid);
+ return (FALSE);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ev_pci_bar_region_setup
*
* PARAMETERS: Handle - Region we are interested in
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 53/65] ACPICA: Use manifest constants for parse pass number
[not found] ` <471c0881b4517e4fd7ae8995146cb34bbfc7a01e.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/dispatcher/dsmethod.c | 3 ++-
drivers/acpi/dispatcher/dsopcode.c | 4 ++--
drivers/acpi/dispatcher/dswload.c | 2 +-
drivers/acpi/namespace/nsparse.c | 6 +++---
drivers/acpi/parser/psxface.c | 2 +-
include/acpi/aclocal.h | 2 +-
6 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index aa60dca..57c5159 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -382,7 +382,8 @@ acpi_ds_call_control_method(struct acpi_
status = acpi_ds_init_aml_walk(next_walk_state, NULL, method_node,
obj_desc->method.aml_start,
- obj_desc->method.aml_length, info, 3);
+ obj_desc->method.aml_length, info,
+ ACPI_IMODE_EXECUTE);
ACPI_FREE(info);
if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index 5b974a8..26035a3 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -114,7 +114,7 @@ acpi_ds_execute_arguments(struct acpi_na
}
status = acpi_ds_init_aml_walk(walk_state, op, NULL, aml_start,
- aml_length, NULL, 1);
+ aml_length, NULL, ACPI_IMODE_LOAD_PASS1);
if (ACPI_FAILURE(status)) {
acpi_ds_delete_walk_state(walk_state);
goto cleanup;
@@ -157,7 +157,7 @@ acpi_ds_execute_arguments(struct acpi_na
/* Execute the opcode and arguments */
status = acpi_ds_init_aml_walk(walk_state, op, NULL, aml_start,
- aml_length, NULL, 3);
+ aml_length, NULL, ACPI_IMODE_EXECUTE);
if (ACPI_FAILURE(status)) {
acpi_ds_delete_walk_state(walk_state);
goto cleanup;
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index 4ed0868..baf04e8 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -754,7 +754,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_
}
flags = ACPI_NS_NO_UPSEARCH;
- if (walk_state->pass_number == 3) {
+ if (walk_state->pass_number == ACPI_IMODE_EXECUTE) {
/* Execution mode, node cannot already exist, node is temporary */
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index 2e22479..a68de26 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -160,10 +160,10 @@ acpi_ns_parse_table(acpi_native_uint tab
* each Parser Op subtree is deleted when it is finished. This saves
* a great deal of memory, and allows a small cache of parse objects
* to service the entire parse. The second pass of the parse then
- * performs another complete parse of the AML..
+ * performs another complete parse of the AML.
*/
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
- status = acpi_ns_one_complete_parse(1, table_index);
+ status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -178,7 +178,7 @@ acpi_ns_parse_table(acpi_native_uint tab
* parse objects are all cached.
*/
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
- status = acpi_ns_one_complete_parse(2, table_index);
+ status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c
index 9069c69..fc5b3e5 100644
--- a/drivers/acpi/parser/psxface.c
+++ b/drivers/acpi/parser/psxface.c
@@ -260,7 +260,7 @@ acpi_status acpi_ps_execute_method(struc
/* Create and initialize a new walk state */
- info->pass_number = 3;
+ info->pass_number = ACPI_IMODE_EXECUTE;
walk_state =
acpi_ds_create_walk_state(info->obj_desc->method.owner_id, NULL,
NULL, NULL);
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 287da6f..7b28d93 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -162,7 +162,7 @@ struct acpi_mutex_info {
typedef enum {
ACPI_IMODE_LOAD_PASS1 = 0x01,
ACPI_IMODE_LOAD_PASS2 = 0x02,
- ACPI_IMODE_EXECUTE = 0x0E
+ ACPI_IMODE_EXECUTE = 0x03
} acpi_interpreter_mode;
union acpi_name_union {
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 54/65] ACPICA: Update comments
[not found] ` <088fea9ab6d74b85b9557e784f6d35db57c5acbf.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/namespace/nswalk.c | 46 +++++++++++++++++++++-----------------
1 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index a138fcb..c6619d8 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -193,21 +193,28 @@ acpi_ns_walk_namespace(acpi_object_type
acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node,
child_node);
if (child_node) {
- /*
- * Found node, Get the type if we are not
- * searching for ANY
- */
+
+ /* Found node, Get the type if we are not searching for ANY */
+
if (type != ACPI_TYPE_ANY) {
child_type = child_node->type;
}
+ /*
+ * 1) Type must match
+ * 2) Permanent namespace nodes are OK
+ * 3) Ignore temporary nodes unless told otherwise. Typically,
+ * the temporary nodes can cause a race condition where they can
+ * be deleted during the execution of the user function. Only the
+ * debugger namespace dump will examine the temporary nodes.
+ */
if ((child_type == type) &&
(!(child_node->flags & ANOBJ_TEMPORARY) ||
(child_node->flags & ANOBJ_TEMPORARY)
&& (flags & ACPI_NS_WALK_TEMP_NODES))) {
/*
- * Found a matching node, invoke the user
- * callback function
+ * Found a matching node, invoke the user callback function.
+ * Unlock the namespace if flag is set.
*/
if (flags & ACPI_NS_WALK_UNLOCK) {
mutex_status =
@@ -219,8 +226,9 @@ acpi_ns_walk_namespace(acpi_object_type
}
}
- status = user_function(child_node, level,
- context, return_value);
+ status =
+ user_function(child_node, level, context,
+ return_value);
if (flags & ACPI_NS_WALK_UNLOCK) {
mutex_status =
@@ -254,20 +262,17 @@ acpi_ns_walk_namespace(acpi_object_type
}
/*
- * Depth first search:
- * Attempt to go down another level in the namespace
- * if we are allowed to. Don't go any further if we
- * have reached the caller specified maximum depth
- * or if the user function has specified that the
- * maximum depth has been reached.
+ * Depth first search: Attempt to go down another level in the
+ * namespace if we are allowed to. Don't go any further if we have
+ * reached the caller specified maximum depth or if the user
+ * function has specified that the maximum depth has been reached.
*/
if ((level < max_depth) && (status != AE_CTRL_DEPTH)) {
if (acpi_ns_get_next_node
(ACPI_TYPE_ANY, child_node, NULL)) {
- /*
- * There is at least one child of this
- * node, visit the onde
- */
+
+ /* There is at least one child of this node, visit it */
+
level++;
parent_node = child_node;
child_node = NULL;
@@ -275,9 +280,8 @@ acpi_ns_walk_namespace(acpi_object_type
}
} else {
/*
- * No more children of this node (acpi_ns_get_next_node
- * failed), go back upwards in the namespace tree to
- * the node's parent.
+ * No more children of this node (acpi_ns_get_next_node failed), go
+ * back upwards in the namespace tree to the node's parent.
*/
level--;
child_node = parent_node;
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 55/65] ACPICA: Abort downward walk on temporary node detection.
[not found] ` <8bb9f81e2a6196b3fd4f1c72edb3ca1e5d4d0d80.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Enhancement to code that ignores temporary namespace nodes
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/namespace/nswalk.c | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index c6619d8..bccf27d 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -194,24 +194,28 @@ acpi_ns_walk_namespace(acpi_object_type
child_node);
if (child_node) {
- /* Found node, Get the type if we are not searching for ANY */
+ /* Found next child, get the type if we are not searching for ANY */
if (type != ACPI_TYPE_ANY) {
child_type = child_node->type;
}
/*
- * 1) Type must match
- * 2) Permanent namespace nodes are OK
- * 3) Ignore temporary nodes unless told otherwise. Typically,
- * the temporary nodes can cause a race condition where they can
- * be deleted during the execution of the user function. Only the
- * debugger namespace dump will examine the temporary nodes.
+ * Ignore all temporary namespace nodes (created during control
+ * method execution) unless told otherwise. These temporary nodes
+ * can cause a race condition because they can be deleted during the
+ * execution of the user function (if the namespace is unlocked before
+ * invocation of the user function.) Only the debugger namespace dump
+ * will examine the temporary nodes.
*/
- if ((child_type == type) &&
- (!(child_node->flags & ANOBJ_TEMPORARY) ||
- (child_node->flags & ANOBJ_TEMPORARY)
- && (flags & ACPI_NS_WALK_TEMP_NODES))) {
+ if ((child_node->flags & ANOBJ_TEMPORARY) &&
+ !(flags & ACPI_NS_WALK_TEMP_NODES)) {
+ status = AE_CTRL_DEPTH;
+ }
+
+ /* Type must match requested type */
+
+ else if (child_type == type) {
/*
* Found a matching node, invoke the user callback function.
* Unlock the namespace if flag is set.
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 56/65] ACPICA: Fixes for parameter validation.
[not found] ` <162f921f22ad8bc804e3c5de1b1e8e8433e35e2d.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Extra checks for valid handle/path combinations, BZ 478
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/namespace/nsxfname.c | 45 +++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c
index 978213a..408bd11 100644
--- a/drivers/acpi/namespace/nsxfname.c
+++ b/drivers/acpi/namespace/nsxfname.c
@@ -84,38 +84,41 @@ acpi_get_handle(acpi_handle parent,
/* Convert a parent handle to a prefix node */
if (parent) {
- status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE(status)) {
- return (status);
- }
-
prefix_node = acpi_ns_map_handle_to_node(parent);
if (!prefix_node) {
- (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
return (AE_BAD_PARAMETER);
}
+ }
+
+ /*
+ * Valid cases are:
+ * 1) Fully qualified pathname
+ * 2) Parent + Relative pathname
+ *
+ * Error for <null Parent + relative path>
+ */
+ if (acpi_ns_valid_root_prefix(pathname[0])) {
- status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE(status)) {
- return (status);
+ /* Pathname is fully qualified (starts with '\') */
+
+ /* Special case for root-only, since we can't search for it */
+
+ if (!ACPI_STRCMP(pathname, ACPI_NS_ROOT_PATH)) {
+ *ret_handle =
+ acpi_ns_convert_entry_to_handle(acpi_gbl_root_node);
+ return (AE_OK);
}
- }
+ } else if (!prefix_node) {
- /* Special case for root, since we can't search for it */
+ /* Relative path with null prefix is disallowed */
- if (ACPI_STRCMP(pathname, ACPI_NS_ROOT_PATH) == 0) {
- *ret_handle =
- acpi_ns_convert_entry_to_handle(acpi_gbl_root_node);
- return (AE_OK);
+ return (AE_BAD_PARAMETER);
}
- /*
- * Find the Node and convert to a handle
- */
- status = acpi_ns_get_node(prefix_node, pathname, ACPI_NS_NO_UPSEARCH,
- &node);
+ /* Find the Node and convert to a handle */
- *ret_handle = NULL;
+ status =
+ acpi_ns_get_node(prefix_node, pathname, ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_SUCCESS(status)) {
*ret_handle = acpi_ns_convert_entry_to_handle(node);
}
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 57/65] ACPICA: Update version to 20061011
[not found] ` <e6d024ae7ac51219f13184b210f86b0dbff828e3.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acconfig.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 5f1ce1f..d3b34f9 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20060927
+#define ACPI_CA_VERSION 0x20061011
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 58/65] ACPICA: Update debug output routines for data structure changes
[not found] ` <23eb8b53020362239d0127b6751fbc5156782240.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/executer/exdump.c | 27 +++++----------------------
1 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 2450943..c9cab16 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -59,8 +59,6 @@ static void acpi_ex_out_string(char *tit
static void acpi_ex_out_pointer(char *title, void *value);
-static void acpi_ex_out_address(char *title, acpi_physical_address value);
-
static void
acpi_ex_dump_object(union acpi_operand_object *obj_desc,
struct acpi_exdump_info *info);
@@ -92,10 +90,11 @@ static struct acpi_exdump_info acpi_ex_d
{ACPI_EXD_STRING, 0, NULL}
};
-static struct acpi_exdump_info acpi_ex_dump_buffer[4] = {
+static struct acpi_exdump_info acpi_ex_dump_buffer[5] = {
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(buffer.length), "Length"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.pointer), "Pointer"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.node), "Parent Node"},
{ACPI_EXD_BUFFER, 0, NULL}
};
@@ -165,8 +164,8 @@ static struct acpi_exdump_info acpi_ex_d
static struct acpi_exdump_info acpi_ex_dump_processor[7] = {
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_processor), NULL},
- {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
- {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(processor.length), "Length"},
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"},
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify),
"System Notify"},
@@ -379,18 +378,12 @@ acpi_ex_dump_object(union acpi_operand_o
break;
case ACPI_EXD_POINTER:
+ case ACPI_EXD_ADDRESS:
acpi_ex_out_pointer(name,
*ACPI_CAST_PTR(void *, target));
break;
- case ACPI_EXD_ADDRESS:
-
- acpi_ex_out_address(name,
- *ACPI_CAST_PTR
- (acpi_physical_address, target));
- break;
-
case ACPI_EXD_STRING:
acpi_ut_print_string(obj_desc->string.pointer,
@@ -834,16 +827,6 @@ static void acpi_ex_out_pointer(char *ti
acpi_os_printf("%20s : %p\n", title, value);
}
-static void acpi_ex_out_address(char *title, acpi_physical_address value)
-{
-
-#if ACPI_MACHINE_WIDTH == 16
- acpi_os_printf("%20s : %p\n", title, value);
-#else
- acpi_os_printf("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
-#endif
-}
-
/*******************************************************************************
*
* FUNCTION: acpi_ex_dump_namespace_node
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 59/65] ACPICA: Miscellaneous table manager updates and optimizations
[not found] ` <e446515cc751f48675116855f4bec723896da94d.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Robert Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/blacklist.c | 12 +++---
drivers/acpi/tables/tbinstal.c | 91 +++++++++++++++++++++++----------------
drivers/acpi/tables/tbutils.c | 46 --------------------
drivers/acpi/tables/tbxface.c | 39 ++++++++++++-----
include/acpi/acpixf.h | 2 +-
include/acpi/actables.h | 8 +---
6 files changed, 90 insertions(+), 108 deletions(-)
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index c8f4cac..f289fd4 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -103,7 +103,7 @@ int __init acpi_blacklisted(void)
{
int i = 0;
int blacklisted = 0;
- struct acpi_table_header *table_header;
+ struct acpi_table_header table_header;
while (acpi_blacklist[i].oem_id[0] != '\0') {
if (acpi_get_table_header(acpi_blacklist[i].table, 0, &table_header)) {
@@ -111,13 +111,13 @@ int __init acpi_blacklisted(void)
continue;
}
- if (strncmp(acpi_blacklist[i].oem_id, table_header->oem_id, 6)) {
+ if (strncmp(acpi_blacklist[i].oem_id, table_header.oem_id, 6)) {
i++;
continue;
}
if (strncmp
- (acpi_blacklist[i].oem_table_id, table_header->oem_table_id,
+ (acpi_blacklist[i].oem_table_id, table_header.oem_table_id,
8)) {
i++;
continue;
@@ -126,14 +126,14 @@ int __init acpi_blacklisted(void)
if ((acpi_blacklist[i].oem_revision_predicate == all_versions)
|| (acpi_blacklist[i].oem_revision_predicate ==
less_than_or_equal
- && table_header->oem_revision <=
+ && table_header.oem_revision <=
acpi_blacklist[i].oem_revision)
|| (acpi_blacklist[i].oem_revision_predicate ==
greater_than_or_equal
- && table_header->oem_revision >=
+ && table_header.oem_revision >=
acpi_blacklist[i].oem_revision)
|| (acpi_blacklist[i].oem_revision_predicate == equal
- && table_header->oem_revision ==
+ && table_header.oem_revision ==
acpi_blacklist[i].oem_revision)) {
printk(KERN_ERR PREFIX
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 9e0b3ce..b07d9c8 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -61,16 +61,19 @@ ACPI_MODULE_NAME("tbinstal")
*****************************************************************************/
acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
{
- acpi_status status;
+ acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(tb_verify_table);
/* Map the table if necessary */
if (!table_desc->pointer) {
- table_desc->pointer =
- acpi_tb_map(table_desc->address, table_desc->length,
- table_desc->flags & ACPI_TABLE_ORIGIN_MASK);
+ if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) ==
+ ACPI_TABLE_ORIGIN_MAPPED) {
+ table_desc->pointer =
+ acpi_os_map_memory(table_desc->address,
+ table_desc->length);
+ }
if (!table_desc->pointer) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
@@ -78,14 +81,15 @@ acpi_status acpi_tb_verify_table(struct
/* FACS is the odd table, has no standard ACPI header and no checksum */
- if (ACPI_COMPARE_NAME(&(table_desc->signature), ACPI_SIG_FACS)) {
- return_ACPI_STATUS(AE_OK);
- }
+ if (!ACPI_COMPARE_NAME(&table_desc->signature, ACPI_SIG_FACS)) {
- /* Always calculate checksum, ignore bad checksum if requested */
+ /* Always calculate checksum, ignore bad checksum if requested */
+
+ status =
+ acpi_tb_verify_checksum(table_desc->pointer,
+ table_desc->length);
+ }
- status =
- acpi_tb_verify_checksum(table_desc->pointer, table_desc->length);
return_ACPI_STATUS(status);
}
@@ -93,7 +97,7 @@ acpi_status acpi_tb_verify_table(struct
*
* FUNCTION: acpi_tb_add_table
*
- * PARAMETERS: Table - Pointer to the table header
+ * PARAMETERS: table_desc - Table descriptor
* table_index - Where the table index is returned
*
* RETURN: Status
@@ -103,7 +107,7 @@ acpi_status acpi_tb_verify_table(struct
******************************************************************************/
acpi_status
-acpi_tb_add_table(struct acpi_table_header *table,
+acpi_tb_add_table(struct acpi_table_desc *table_desc,
acpi_native_uint * table_index)
{
acpi_native_uint i;
@@ -112,6 +116,25 @@ acpi_tb_add_table(struct acpi_table_head
ACPI_FUNCTION_TRACE(tb_add_table);
+ if (!table_desc->pointer) {
+ status = acpi_tb_verify_table(table_desc);
+ if (ACPI_FAILURE(status) || !table_desc->pointer) {
+ return_ACPI_STATUS(status);
+ }
+ }
+
+ /* The table must be either an SSDT or a PSDT */
+
+ if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
+ &&
+ (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)))
+ {
+ ACPI_ERROR((AE_INFO,
+ "Table has invalid signature [%4.4s], must be SSDT or PSDT",
+ table_desc->pointer->signature));
+ return_ACPI_STATUS(AE_BAD_SIGNATURE);
+ }
+
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
/* Check if table is already registered */
@@ -127,18 +150,17 @@ acpi_tb_add_table(struct acpi_table_head
}
}
- length = ACPI_MIN(table->length,
- acpi_gbl_root_table_list.tables[i].pointer->
- length);
- if (ACPI_MEMCMP
- (table, acpi_gbl_root_table_list.tables[i].pointer,
- length)) {
+ length = ACPI_MIN(table_desc->length,
+ acpi_gbl_root_table_list.tables[i].length);
+ if (ACPI_MEMCMP(table_desc->pointer,
+ acpi_gbl_root_table_list.tables[i].pointer,
+ length)) {
continue;
}
/* Table is already registered */
- ACPI_FREE(table);
+ acpi_tb_delete_table(table_desc);
*table_index = i;
goto release;
}
@@ -146,14 +168,14 @@ acpi_tb_add_table(struct acpi_table_head
/*
* Add the table to the global table list
*/
- status = acpi_tb_store_table(ACPI_TO_INTEGER(table),
- table, table->length,
- ACPI_TABLE_ORIGIN_ALLOCATED, table_index);
+ status = acpi_tb_store_table(table_desc->address, table_desc->pointer,
+ table_desc->length, table_desc->flags,
+ table_index);
if (ACPI_FAILURE(status)) {
goto release;
}
- acpi_tb_print_table_header(0, table);
+ acpi_tb_print_table_header(table_desc->address, table_desc->pointer);
release:
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
@@ -282,25 +304,20 @@ acpi_tb_store_table(acpi_physical_addres
*
******************************************************************************/
-void acpi_tb_delete_table(acpi_native_uint table_index)
+void acpi_tb_delete_table(struct acpi_table_desc *table_desc)
{
- struct acpi_table_desc *table_desc;
-
- /* table_index assumed valid */
-
- table_desc = &acpi_gbl_root_table_list.tables[table_index];
-
/* Table must be mapped or allocated */
-
if (!table_desc->pointer) {
return;
}
-
- if (table_desc->flags & ACPI_TABLE_ORIGIN_MAPPED) {
- acpi_tb_unmap(table_desc->pointer, table_desc->length,
- table_desc->flags & ACPI_TABLE_ORIGIN_MASK);
- } else if (table_desc->flags & ACPI_TABLE_ORIGIN_ALLOCATED) {
+ switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) {
+ case ACPI_TABLE_ORIGIN_MAPPED:
+ acpi_os_unmap_memory(table_desc->pointer, table_desc->length);
+ break;
+ case ACPI_TABLE_ORIGIN_ALLOCATED:
ACPI_FREE(table_desc->pointer);
+ break;
+ default:;
}
table_desc->pointer = NULL;
@@ -329,7 +346,7 @@ void acpi_tb_terminate(void)
/* Delete the individual tables */
for (i = 0; i < acpi_gbl_root_table_list.count; ++i) {
- acpi_tb_delete_table(i);
+ acpi_tb_delete_table(&acpi_gbl_root_table_list.tables[i]);
}
/*
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index f97b70e..a456e6c 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -460,49 +460,3 @@ acpi_tb_parse_root_table(acpi_physical_a
return_ACPI_STATUS(AE_OK);
}
-
-/******************************************************************************
- *
- * FUNCTION: acpi_tb_map
- *
- * PARAMETERS: Address - Address to be mapped
- * Length - Length to be mapped
- * Flags - Logical or physical addressing mode
- *
- * RETURN: Pointer to mapped region
- *
- * DESCRIPTION: Maps memory according to flag
- *
- *****************************************************************************/
-
-void *acpi_tb_map(acpi_physical_address address, u32 length, u32 flags)
-{
-
- if (flags == ACPI_TABLE_ORIGIN_MAPPED) {
- return (acpi_os_map_memory(address, length));
- } else {
- return (ACPI_CAST_PTR(void, address));
- }
-}
-
-/******************************************************************************
- *
- * FUNCTION: acpi_tb_unmap
- *
- * PARAMETERS: Pointer - To mapped region
- * Length - Length to be unmapped
- * Flags - Logical or physical addressing mode
- *
- * RETURN: None
- *
- * DESCRIPTION: Unmaps memory according to flag
- *
- *****************************************************************************/
-
-void acpi_tb_unmap(void *pointer, u32 length, u32 flags)
-{
-
- if (flags == ACPI_TABLE_ORIGIN_MAPPED) {
- acpi_os_unmap_memory(pointer, length);
- }
-}
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index c5009f5..5b63c12 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -212,8 +212,7 @@ ACPI_EXPORT_SYMBOL(acpi_reallocate_root_
*
* PARAMETERS: Signature - ACPI signature of needed table
* Instance - Which instance (for SSDTs)
- * out_table_header - Where the pointer to the table header
- * is returned
+ * out_table_header - The pointer to the table header to fill
*
* RETURN: Status and pointer to mapped table header
*
@@ -226,10 +225,11 @@ ACPI_EXPORT_SYMBOL(acpi_reallocate_root_
acpi_status
acpi_get_table_header(char *signature,
acpi_native_uint instance,
- struct acpi_table_header **out_table_header)
+ struct acpi_table_header *out_table_header)
{
acpi_native_uint i;
acpi_native_uint j;
+ struct acpi_table_header *header;
/* Parameter validation */
@@ -251,16 +251,31 @@ acpi_get_table_header(char *signature,
continue;
}
- *out_table_header =
- acpi_tb_map(acpi_gbl_root_table_list.tables[i].address,
- (u32) sizeof(struct acpi_table_header),
- acpi_gbl_root_table_list.tables[i].
- flags & ACPI_TABLE_ORIGIN_MASK);
-
- if (!(*out_table_header)) {
- return (AE_NO_MEMORY);
+ if (!acpi_gbl_root_table_list.tables[i].pointer) {
+ if ((acpi_gbl_root_table_list.tables[i].
+ flags & ACPI_TABLE_ORIGIN_MASK) ==
+ ACPI_TABLE_ORIGIN_MAPPED) {
+ header =
+ acpi_os_map_memory(acpi_gbl_root_table_list.
+ tables[i].address,
+ sizeof(struct
+ acpi_table_header));
+ if (!header) {
+ return AE_NO_MEMORY;
+ }
+ ACPI_MEMCPY(out_table_header, header,
+ sizeof(struct acpi_table_header));
+ acpi_os_unmap_memory(header,
+ sizeof(struct
+ acpi_table_header));
+ } else {
+ return AE_NOT_FOUND;
+ }
+ } else {
+ ACPI_MEMCPY(out_table_header,
+ acpi_gbl_root_table_list.tables[i].pointer,
+ sizeof(struct acpi_table_header));
}
-
return (AE_OK);
}
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 035a5a8..b4190c7 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -105,7 +105,7 @@ acpi_status acpi_load_tables(void);
acpi_status
acpi_get_table_header(acpi_string signature,
acpi_native_uint instance,
- struct acpi_table_header **out_table_header);
+ struct acpi_table_header *out_table_header);
acpi_status
acpi_get_table(acpi_string signature,
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 4079f8a..5ef1b69 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -69,7 +69,7 @@ acpi_status acpi_tb_resize_root_table_li
acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc);
acpi_status
-acpi_tb_add_table(struct acpi_table_header *table,
+acpi_tb_add_table(struct acpi_table_desc *table_desc,
acpi_native_uint * table_index);
acpi_status
@@ -77,7 +77,7 @@ acpi_tb_store_table(acpi_physical_addres
struct acpi_table_header *table,
u32 length, u8 flags, acpi_native_uint * table_index);
-void acpi_tb_delete_table(acpi_native_uint table_index);
+void acpi_tb_delete_table(struct acpi_table_desc *table_desc);
void acpi_tb_terminate(void);
@@ -113,8 +113,4 @@ acpi_tb_install_table(acpi_physical_addr
acpi_status
acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
-void *acpi_tb_map(acpi_physical_address address, u32 length, u32 flags);
-
-void acpi_tb_unmap(void *pointer, u32 length, u32 flags);
-
#endif /* __ACTABLES_H__ */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 60/65] ACPICA: Fixes for load() operator.
[not found] ` <a799ea72f1f893ef9e3a46f60b6f310df8bc097c.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Len Brown
From: Robert Moore <robert.moore@intel.com>
Optimized the Load operator in the case where the source operand is an
operation region. Simply map the operation region memory, instead of
performing a bytewise read.
Signed-off-by: Robert Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/executer/exconfig.c | 159 +++++++++-----------------------------
drivers/acpi/executer/exresop.c | 10 +--
include/acpi/acopcode.h | 2 +-
include/acpi/amlcode.h | 2 +-
4 files changed, 42 insertions(+), 131 deletions(-)
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 20a5ab8..75b54ac 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -119,7 +119,7 @@ acpi_ex_add_table(acpi_native_uint table
*
* RETURN: Status
*
- * DESCRIPTION: Load an ACPI table
+ * DESCRIPTION: Load an ACPI table from the RSDT/XSDT
*
******************************************************************************/
@@ -138,21 +138,7 @@ acpi_ex_load_table_op(struct acpi_walk_s
ACPI_FUNCTION_TRACE(ex_load_table_op);
-#if 0
- /*
- * Make sure that the signature does not match one of the tables that
- * is already loaded.
- */
- status = acpi_tb_match_signature(operand[0]->string.pointer, NULL);
- if (status == AE_OK) {
-
- /* Signature matched -- don't allow override */
-
- return_ACPI_STATUS(AE_ALREADY_EXISTS);
- }
-#endif
-
- /* Find the ACPI table */
+ /* Find the ACPI table in the RSDT/XSDT */
status = acpi_tb_find_table(operand[0]->string.pointer,
operand[1]->string.pointer,
@@ -256,7 +242,7 @@ acpi_ex_load_table_op(struct acpi_walk_s
*
* FUNCTION: acpi_ex_load_op
*
- * PARAMETERS: obj_desc - Region or Field where the table will be
+ * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be
* obtained
* Target - Where a handle to the table will be stored
* walk_state - Current state
@@ -265,6 +251,12 @@ acpi_ex_load_table_op(struct acpi_walk_s
*
* DESCRIPTION: Load an ACPI table from a field or operation region
*
+ * NOTE: Region Fields (Field, bank_field, index_fields) are resolved to buffer
+ * objects before this code is reached.
+ *
+ * If source is an operation region, it must refer to system_memory, as
+ * per the ACPI specification.
+ *
******************************************************************************/
acpi_status
@@ -272,23 +264,27 @@ acpi_ex_load_op(union acpi_operand_objec
union acpi_operand_object *target,
struct acpi_walk_state *walk_state)
{
- acpi_status status;
union acpi_operand_object *ddb_handle;
- union acpi_operand_object *buffer_desc = NULL;
- struct acpi_table_header *table_ptr = NULL;
+ struct acpi_table_desc table_desc;
acpi_native_uint table_index;
- acpi_physical_address address;
- struct acpi_table_header table_header;
- acpi_integer temp;
- u32 i;
+ acpi_status status;
ACPI_FUNCTION_TRACE(ex_load_op);
- /* Object can be either an op_region or a Field */
+ ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc));
+ table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
+
+ /* Source Object can be either an op_region or a Buffer/Field */
switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
case ACPI_TYPE_REGION:
+ /* Region must be system_memory (from ACPI spec) */
+
+ if (obj_desc->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) {
+ return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
+ }
+
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Load from Region %p %s\n",
obj_desc,
acpi_ut_get_object_type_name(obj_desc)));
@@ -304,114 +300,35 @@ acpi_ex_load_op(union acpi_operand_objec
}
}
- /* Get the base physical address of the region */
-
- address = obj_desc->region.address;
-
- /* Get part of the table header to get the table length */
-
- table_header.length = 0;
- for (i = 0; i < 8; i++) {
- status =
- acpi_ev_address_space_dispatch(obj_desc, ACPI_READ,
- (acpi_physical_address)
- (i + address), 8,
- &temp);
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
-
- /* Get the one valid byte of the returned 64-bit value */
-
- ACPI_CAST_PTR(u8, &table_header)[i] = (u8) temp;
- }
-
- /* Sanity check the table length */
-
- if (table_header.length < sizeof(struct acpi_table_header)) {
- return_ACPI_STATUS(AE_BAD_HEADER);
- }
-
- /* Allocate a buffer for the entire table */
-
- table_ptr = ACPI_ALLOCATE(table_header.length);
- if (!table_ptr) {
- return_ACPI_STATUS(AE_NO_MEMORY);
- }
-
- /* Get the entire table from the op region */
-
- for (i = 0; i < table_header.length; i++) {
- status =
- acpi_ev_address_space_dispatch(obj_desc, ACPI_READ,
- (acpi_physical_address)
- (i + address), 8,
- &temp);
- if (ACPI_FAILURE(status)) {
- goto cleanup;
- }
-
- /* Get the one valid byte of the returned 64-bit value */
-
- ACPI_CAST_PTR(u8, table_ptr)[i] = (u8) temp;
- }
+ table_desc.address = obj_desc->region.address;
+ table_desc.length = obj_desc->region.length;
+ table_desc.flags = ACPI_TABLE_ORIGIN_MAPPED;
break;
- case ACPI_TYPE_LOCAL_REGION_FIELD:
- case ACPI_TYPE_LOCAL_BANK_FIELD:
- case ACPI_TYPE_LOCAL_INDEX_FIELD:
+ case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */
- ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Load from Field %p %s\n",
- obj_desc,
- acpi_ut_get_object_type_name(obj_desc)));
+ /* Simply extract the buffer from the buffer object */
- /*
- * The length of the field must be at least as large as the table.
- * Read the entire field and thus the entire table. Buffer is
- * allocated during the read.
- */
- status =
- acpi_ex_read_data_from_field(walk_state, obj_desc,
- &buffer_desc);
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
-
- table_ptr = ACPI_CAST_PTR(struct acpi_table_header,
- buffer_desc->buffer.pointer);
-
- /* All done with the buffer_desc, delete it */
-
- buffer_desc->buffer.pointer = NULL;
- acpi_ut_remove_reference(buffer_desc);
+ ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+ "Load from Buffer or Field %p %s\n", obj_desc,
+ acpi_ut_get_object_type_name(obj_desc)));
- /* Sanity check the table length */
+ table_desc.pointer = ACPI_CAST_PTR(struct acpi_table_header,
+ obj_desc->buffer.pointer);
+ table_desc.length = table_desc.pointer->length;
+ table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
- if (table_ptr->length < sizeof(struct acpi_table_header)) {
- status = AE_BAD_HEADER;
- goto cleanup;
- }
+ obj_desc->buffer.pointer = NULL;
break;
default:
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
- /* The table must be either an SSDT or a PSDT */
-
- if ((!ACPI_COMPARE_NAME(table_ptr->signature, ACPI_SIG_PSDT)) &&
- (!ACPI_COMPARE_NAME(table_ptr->signature, ACPI_SIG_SSDT))) {
- ACPI_ERROR((AE_INFO,
- "Table has invalid signature [%4.4s], must be SSDT or PSDT",
- table_ptr->signature));
- status = AE_BAD_SIGNATURE;
- goto cleanup;
- }
-
/*
* Install the new table into the local data structures
*/
- status = acpi_tb_add_table(table_ptr, &table_index);
+ status = acpi_tb_add_table(&table_desc, &table_index);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
@@ -436,13 +353,9 @@ acpi_ex_load_op(union acpi_operand_objec
return_ACPI_STATUS(status);
}
- ACPI_INFO((AE_INFO,
- "Dynamic SSDT Load - OemId [%6.6s] OemTableId [%8.8s]",
- table_ptr->oem_id, table_ptr->oem_table_id));
-
cleanup:
if (ACPI_FAILURE(status)) {
- ACPI_FREE(table_ptr);
+ acpi_tb_delete_table(&table_desc);
}
return_ACPI_STATUS(status);
}
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index 4c93d09..411d120 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -611,22 +611,20 @@ acpi_ex_resolve_operands(u16 opcode,
}
goto next_operand;
- case ARGI_REGION_OR_FIELD:
+ case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
- /* Need an operand of type REGION or a FIELD in a region */
+ /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
+ case ACPI_TYPE_BUFFER:
case ACPI_TYPE_REGION:
- case ACPI_TYPE_LOCAL_REGION_FIELD:
- case ACPI_TYPE_LOCAL_BANK_FIELD:
- case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* Valid operand */
break;
default:
ACPI_ERROR((AE_INFO,
- "Needed [Region/RegionField], found [%s] %p",
+ "Needed [Region/Buffer], found [%s] %p",
acpi_ut_get_object_type_name
(obj_desc), obj_desc));
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 7659a46..d71f5d9 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -257,7 +257,7 @@
#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
-#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF)
+#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_BUFFER,ARGI_TARGETREF)
#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
#define ARGI_LOCAL0 ARG_NONE
#define ARGI_LOCAL1 ARG_NONE
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index cf18426..fd0c722 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -273,7 +273,7 @@
#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */
#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
-#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */
+#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */
#define ARGI_DATAREFOBJ 0x16
/* Note: types above can expand to 0x1F maximum */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 61/65] ACPICA: Ensure that all structures in acobject.h are aligned, via #pragma.
[not found] ` <7898d448d7775b5433f156acc113f00d9c740720.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Thus, even if the default compiler setting is non-aligned, the header is compiled
correctly.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acobject.h | 17 +++++++++++++++--
include/acpi/actypes.h | 4 ++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 8fdee31..b81e923 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -52,7 +52,15 @@
* to the interpreter, and to keep track of the various handlers such as
* address space handlers and notify handlers. The object is a constant
* size in order to allow it to be cached and reused.
+ *
+ * Note: The object is optimized to be aligned and will not work if it is
+ * byte-packed.
*/
+#if ACPI_MACHINE_WIDTH == 64
+#pragma pack(8)
+#else
+#pragma pack(4)
+#endif
/*******************************************************************************
*
@@ -101,7 +109,8 @@ struct acpi_object_common {
ACPI_OBJECT_COMMON_HEADER};
struct acpi_object_integer {
- ACPI_OBJECT_COMMON_HEADER acpi_integer value;
+ ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */
+ acpi_integer value;
};
/*
@@ -203,7 +212,9 @@ struct acpi_object_power_resource {
};
struct acpi_object_processor {
- ACPI_OBJECT_COMMON_HEADER u8 proc_id;
+ ACPI_OBJECT_COMMON_HEADER
+ /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
+ u8 proc_id;
u8 length;
ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
};
@@ -406,4 +417,6 @@ union acpi_descriptor {
union acpi_parse_object op;
};
+#pragma pack()
+
#endif /* _ACOBJECT_H */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 6fa3f2a..d213f97 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -156,6 +156,7 @@ typedef u64 acpi_physical_address;
#define ACPI_MAX_PTR ACPI_UINT64_MAX
#define ACPI_SIZE_MAX ACPI_UINT64_MAX
+#define ACPI_NATIVE_BOUNDARY 8
#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
/*
@@ -196,6 +197,8 @@ typedef u32 acpi_physical_address;
#define ACPI_MAX_PTR ACPI_UINT32_MAX
#define ACPI_SIZE_MAX ACPI_UINT32_MAX
+#define ACPI_NATIVE_BOUNDARY 4
+
/*******************************************************************************
*
* Types specific to 16-bit targets
@@ -222,6 +225,7 @@ typedef char *acpi_physical_address;
#define ACPI_MAX_PTR ACPI_UINT16_MAX
#define ACPI_SIZE_MAX ACPI_UINT16_MAX
+#define ACPI_NATIVE_BOUNDARY 2
#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
/* 64-bit integers cannot be supported */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 62/65] ACPICA: Add ACPI_MAX macro
[not found] ` <b34f5f8dfcfcb0a7ad51089b052a1632706045e7.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acmacros.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 192fa09..9b2e4d7 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -55,6 +55,7 @@
#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
+#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
/* Size calculation */
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 63/65] ACPICA: Fail AcpiEnable if ACPI tables not loaded.
[not found] ` <fdbad6e3a27eb5b8aca9cfa765748e7b9d0d860d.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
AcpiEnable will now fail if all of the required ACPI tables are not
loaded (FADT, FACS, DSDT). BZ 477
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evxfevnt.c | 8 ++++++++
drivers/acpi/tables/tbutils.c | 23 +++++++++++++++++++++++
include/acpi/actables.h | 2 ++
3 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index a3d148e..4eab4f5 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -65,6 +65,14 @@ acpi_status acpi_enable(void)
ACPI_FUNCTION_TRACE(acpi_enable);
+ /* ACPI tables must be present */
+
+ if (!acpi_tb_tables_loaded()) {
+ return_ACPI_STATUS(AE_NO_ACPI_TABLES);
+ }
+
+ /* Check current mode */
+
if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
ACPI_DEBUG_PRINT((ACPI_DB_INIT,
"System is already in ACPI mode\n"));
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index a456e6c..d191920 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -54,6 +54,29 @@ acpi_tb_get_root_table_entry(u8 * table_
/*******************************************************************************
*
+ * FUNCTION: acpi_tb_tables_loaded
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if required ACPI tables are loaded
+ *
+ * DESCRIPTION: Determine if the minimum required ACPI tables are present
+ * (FADT, FACS, DSDT)
+ *
+ ******************************************************************************/
+
+u8 acpi_tb_tables_loaded(void)
+{
+
+ if (acpi_gbl_root_table_list.count >= 3) {
+ return (TRUE);
+ }
+
+ return (FALSE);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_tb_print_table_header
*
* PARAMETERS: Address - Table physical address
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 5ef1b69..e7efb8a 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -97,6 +97,8 @@ void acpi_tb_set_table_loaded_flag(acpi_
/*
* tbutils - table manager utilities
*/
+u8 acpi_tb_tables_loaded(void);
+
void
acpi_tb_print_table_header(acpi_physical_address address,
struct acpi_table_header *header);
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 64/65] ACPICA: Add include of actables.h
[not found] ` <e5cd826561b5b7d4397e463501539d43160888a0.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evxfevnt.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index 4eab4f5..bbd631d 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -44,6 +44,7 @@
#include <acpi/acpi.h>
#include <acpi/acevents.h>
#include <acpi/acnamesp.h>
+#include <acpi/actables.h>
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME("evxfevnt")
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* [PATCH 65/65] ACPICA: version update
[not found] ` <04ebfbb71be49b0ff2b9a87f9dc38d0949188b59.1164352294.git.len.brown@intel.com>
@ 2006-11-24 7:19 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-24 7:19 UTC (permalink / raw)
To: linux-acpi; +Cc: Robert Moore, Alexey Starikovskiy, Len Brown
From: Robert Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/acconfig.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index d3b34f9..b1238c5 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20061011
+#define ACPI_CA_VERSION 0x20061109
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
--
1.4.4.1
^ permalink raw reply related [flat|nested] 67+ messages in thread
* Re: contents of the acpica branch
2006-11-24 7:18 contents of the acpica branch Len Brown
[not found] ` <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com>
@ 2006-11-24 20:32 ` Rafael J. Wysocki
2006-11-24 22:25 ` Rafael J. Wysocki
1 sibling, 1 reply; 67+ messages in thread
From: Rafael J. Wysocki @ 2006-11-24 20:32 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi
On Friday, 24 November 2006 08:18, Len Brown wrote:
>
> The following patches are on the "acpica" branch of the ACPI git tree.
#11 seems to be missing, or is it just me who hasn't received it?
Rafael
--
You never change things by fighting the existing reality.
R. Buckminster Fuller
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: contents of the acpica branch
2006-11-24 20:32 ` contents of the acpica branch Rafael J. Wysocki
@ 2006-11-24 22:25 ` Rafael J. Wysocki
2006-11-27 2:12 ` Len Brown
0 siblings, 1 reply; 67+ messages in thread
From: Rafael J. Wysocki @ 2006-11-24 22:25 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, Robert Moore
On Friday, 24 November 2006 21:32, Rafael J. Wysocki wrote:
> On Friday, 24 November 2006 08:18, Len Brown wrote:
> >
> > The following patches are on the "acpica" branch of the ACPI git tree.
>
> #11 seems to be missing, or is it just me who hasn't received it?
I think it is missing.
Moreover, the one available at
http://kernel.org/git/?p=linux/kernel/git/lenb/linux-acpi-2.6.git;a=commitdiff;h=7b3b58eb8bcf2605a809010ad084dab9fa7f58ad
seems to suffer from a mismerge in acpi_status acpi_reallocate_root_table().
Greetings,
Rafael
--
You never change things by fighting the existing reality.
R. Buckminster Fuller
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: contents of the acpica branch
2006-11-24 22:25 ` Rafael J. Wysocki
@ 2006-11-27 2:12 ` Len Brown
0 siblings, 0 replies; 67+ messages in thread
From: Len Brown @ 2006-11-27 2:12 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-acpi, Robert Moore
On Friday 24 November 2006 17:25, Rafael J. Wysocki wrote:
> On Friday, 24 November 2006 21:32, Rafael J. Wysocki wrote:
> > On Friday, 24 November 2006 08:18, Len Brown wrote:
> > >
> > > The following patches are on the "acpica" branch of the ACPI git tree.
> >
> > #11 seems to be missing, or is it just me who hasn't received it?
>
> I think it is missing.
Yep, it got filtered by vger.kernel.org due to size.
Here's a copy:
http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/test/acpica/
0011-ACPICA-Implement-simplified-Table-Manager.txt
While we're trying hard to break up the ACPICA updates into individual patches,
with a single well contained logical change per each, in that case we
did not succeed.
> Moreover, the one available at
>
> http://kernel.org/git/?p=linux/kernel/git/lenb/linux-acpi-2.6.git;a=commitdiff;h=7b3b58eb8bcf2605a809010ad084dab9fa7f58ad
>
> seems to suffer from a mismerge in acpi_status acpi_reallocate_root_table().
I don't see a mis-merge there.
Note that the unused acpi_load_table got deleted,
and acpi_reallocate_root_table got added in that place in the file.
Diff isn't very smart about displaying this case --
or did I mis-understand what you are referring to?
note that the acpica branch will be re-checked in to fix some minor issues.
so if you pulled it and you pull it again and get conflicts, throw away the previous version.
This is the price we pay for being required to supply "clean" history to upsteam.
thanks,
-Len
^ permalink raw reply [flat|nested] 67+ messages in thread
end of thread, other threads:[~2006-11-27 2:10 UTC | newest]
Thread overview: 67+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-24 7:18 contents of the acpica branch Len Brown
[not found] ` <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 1/65] ACPICA: Update function header Len Brown
[not found] ` <b36e9a5492481728323509aa6179ce6bdab46953.1164352285.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 2/65] ACPICA: Handle mis-matched package length Len Brown
[not found] ` <34a1e7753c2bddaed096a7342ea5a138737c8033.1164352285.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 3/65] ACPICA: Handle case NumElements > Package length Len Brown
[not found] ` <e555508044e355677130b49c67aa6acf9559e014.1164352285.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 4/65] ACPICA: Delete recursive feature of ACPI Global Lock Len Brown
[not found] ` <66534596d22c36a673afc16e8842de3e5d1b99c5.1164352287.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 5/65] ACPICA: Release global lock from interrupt handler Len Brown
[not found] ` <769a0a9461f482d132e563f3dc09649e4b60989d.1164352288.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 6/65] ACPICA: Cast acpi_thread_id to UINT32 for debug output only Len Brown
[not found] ` <c243528a18ae423700c1e6d41e027b18907189eb.1164352288.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 7/65] ACPICA: fix for object premature deletion Len Brown
[not found] ` <c439b8a0815e3992b20e20f5890daf0c494f9519.1164352288.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 8/65] ACPICA: Temporary fix for BankValue parameter Len Brown
[not found] ` <e3360d67bf3a2661dc3c7b2f470a263e4bea340d.1164352288.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 9/65] ACPICA: Update version to 20060721 Len Brown
[not found] ` <13a610105f122dc0836db720d985b3e8f8be1086.1164352288.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 10/65] ACPICA: Update debug output Len Brown
[not found] ` <0faeae4ba9aef6951c161cb01955ae3d25743f16.1164352290.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 12/65] ACPICA: misc fixes for new Table Manager: Len Brown
[not found] ` <c0f2f417d70ac411c7085aa64ffc44787562e1ca.1164352291.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 13/65] ACPICA: Update comments for individual table fields Len Brown
[not found] ` <7f4682ef0ee3349060e1d9c037d6c97d111c05b0.1164352291.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 14/65] ACPICA: Fix for FADT conversion in 64-bit mode Len Brown
[not found] ` <ec604624c47740c2516cf8a4f2fa33a04956b810.1164352291.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 15/65] ACPICA: Lint changes Len Brown
[not found] ` <1164352776767-git-send-email-len.brown@intel.com>
[not found] ` <9e50272927495c4480e6476b686d1960b804c5ad.1164352293.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 17/65] ACPICA: Add support for DMAR table Len Brown
[not found] ` <37c6794383d6d3c1c816a1ebedd0bcc49510c5d8.1164352293.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 18/65] ACPICA: Add acpi_gpe_count global to track the number of GPE events Len Brown
[not found] ` <023eab64321d171542941abe76d9248d11a52778.1164352293.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 19/65] ACPICA: Disable all wake GPEs after first one recieved Len Brown
[not found] ` <fca6a1e6bd5f675d123948f9a4ca07defe24fad5.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 20/65] ACPICA: Fix unalignment in acpi_ut_repair_name Len Brown
[not found] ` <50ae4c050de1b4052c93bb7c2501877e2ae2d383.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 21/65] ACPICA: Store GPE number instead of bitmask Len Brown
[not found] ` <03a5f10642d95d738db56368dff73566bb313a54.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 22/65] ACPICA: Split acpi_format_exception into two parts Len Brown
[not found] ` <d09157670d9e199175b04cc5fc12fc6fb57a0ad2.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 23/65] ACPICA: Update version to 20060831 Len Brown
[not found] ` <d6efb2b656ab13fa3a972e9f20310e4f7be5d1f8.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 24/65] ACPICA: Cleanup of FADT verification function Len Brown
[not found] ` <e065bf0eac9680e2f57707574a0f99feca29d4f6.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 25/65] ACPICA: Create tbfadt.c to hold all FADT-related functions Len Brown
[not found] ` <1ed5347751418ace666b50cc4c48ccb6949607c8.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 26/65] ACPICA: Re-implement interpreters' "serialized mode" Len Brown
[not found] ` <dbd789f0d0b59443e5001cd3d2501e0d9ffd2ad2.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 27/65] ACPICA: Delete stale FADT functions outside tbfadt.c Len Brown
[not found] ` <f9be8a6f16cc421158078ede60ccb24c06267704.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 28/65] ACPICA: Update comments in tbfadt.c Len Brown
[not found] ` <1041493b499fda1e537b685ee65c35feba6e60d5.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 29/65] ACPICA: add ASF comment Len Brown
[not found] ` <ff81896d6f21cfd03e168b175a6bce110fb73983.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 30/65] ACPICA: re-factor table init routines for benefit of iASL Len Brown
[not found] ` <4026bee38fc195a7bec6ac14f832867dbc5ce314.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 31/65] ACPICA: Allow type ANY to be the target of the Scope operator Len Brown
[not found] ` <595830000ed536d250568af7fec2a54136a65f36.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 32/65] ACPICA: IsResourceTemplate now returns ACPI_STATUS Len Brown
[not found] ` <0441d700442eb4c9345d4f2b6700c8fda5c1288b.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 33/65] ACPICA: Add declarations for ASF! sub-tables Len Brown
[not found] ` <c2ed0e4b2171e6991fe8a0ce8e8961ccdc9527da.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 34/65] ACPICA: FADT verification is now table driven Len Brown
[not found] ` <c2b3bf4643dbb78eb201b921c55d8a842d7f4d7b.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 35/65] ACPICA: Report error if method creates 2 objects with the same name Len Brown
[not found] ` <755518e665a471847860fece68e49ef7da20ed65.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 36/65] ACPICA: New common routine for creating and verifying a local FADT Len Brown
[not found] ` <6f4be3a14fbbe2a248fbc61984bf7cbd20bd281f.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 37/65] ACPICA: Fix memory leak in table load error path Len Brown
[not found] ` <73b9e5384bfbd85f9b28ac667d1f26e6a40bae1d.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 38/65] ACPICA: Fix trace output name and whitespace Len Brown
[not found] ` <a8d7bebea250db7caed8d250706cbfe6332cf505.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 39/65] ACPICA: Update version to 20060912 Len Brown
[not found] ` <f2eec4942e2547d5dc3c45e0c6811ab941b4708b.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 40/65] ACPICA: Add full table name to disassembler output Len Brown
[not found] ` <d2b75254597975c3b34d6d2efd27029764e83e4c.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 41/65] ACPICA: Fix for Global Lock semaphore Len Brown
[not found] ` <6ccc4ddcc4790ad35ecc1b433d693cd9a356d8b1.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 42/65] ACPICA: Remove obsolete Flags parameter Len Brown
[not found] ` <d24e96ccb3551ff33821c306179ed02ad89fb041.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 43/65] ACPICA: Use faster ByIndex interface to get FACS Len Brown
[not found] ` <bbdd9137672564c57f2c4bf8a00ca1e9c0b8d455.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 44/65] ACPICA: On AML mutex force-release, set depth to zero (was 1) Len Brown
[not found] ` <fe21784a741d247ff18c34d67d56f5d374a0b5cb.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 45/65] ACPICA: Update interpreter error paths to always report the error Len Brown
[not found] ` <d9debf4714e309c46d37e11d73f3eef7bdff67ff.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 46/65] ACPICA: Fix for possible memory leak and fault Len Brown
[not found] ` <128d1711966b7242572b7b68e1522a21790a372c.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 47/65] ACPICA: Add new subsystem state bit that is set after SubsystemInitialize is called Len Brown
[not found] ` <92e90a77b802be0d2d0f3e1ace087fc5ccbaad39.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 48/65] ACPICA: Update version to 20060927 Len Brown
[not found] ` <e885033cdaa6db92d00b3ea53e69763ba45ef7df.1164352294.git.len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 49/65] ACPICA: Restructured module into multiple functions Len Brown
[not found] ` <debc56bf59819095a2e54a41c2a25d6475a6e761.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 50/65] ACPICA: Eliminate control method 2-pass parse/execute Len Brown
[not found] ` <de2576c39bf22ea81e46280dee9a7543176852b1.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 51/65] ACPICA: Fix race condition with AcpiWalkNamespace Len Brown
[not found] ` <14b975ea77e0241f7867bca815b0eec71fb155d6.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 52/65] ACPICA: _CID support for PCI Root Bridge detection Len Brown
[not found] ` <471c0881b4517e4fd7ae8995146cb34bbfc7a01e.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 53/65] ACPICA: Use manifest constants for parse pass number Len Brown
[not found] ` <088fea9ab6d74b85b9557e784f6d35db57c5acbf.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 54/65] ACPICA: Update comments Len Brown
[not found] ` <8bb9f81e2a6196b3fd4f1c72edb3ca1e5d4d0d80.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 55/65] ACPICA: Abort downward walk on temporary node detection Len Brown
[not found] ` <162f921f22ad8bc804e3c5de1b1e8e8433e35e2d.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 56/65] ACPICA: Fixes for parameter validation Len Brown
[not found] ` <e6d024ae7ac51219f13184b210f86b0dbff828e3.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 57/65] ACPICA: Update version to 20061011 Len Brown
[not found] ` <23eb8b53020362239d0127b6751fbc5156782240.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 58/65] ACPICA: Update debug output routines for data structure changes Len Brown
[not found] ` <e446515cc751f48675116855f4bec723896da94d.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 59/65] ACPICA: Miscellaneous table manager updates and optimizations Len Brown
[not found] ` <a799ea72f1f893ef9e3a46f60b6f310df8bc097c.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 60/65] ACPICA: Fixes for load() operator Len Brown
[not found] ` <7898d448d7775b5433f156acc113f00d9c740720.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 61/65] ACPICA: Ensure that all structures in acobject.h are aligned, via #pragma Len Brown
[not found] ` <b34f5f8dfcfcb0a7ad51089b052a1632706045e7.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 62/65] ACPICA: Add ACPI_MAX macro Len Brown
[not found] ` <fdbad6e3a27eb5b8aca9cfa765748e7b9d0d860d.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 63/65] ACPICA: Fail AcpiEnable if ACPI tables not loaded Len Brown
[not found] ` <e5cd826561b5b7d4397e463501539d43160888a0.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 64/65] ACPICA: Add include of actables.h Len Brown
[not found] ` <04ebfbb71be49b0ff2b9a87f9dc38d0949188b59.1164352294.git.len.brown@intel.com>
2006-11-24 7:19 ` [PATCH 65/65] ACPICA: version update Len Brown
2006-11-24 20:32 ` contents of the acpica branch Rafael J. Wysocki
2006-11-24 22:25 ` Rafael J. Wysocki
2006-11-27 2:12 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).