* [PATCH 01/27] ACPICA: Resources: New interface, AcpiWalkResourceBuffer.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
@ 2012-12-31 0:03 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 02/27] ACPICA: Change exception code for LoadTable operator Lv Zheng
` (25 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:03 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Implements a new interface for walking resource lists that it at
a lower level than the existing AcpiWalkResources. (Method is
not executed.)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/rsxface.c | 101 ++++++++++++++++++++++++++++-------------
include/acpi/acpixf.h | 5 ++
include/acpi/actypes.h | 4 ++
3 files changed, 79 insertions(+), 31 deletions(-)
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index 3a5ace7..a4086aab 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -423,7 +423,7 @@ ACPI_EXPORT_SYMBOL(acpi_resource_to_address64)
*
* RETURN: Status
*
- * DESCRIPTION: Walk a resource template for the specified evice to find a
+ * DESCRIPTION: Walk a resource template for the specified device to find a
* vendor-defined resource that matches the supplied UUID and
* UUID subtype. Returns a struct acpi_resource of type Vendor.
*
@@ -522,57 +522,42 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context)
/*******************************************************************************
*
- * FUNCTION: acpi_walk_resources
+ * FUNCTION: acpi_walk_resource_buffer
*
- * PARAMETERS: device_handle - Handle to the device object for the
- * device we are querying
- * name - Method name of the resources we want.
- * (METHOD_NAME__CRS, METHOD_NAME__PRS, or
- * METHOD_NAME__AEI)
+ * PARAMETERS: buffer - Formatted buffer returned by one of the
+ * various Get*Resource functions
* user_function - Called for each resource
* context - Passed to user_function
*
* RETURN: Status
*
- * DESCRIPTION: Retrieves the current or possible resource list for the
- * specified device. The user_function is called once for
- * each resource in the list.
+ * DESCRIPTION: Walks the input resource template. The user_function is called
+ * once for each resource in the list.
*
******************************************************************************/
+
acpi_status
-acpi_walk_resources(acpi_handle device_handle,
- char *name,
- acpi_walk_resource_callback user_function, void *context)
+acpi_walk_resource_buffer(struct acpi_buffer * buffer,
+ acpi_walk_resource_callback user_function,
+ void *context)
{
- acpi_status status;
- struct acpi_buffer buffer;
+ acpi_status status = AE_OK;
struct acpi_resource *resource;
struct acpi_resource *resource_end;
- ACPI_FUNCTION_TRACE(acpi_walk_resources);
+ ACPI_FUNCTION_TRACE(acpi_walk_resource_buffer);
/* Parameter validation */
- if (!device_handle || !user_function || !name ||
- (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) &&
- !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) &&
- !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI))) {
+ if (!buffer || !buffer->pointer || !user_function) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
- /* Get the _CRS/_PRS/_AEI resource list */
-
- buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
- status = acpi_rs_get_method_data(device_handle, name, &buffer);
- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
-
- /* Buffer now contains the resource list */
+ /* Buffer contains the resource list and length */
- resource = ACPI_CAST_PTR(struct acpi_resource, buffer.pointer);
+ resource = ACPI_CAST_PTR(struct acpi_resource, buffer->pointer);
resource_end =
- ACPI_ADD_PTR(struct acpi_resource, buffer.pointer, buffer.length);
+ ACPI_ADD_PTR(struct acpi_resource, buffer->pointer, buffer->length);
/* Walk the resource list until the end_tag is found (or buffer end) */
@@ -609,6 +594,60 @@ acpi_walk_resources(acpi_handle device_handle,
resource = ACPI_NEXT_RESOURCE(resource);
}
+ return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_walk_resource_buffer)
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_walk_resources
+ *
+ * PARAMETERS: device_handle - Handle to the device object for the
+ * device we are querying
+ * name - Method name of the resources we want.
+ * (METHOD_NAME__CRS, METHOD_NAME__PRS, or
+ * METHOD_NAME__AEI)
+ * user_function - Called for each resource
+ * context - Passed to user_function
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Retrieves the current or possible resource list for the
+ * specified device. The user_function is called once for
+ * each resource in the list.
+ *
+ ******************************************************************************/
+acpi_status
+acpi_walk_resources(acpi_handle device_handle,
+ char *name,
+ acpi_walk_resource_callback user_function, void *context)
+{
+ acpi_status status;
+ struct acpi_buffer buffer;
+
+ ACPI_FUNCTION_TRACE(acpi_walk_resources);
+
+ /* Parameter validation */
+
+ if (!device_handle || !user_function || !name ||
+ (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) &&
+ !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) &&
+ !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI))) {
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
+
+ /* Get the _CRS/_PRS/_AEI resource list */
+
+ buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+ status = acpi_rs_get_method_data(device_handle, name, &buffer);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ /* Walk the resource list and cleanup */
+
+ status = acpi_walk_resource_buffer(&buffer, user_function, context);
ACPI_FREE(buffer.pointer);
return_ACPI_STATUS(status);
}
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 3c9c783..afacb5a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -444,6 +444,11 @@ acpi_get_event_resources(acpi_handle device_handle,
struct acpi_buffer *ret_buffer);
acpi_status
+acpi_walk_resource_buffer(struct acpi_buffer *buffer,
+ acpi_walk_resource_callback user_function,
+ void *context);
+
+acpi_status
acpi_walk_resources(acpi_handle device,
char *name,
acpi_walk_resource_callback user_function, void *context);
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 6882227..3de70ed 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -881,6 +881,10 @@ struct acpi_buffer {
void *pointer; /* pointer to buffer */
};
+/* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */
+
+#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer)
+
/*
* name_type for acpi_get_name
*/
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 02/27] ACPICA: Change exception code for LoadTable operator.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
2012-12-31 0:03 ` [PATCH 01/27] ACPICA: Resources: New interface, AcpiWalkResourceBuffer Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 03/27] ACPICA: Eliminate some small unnecessary pathname functions Lv Zheng
` (24 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
For the case where one of the input strings is too long,
change the returned exception code from AE_BAD_PARAMETER to
AE_AML_STRING_LIMIT.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/exconfig.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index d0cc2a4..f214dbf 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -48,6 +48,7 @@
#include "actables.h"
#include "acdispat.h"
#include "acevents.h"
+#include "amlcode.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exconfig")
@@ -166,7 +167,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
if ((operand[0]->string.length > ACPI_NAME_SIZE) ||
(operand[1]->string.length > ACPI_OEM_ID_SIZE) ||
(operand[2]->string.length > ACPI_OEM_TABLE_ID_SIZE)) {
- return_ACPI_STATUS(AE_BAD_PARAMETER);
+ return_ACPI_STATUS(AE_AML_STRING_LIMIT);
}
/* Find the ACPI table in the RSDT/XSDT */
@@ -213,8 +214,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
/* parameter_path (optional parameter) */
if (operand[4]->string.length > 0) {
- if ((operand[4]->string.pointer[0] != '\\') &&
- (operand[4]->string.pointer[0] != '^')) {
+ if ((operand[4]->string.pointer[0] != AML_ROOT_PREFIX) &&
+ (operand[4]->string.pointer[0] != AML_PARENT_PREFIX)) {
/*
* Path is not absolute, so it will be relative to the node
* referenced by the root_path_string (or the NS root if omitted)
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 03/27] ACPICA: Eliminate some small unnecessary pathname functions.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
2012-12-31 0:03 ` [PATCH 01/27] ACPICA: Resources: New interface, AcpiWalkResourceBuffer Lv Zheng
2012-12-31 0:05 ` [PATCH 02/27] ACPICA: Change exception code for LoadTable operator Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 04/27] ACPICA: Add root node optimization to internal get namespace node function Lv Zheng
` (23 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Removed several small pathname functions to increase efficiency.
Essentially, they replace a function call with a single compare.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acmacros.h | 6 ++++
drivers/acpi/acpica/acnamesp.h | 2 --
drivers/acpi/acpica/acparser.h | 2 --
drivers/acpi/acpica/nsutils.c | 60 ++++++++--------------------------------
drivers/acpi/acpica/nsxfeval.c | 2 +-
drivers/acpi/acpica/nsxfname.c | 2 +-
drivers/acpi/acpica/psargs.c | 5 ++--
drivers/acpi/acpica/psutils.c | 8 ------
8 files changed, 22 insertions(+), 65 deletions(-)
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 3ba11d2..edfcbc8 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -311,6 +311,12 @@
#define ACPI_EXTRACT_3BIT_FLAG(field, position) (ACPI_GET_3BIT_FLAG ((field) >> position))
#define ACPI_EXTRACT_4BIT_FLAG(field, position) (ACPI_GET_4BIT_FLAG ((field) >> position))
+/* ACPI Pathname helpers */
+
+#define ACPI_IS_ROOT_PREFIX(c) ((c) == (u8) 0x5C) /* Backslash */
+#define ACPI_IS_PARENT_PREFIX(c) ((c) == (u8) 0x5E) /* Carat */
+#define ACPI_IS_PATH_SEPARATOR(c) ((c) == (u8) 0x2E) /* Period (dot) */
+
/*
* An object of type struct acpi_namespace_node can appear in some contexts
* where a pointer to an object of type union acpi_operand_object can also
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 9b19d4b..b826d9c 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -333,8 +333,6 @@ acpi_ns_install_node(struct acpi_walk_state *walk_state,
/*
* nsutils - Utility functions
*/
-u8 acpi_ns_valid_root_prefix(char prefix);
-
acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
u32 acpi_ns_local(acpi_object_type type);
diff --git a/drivers/acpi/acpica/acparser.h b/drivers/acpi/acpica/acparser.h
index eefcf47..24a5905 100644
--- a/drivers/acpi/acpica/acparser.h
+++ b/drivers/acpi/acpica/acparser.h
@@ -211,8 +211,6 @@ void acpi_ps_free_op(union acpi_parse_object *op);
u8 acpi_ps_is_leading_char(u32 c);
-u8 acpi_ps_is_prefix_char(u32 c);
-
#ifdef ACPI_FUTURE_USAGE
u32 acpi_ps_get_name(union acpi_parse_object *op);
#endif /* ACPI_FUTURE_USAGE */
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 4479654..d2dfe61 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -51,8 +51,6 @@
ACPI_MODULE_NAME("nsutils")
/* Local prototypes */
-static u8 acpi_ns_valid_path_separator(char sep);
-
#ifdef ACPI_OBSOLETE_FUNCTIONS
acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search);
#endif
@@ -98,42 +96,6 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node,
/*******************************************************************************
*
- * FUNCTION: acpi_ns_valid_root_prefix
- *
- * PARAMETERS: prefix - Character to be checked
- *
- * RETURN: TRUE if a valid prefix
- *
- * DESCRIPTION: Check if a character is a valid ACPI Root prefix
- *
- ******************************************************************************/
-
-u8 acpi_ns_valid_root_prefix(char prefix)
-{
-
- return ((u8)(prefix == '\\'));
-}
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_ns_valid_path_separator
- *
- * PARAMETERS: sep - Character to be checked
- *
- * RETURN: TRUE if a valid path separator
- *
- * DESCRIPTION: Check if a character is a valid ACPI path separator
- *
- ******************************************************************************/
-
-static u8 acpi_ns_valid_path_separator(char sep)
-{
-
- return ((u8)(sep == '.'));
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_ns_get_type
*
* PARAMETERS: node - Parent Node to be examined
@@ -217,19 +179,19 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
*
* strlen() + 1 covers the first name_seg, which has no path separator
*/
- if (acpi_ns_valid_root_prefix(*next_external_char)) {
+ if (ACPI_IS_ROOT_PREFIX(*next_external_char)) {
info->fully_qualified = TRUE;
next_external_char++;
/* Skip redundant root_prefix, like \\_SB.PCI0.SBRG.EC0 */
- while (acpi_ns_valid_root_prefix(*next_external_char)) {
+ while (ACPI_IS_ROOT_PREFIX(*next_external_char)) {
next_external_char++;
}
} else {
/* Handle Carat prefixes */
- while (*next_external_char == '^') {
+ while (ACPI_IS_PARENT_PREFIX(*next_external_char)) {
info->num_carats++;
next_external_char++;
}
@@ -243,7 +205,7 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
if (*next_external_char) {
info->num_segments = 1;
for (i = 0; next_external_char[i]; i++) {
- if (acpi_ns_valid_path_separator(next_external_char[i])) {
+ if (ACPI_IS_PATH_SEPARATOR(next_external_char[i])) {
info->num_segments++;
}
}
@@ -281,7 +243,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
/* Setup the correct prefixes, counts, and pointers */
if (info->fully_qualified) {
- internal_name[0] = '\\';
+ internal_name[0] = AML_ROOT_PREFIX;
if (num_segments <= 1) {
result = &internal_name[1];
@@ -301,7 +263,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
i = 0;
if (info->num_carats) {
for (i = 0; i < info->num_carats; i++) {
- internal_name[i] = '^';
+ internal_name[i] = AML_PARENT_PREFIX;
}
}
@@ -321,7 +283,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
for (; num_segments; num_segments--) {
for (i = 0; i < ACPI_NAME_SIZE; i++) {
- if (acpi_ns_valid_path_separator(*external_name) ||
+ if (ACPI_IS_PATH_SEPARATOR(*external_name) ||
(*external_name == 0)) {
/* Pad the segment with underscore(s) if segment is short */
@@ -338,7 +300,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
/* Now we must have a path separator, or the pathname is bad */
- if (!acpi_ns_valid_path_separator(*external_name) &&
+ if (!ACPI_IS_PATH_SEPARATOR(*external_name) &&
(*external_name != 0)) {
return_ACPI_STATUS(AE_BAD_PATHNAME);
}
@@ -456,13 +418,13 @@ acpi_ns_externalize_name(u32 internal_name_length,
/* Check for a prefix (one '\' | one or more '^') */
switch (internal_name[0]) {
- case '\\':
+ case AML_ROOT_PREFIX:
prefix_length = 1;
break;
- case '^':
+ case AML_PARENT_PREFIX:
for (i = 0; i < internal_name_length; i++) {
- if (internal_name[i] == '^') {
+ if (ACPI_IS_PARENT_PREFIX(internal_name[i])) {
prefix_length = i + 1;
} else {
break;
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index ef29925..1070eee 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -236,7 +236,7 @@ acpi_evaluate_object(acpi_handle handle,
* 2) No handle, not fully qualified pathname (error)
* 3) Valid handle
*/
- if ((pathname) && (acpi_ns_valid_root_prefix(pathname[0]))) {
+ if ((pathname) && (ACPI_IS_ROOT_PREFIX(pathname[0]))) {
/* The path is fully qualified, just evaluate by name */
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index a8deae8..1664fad 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -107,7 +107,7 @@ acpi_get_handle(acpi_handle parent,
*
* Error for <null Parent + relative path>
*/
- if (acpi_ns_valid_root_prefix(pathname[0])) {
+ if (ACPI_IS_ROOT_PREFIX(pathname[0])) {
/* Pathname is fully qualified (starts with '\') */
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index cb79e2d..9f31893 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -162,7 +162,7 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)
/* Point past any namestring prefix characters (backslash or carat) */
- while (acpi_ps_is_prefix_char(*end)) {
+ while (ACPI_IS_ROOT_PREFIX(*end) || ACPI_IS_PARENT_PREFIX(*end)) {
end++;
}
@@ -798,7 +798,8 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
subop = acpi_ps_peek_opcode(parser_state);
if (subop == 0 ||
acpi_ps_is_leading_char(subop) ||
- acpi_ps_is_prefix_char(subop)) {
+ ACPI_IS_ROOT_PREFIX(subop) ||
+ ACPI_IS_PARENT_PREFIX(subop)) {
/* null_name or name_string */
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index afefb3a1..2bbf670 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -202,14 +202,6 @@ u8 acpi_ps_is_leading_char(u32 c)
}
/*
- * Is "c" a namestring prefix character?
- */
-u8 acpi_ps_is_prefix_char(u32 c)
-{
- return ((u8)(c == '\\' || c == '^'));
-}
-
-/*
* Get op's name (4-byte name segment) or 0 if unnamed
*/
#ifdef ACPI_FUTURE_USAGE
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 04/27] ACPICA: Add root node optimization to internal get namespace node function.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (2 preceding siblings ...)
2012-12-31 0:05 ` [PATCH 03/27] ACPICA: Eliminate some small unnecessary pathname functions Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 05/27] ACPICA: Lint changes, no functional change Lv Zheng
` (22 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Detect a request for the root node (a lone backslash) up front
before invoking a full namespace lookup.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/nsutils.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index d2dfe61..596d4cc 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -671,6 +671,8 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
ACPI_FUNCTION_TRACE_PTR(ns_get_node, ACPI_CAST_PTR(char, pathname));
+ /* Simplest case is a null pathname */
+
if (!pathname) {
*return_node = prefix_node;
if (!prefix_node) {
@@ -679,6 +681,13 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
return_ACPI_STATUS(AE_OK);
}
+ /* Quick check for a reference to the root */
+
+ if (ACPI_IS_ROOT_PREFIX(pathname[0]) && (!pathname[1])) {
+ *return_node = acpi_gbl_root_node;
+ return_ACPI_STATUS(AE_OK);
+ }
+
/* Convert path to internal representation */
status = acpi_ns_internalize_name(pathname, &internal_path);
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 05/27] ACPICA: Lint changes, no functional change.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (3 preceding siblings ...)
2012-12-31 0:05 ` [PATCH 04/27] ACPICA: Add root node optimization to internal get namespace node function Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 06/27] ACPICA: Add time macros for various timer/time manipulation Lv Zheng
` (21 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Some changes from lint.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/psloop.c | 9 +++++----
drivers/acpi/acpica/utdelete.c | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index 5607805..a6f8592 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -142,7 +142,8 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
(u32)(walk_state->aml_offset +
sizeof(struct acpi_table_header))));
- ACPI_DUMP_BUFFER(walk_state->parser_state.aml - 16, 48);
+ ACPI_DUMP_BUFFER((walk_state->parser_state.aml - 16),
+ 48);
#ifdef ACPI_ASL_COMPILER
/*
@@ -159,9 +160,9 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
acpi_ut_dump_buffer(((u8 *)walk_state->parser_state.
aml - 16), 48, DB_BYTE_DISPLAY,
- walk_state->aml_offset +
- sizeof(struct acpi_table_header) -
- 16);
+ (walk_state->aml_offset +
+ sizeof(struct acpi_table_header) -
+ 16));
acpi_os_printf(" */\n");
#endif
}
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 53e6af8..c8bf44f 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
{
union acpi_operand_object **internal_obj;
- ACPI_FUNCTION_NAME(ut_delete_internal_object_list);
+ ACPI_FUNCTION_ENTRY();
/* Walk the null-terminated internal list */
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 06/27] ACPICA: Add time macros for various timer/time manipulation.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (4 preceding siblings ...)
2012-12-31 0:05 ` [PATCH 05/27] ACPICA: Lint changes, no functional change Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 07/27] ACPICA: Add header file support for the ACPI 5 TPM2 ACPI table Lv Zheng
` (20 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Constants for time manipulation, including constants for the 100
nanosecond timers. Chao Guan, Bob Moore, Lv Zheng.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/hwsleep.c | 2 +-
drivers/acpi/acpica/hwtimer.c | 7 ++++---
drivers/acpi/acpica/hwxfsleep.c | 2 +-
include/acpi/actypes.h | 17 ++++++++++++++++-
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 691a5fb..675a8f8 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -177,7 +177,7 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
* to still read the right value. Ideally, this block would go
* away entirely.
*/
- acpi_os_stall(10000000);
+ acpi_os_stall(10 * ACPI_USEC_PER_SEC);
status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL,
sleep_enable_reg_info->
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index bfdce22..4e741d8 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -176,10 +176,11 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
/*
* Compute Duration (Requires a 64-bit multiply and divide):
*
- * time_elapsed = (delta_ticks * 1000000) / PM_TIMER_FREQUENCY;
+ * time_elapsed (microseconds) =
+ * (delta_ticks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY;
*/
- status = acpi_ut_short_divide(((u64) delta_ticks) * 1000000,
- PM_TIMER_FREQUENCY, "ient, NULL);
+ status = acpi_ut_short_divide(((u64)delta_ticks) * ACPI_USEC_PER_SEC,
+ ACPI_PM_TIMER_FREQUENCY, "ient, NULL);
*time_elapsed = (u32) quotient;
return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 6fcee00..ca4df0f 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -207,7 +207,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
(u32)acpi_gbl_FADT.s4_bios_request, 8);
do {
- acpi_os_stall(1000);
+ acpi_os_stall(ACPI_USEC_PER_MSEC);
status =
acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, &in_value);
if (ACPI_FAILURE(status)) {
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 3de70ed..796a63e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -341,7 +341,7 @@ typedef u32 acpi_physical_address;
/* PM Timer ticks per second (HZ) */
-#define PM_TIMER_FREQUENCY 3579545
+#define ACPI_PM_TIMER_FREQUENCY 3579545
/*******************************************************************************
*
@@ -373,6 +373,21 @@ typedef u32 acpi_name; /* 4-byte ACPI name */
typedef char *acpi_string; /* Null terminated ASCII string */
typedef void *acpi_handle; /* Actually a ptr to a NS Node */
+/* Time constants for timer calculations */
+
+#define ACPI_MSEC_PER_SEC 1000L
+
+#define ACPI_USEC_PER_MSEC 1000L
+#define ACPI_USEC_PER_SEC 1000000L
+
+#define ACPI_100NSEC_PER_USEC 10L
+#define ACPI_100NSEC_PER_MSEC 10000L
+#define ACPI_100NSEC_PER_SEC 10000000L
+
+#define ACPI_NSEC_PER_USEC 1000L
+#define ACPI_NSEC_PER_MSEC 1000000L
+#define ACPI_NSEC_PER_SEC 1000000000L
+
/* Owner IDs are used to track namespace nodes for selective deletion */
typedef u8 acpi_owner_id;
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 07/27] ACPICA: Add header file support for the ACPI 5 TPM2 ACPI table.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (5 preceding siblings ...)
2012-12-31 0:05 ` [PATCH 06/27] ACPICA: Add time macros for various timer/time manipulation Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:05 ` [PATCH 08/27] ACPICA: Resource Manager: Add a pointer cast for a namespace node Lv Zheng
` (19 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Reserved in ACPI 5.0 specification, but defined in a November
2011 Microsoft document.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/actbl3.h | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index 6585141..a067d7d 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -68,6 +68,7 @@
#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
#define ACPI_SIG_RASF "RASF" /* RAS Feature table */
+#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */
#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
@@ -550,6 +551,36 @@ enum acpi_rasf_status {
#define ACPI_RASF_ERROR (1<<2)
#define ACPI_RASF_STATUS (0x1F<<3)
+/*******************************************************************************
+ *
+ * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
+ * Version 3
+ *
+ * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
+ *
+ ******************************************************************************/
+
+struct acpi_table_tpm2 {
+ struct acpi_table_header header; /* Common ACPI table header */
+ u32 flags;
+ u64 control_address;
+ u32 start_method;
+};
+
+/* Control area structure (not part of table, pointed to by control_address) */
+
+struct acpi_tpm2_control {
+ u32 reserved;
+ u32 error;
+ u32 cancel;
+ u32 start;
+ u64 interrupt_control;
+ u32 command_size;
+ u64 command_address;
+ u32 response_size;
+ u64 response_address;
+};
+
/* Reset to default packing */
#pragma pack()
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 08/27] ACPICA: Resource Manager: Add a pointer cast for a namespace node.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (6 preceding siblings ...)
2012-12-31 0:05 ` [PATCH 07/27] ACPICA: Add header file support for the ACPI 5 TPM2 ACPI table Lv Zheng
@ 2012-12-31 0:05 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve performance Lv Zheng
` (18 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:05 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki
Cc: linux-acpi, Rafael J. Wysocki, Bob Moore, Lv Zheng
From: "Rafael J. Wysocki" <rjw@sisk.pl>
Add a missing cast for a namespace node pointer passed in from
an external interface. Reported Rafael Wysocki.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/rsutils.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 5adae5a..41b8103 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -677,7 +677,9 @@ acpi_rs_get_method_data(acpi_handle handle,
/* Execute the method, no parameters */
status =
- acpi_ut_evaluate_object(handle, path, ACPI_BTYPE_BUFFER, &obj_desc);
+ acpi_ut_evaluate_object(ACPI_CAST_PTR
+ (struct acpi_namespace_node, handle), path,
+ ACPI_BTYPE_BUFFER, &obj_desc);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve performance.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (7 preceding siblings ...)
2012-12-31 0:05 ` [PATCH 08/27] ACPICA: Resource Manager: Add a pointer cast for a namespace node Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2013-01-04 23:51 ` Rafael J. Wysocki
2012-12-31 0:06 ` [PATCH 10/27] ACPICA: FUNCTION_TRACE macros: Check if debug is enabled up-front Lv Zheng
` (17 subsequent siblings)
26 siblings, 1 reply; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Move check for "debug enable" to before the actual call to the
debug print routine. Improves time of ASLTS by about 15%. Also,
remove "safe" exit macros since no complex expressions are ever
used in the return statements.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acmacros.h | 132 ++++++++++++++++++++--------------------
include/acpi/acoutput.h | 32 +++++++++-
2 files changed, 96 insertions(+), 68 deletions(-)
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index edfcbc8..cd96135 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -392,29 +392,51 @@
* Debug macros that are conditionally compiled
*/
#ifdef ACPI_DEBUG_OUTPUT
+
/*
* Function entry tracing
+ *
+ * The name of the function is emitted as a local variable that is
+ * intended to be used by both the entry trace and the exit trace.
*/
-#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
-#define ACPI_FUNCTION_TRACE_PTR(a, b) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS, (void *)b)
-#define ACPI_FUNCTION_TRACE_U32(a, b) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS, (u32)b)
-#define ACPI_FUNCTION_TRACE_STR(a, b) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS, (char *)b)
-#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
+/* Helper macro */
+
+#define ACPI_TRACE_ENTRY(name, function, cast, param) \
+ ACPI_FUNCTION_NAME (name) \
+ function (ACPI_DEBUG_PARAMETERS, cast (param))
+
+/* The actual entry trace macros */
+
+#define ACPI_FUNCTION_TRACE(name) \
+ ACPI_FUNCTION_NAME(name) \
+ acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
+
+#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
+ ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
+
+#define ACPI_FUNCTION_TRACE_U32(name, value) \
+ ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
+
+#define ACPI_FUNCTION_TRACE_STR(name, string) \
+ ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
+
+#define ACPI_FUNCTION_ENTRY() \
+ acpi_ut_track_stack_ptr()
/*
- * Function exit tracing.
- * WARNING: These macros include a return statement. This is usually considered
- * bad form, but having a separate exit macro is very ugly and difficult to maintain.
- * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
- * so that "_AcpiFunctionName" is defined.
+ * Function exit tracing
+ *
+ * These macros include a return statement. This is usually considered
+ * bad form, but having a separate exit macro before the actual return
+ * is very ugly and difficult to maintain.
+ *
+ * One of the FUNCTION_TRACE macros above must be used in conjunction
+ * with these macros so that "_AcpiFunctionName" is defined.
*
- * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
- * about these constructs.
+ * Note: the DO_WHILE0 macro is used to prevent some compilers from
+ * complaining about these constructs. On other compilers the do...while
+ * adds some extra code, so this feature is optional.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
@@ -422,55 +444,35 @@
#define ACPI_DO_WHILE0(a) a
#endif
-#define return_VOID ACPI_DO_WHILE0 ({ \
- acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
- return;})
-/*
- * There are two versions of most of the return macros. The default version is
- * safer, since it avoids side-effects by guaranteeing that the argument will
- * not be evaluated twice.
- *
- * A less-safe version of the macros is provided for optional use if the
- * compiler uses excessive CPU stack (for example, this may happen in the
- * debug case if code optimzation is disabled.)
- */
-#ifndef ACPI_SIMPLE_RETURN_MACROS
-
-#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
- register acpi_status _s = (s); \
- acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \
- return (_s); })
-#define return_PTR(s) ACPI_DO_WHILE0 ({ \
- register void *_s = (void *) (s); \
- acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \
- return (_s); })
-#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
- register u64 _s = (s); \
- acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \
- return (_s); })
-#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
- register u8 _s = (u8) (s); \
- acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (u64) _s); \
- return (_s); })
-#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
- register u32 _s = (u32) (s); \
- acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (u64) _s); \
- return (_s); })
-#else /* Use original less-safe macros */
-
-#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
- acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \
- return((s)); })
-#define return_PTR(s) ACPI_DO_WHILE0 ({ \
- acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \
- return((s)); })
-#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
- acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (u64) (s)); \
- return((s)); })
-#define return_UINT8(s) return_VALUE(s)
-#define return_UINT32(s) return_VALUE(s)
-
-#endif /* ACPI_SIMPLE_RETURN_MACROS */
+/* Exit trace helper macro */
+
+#define ACPI_TRACE_EXIT(function, cast, param) \
+ ACPI_DO_WHILE0 ({ \
+ function (ACPI_DEBUG_PARAMETERS, cast (param)); \
+ return ((param)); \
+ })
+
+/* The actual exit macros */
+
+#define return_VOID \
+ ACPI_DO_WHILE0 ({ \
+ acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
+ return; \
+ })
+
+#define return_ACPI_STATUS(status) \
+ ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
+
+#define return_PTR(pointer) \
+ ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
+
+#define return_VALUE(value) \
+ ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
+
+/* These exit macros are superfluous and should be removed entirely */
+
+#define return_UINT8 return_VALUE
+#define return_UINT32 return_VALUE
/* Conditional execution */
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 38e1be0..be014bf 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -263,16 +263,42 @@
* Common parameters used for debug output functions:
* line number, function name, module(file) name, component ID
*/
-#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
+#define ACPI_DEBUG_PARAMETERS \
+ __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
/*
* Master debug print macros
* Print message if and only if:
* 1) Debug print for the current component is enabled
* 2) Debug error level or trace level for the print statement is enabled
+ *
+ * November 2012: Moved the runtime check for whether to actually emit the
+ * debug message outside of the print function itself. This improves overall
+ * performance at a relatively small code cost. Implementation involves the
+ * use of variadic macros supported by C99.
*/
-#define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist
-#define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist
+
+/* DEBUG_PRINT functions */
+
+#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
+#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
+
+/* Helper macros for DEBUG_PRINT */
+
+#define ACPI_IS_DEBUG_ENABLED(level, component) \
+ (level & acpi_dbg_level) && (component & acpi_dbg_layer)
+
+#define ACPI_DEBUG(function, level, line, filename, modulename, component, ...) \
+ if (ACPI_IS_DEBUG_ENABLED (level, component)) \
+ { \
+ function (level, line, filename, modulename, component, __VA_ARGS__); \
+ }
+
+#define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \
+ ACPI_DEBUG (acpi_debug_print, level, line, filename, modulename, component, __VA_ARGS__)
+
+#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
+ ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__)
#else
/*
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve performance.
2012-12-31 0:06 ` [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve performance Lv Zheng
@ 2013-01-04 23:51 ` Rafael J. Wysocki
2013-01-05 0:59 ` Zheng, Lv
0 siblings, 1 reply; 33+ messages in thread
From: Rafael J. Wysocki @ 2013-01-04 23:51 UTC (permalink / raw)
To: Lv Zheng; +Cc: Len Brown, linux-acpi, Bob Moore
On Monday, December 31, 2012 08:06:04 AM Lv Zheng wrote:
> From: Bob Moore <robert.moore@intel.com>
>
> Move check for "debug enable" to before the actual call to the
> debug print routine. Improves time of ASLTS by about 15%. Also,
> remove "safe" exit macros since no complex expressions are ever
> used in the return statements.
Can you please fix the build breakage introduced by this patch in
processor_driver.c?
Rafael
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> ---
> drivers/acpi/acpica/acmacros.h | 132 ++++++++++++++++++++--------------------
> include/acpi/acoutput.h | 32 +++++++++-
> 2 files changed, 96 insertions(+), 68 deletions(-)
>
> diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
> index edfcbc8..cd96135 100644
> --- a/drivers/acpi/acpica/acmacros.h
> +++ b/drivers/acpi/acpica/acmacros.h
> @@ -392,29 +392,51 @@
> * Debug macros that are conditionally compiled
> */
> #ifdef ACPI_DEBUG_OUTPUT
> +
> /*
> * Function entry tracing
> + *
> + * The name of the function is emitted as a local variable that is
> + * intended to be used by both the entry trace and the exit trace.
> */
> -#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
> - acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
> -#define ACPI_FUNCTION_TRACE_PTR(a, b) ACPI_FUNCTION_NAME(a) \
> - acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS, (void *)b)
> -#define ACPI_FUNCTION_TRACE_U32(a, b) ACPI_FUNCTION_NAME(a) \
> - acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS, (u32)b)
> -#define ACPI_FUNCTION_TRACE_STR(a, b) ACPI_FUNCTION_NAME(a) \
> - acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS, (char *)b)
>
> -#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
> +/* Helper macro */
> +
> +#define ACPI_TRACE_ENTRY(name, function, cast, param) \
> + ACPI_FUNCTION_NAME (name) \
> + function (ACPI_DEBUG_PARAMETERS, cast (param))
> +
> +/* The actual entry trace macros */
> +
> +#define ACPI_FUNCTION_TRACE(name) \
> + ACPI_FUNCTION_NAME(name) \
> + acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
> +
> +#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
> + ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
> +
> +#define ACPI_FUNCTION_TRACE_U32(name, value) \
> + ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
> +
> +#define ACPI_FUNCTION_TRACE_STR(name, string) \
> + ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
> +
> +#define ACPI_FUNCTION_ENTRY() \
> + acpi_ut_track_stack_ptr()
>
> /*
> - * Function exit tracing.
> - * WARNING: These macros include a return statement. This is usually considered
> - * bad form, but having a separate exit macro is very ugly and difficult to maintain.
> - * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
> - * so that "_AcpiFunctionName" is defined.
> + * Function exit tracing
> + *
> + * These macros include a return statement. This is usually considered
> + * bad form, but having a separate exit macro before the actual return
> + * is very ugly and difficult to maintain.
> + *
> + * One of the FUNCTION_TRACE macros above must be used in conjunction
> + * with these macros so that "_AcpiFunctionName" is defined.
> *
> - * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
> - * about these constructs.
> + * Note: the DO_WHILE0 macro is used to prevent some compilers from
> + * complaining about these constructs. On other compilers the do...while
> + * adds some extra code, so this feature is optional.
> */
> #ifdef ACPI_USE_DO_WHILE_0
> #define ACPI_DO_WHILE0(a) do a while(0)
> @@ -422,55 +444,35 @@
> #define ACPI_DO_WHILE0(a) a
> #endif
>
> -#define return_VOID ACPI_DO_WHILE0 ({ \
> - acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
> - return;})
> -/*
> - * There are two versions of most of the return macros. The default version is
> - * safer, since it avoids side-effects by guaranteeing that the argument will
> - * not be evaluated twice.
> - *
> - * A less-safe version of the macros is provided for optional use if the
> - * compiler uses excessive CPU stack (for example, this may happen in the
> - * debug case if code optimzation is disabled.)
> - */
> -#ifndef ACPI_SIMPLE_RETURN_MACROS
> -
> -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
> - register acpi_status _s = (s); \
> - acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \
> - return (_s); })
> -#define return_PTR(s) ACPI_DO_WHILE0 ({ \
> - register void *_s = (void *) (s); \
> - acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \
> - return (_s); })
> -#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
> - register u64 _s = (s); \
> - acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \
> - return (_s); })
> -#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
> - register u8 _s = (u8) (s); \
> - acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (u64) _s); \
> - return (_s); })
> -#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
> - register u32 _s = (u32) (s); \
> - acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (u64) _s); \
> - return (_s); })
> -#else /* Use original less-safe macros */
> -
> -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
> - acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \
> - return((s)); })
> -#define return_PTR(s) ACPI_DO_WHILE0 ({ \
> - acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \
> - return((s)); })
> -#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
> - acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (u64) (s)); \
> - return((s)); })
> -#define return_UINT8(s) return_VALUE(s)
> -#define return_UINT32(s) return_VALUE(s)
> -
> -#endif /* ACPI_SIMPLE_RETURN_MACROS */
> +/* Exit trace helper macro */
> +
> +#define ACPI_TRACE_EXIT(function, cast, param) \
> + ACPI_DO_WHILE0 ({ \
> + function (ACPI_DEBUG_PARAMETERS, cast (param)); \
> + return ((param)); \
> + })
> +
> +/* The actual exit macros */
> +
> +#define return_VOID \
> + ACPI_DO_WHILE0 ({ \
> + acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
> + return; \
> + })
> +
> +#define return_ACPI_STATUS(status) \
> + ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
> +
> +#define return_PTR(pointer) \
> + ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
> +
> +#define return_VALUE(value) \
> + ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
> +
> +/* These exit macros are superfluous and should be removed entirely */
> +
> +#define return_UINT8 return_VALUE
> +#define return_UINT32 return_VALUE
>
> /* Conditional execution */
>
> diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
> index 38e1be0..be014bf 100644
> --- a/include/acpi/acoutput.h
> +++ b/include/acpi/acoutput.h
> @@ -263,16 +263,42 @@
> * Common parameters used for debug output functions:
> * line number, function name, module(file) name, component ID
> */
> -#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
> +#define ACPI_DEBUG_PARAMETERS \
> + __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
>
> /*
> * Master debug print macros
> * Print message if and only if:
> * 1) Debug print for the current component is enabled
> * 2) Debug error level or trace level for the print statement is enabled
> + *
> + * November 2012: Moved the runtime check for whether to actually emit the
> + * debug message outside of the print function itself. This improves overall
> + * performance at a relatively small code cost. Implementation involves the
> + * use of variadic macros supported by C99.
> */
> -#define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist
> -#define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist
> +
> +/* DEBUG_PRINT functions */
> +
> +#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
> +#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
> +
> +/* Helper macros for DEBUG_PRINT */
> +
> +#define ACPI_IS_DEBUG_ENABLED(level, component) \
> + (level & acpi_dbg_level) && (component & acpi_dbg_layer)
> +
> +#define ACPI_DEBUG(function, level, line, filename, modulename, component, ...) \
> + if (ACPI_IS_DEBUG_ENABLED (level, component)) \
> + { \
> + function (level, line, filename, modulename, component, __VA_ARGS__); \
> + }
> +
> +#define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \
> + ACPI_DEBUG (acpi_debug_print, level, line, filename, modulename, component, __VA_ARGS__)
> +
> +#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
> + ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__)
>
> #else
> /*
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 33+ messages in thread* RE: [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve performance.
2013-01-04 23:51 ` Rafael J. Wysocki
@ 2013-01-05 0:59 ` Zheng, Lv
0 siblings, 0 replies; 33+ messages in thread
From: Zheng, Lv @ 2013-01-05 0:59 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Brown, Len, linux-acpi@vger.kernel.org, Moore, Robert
OK.
I'll fix this today.
Thanks for the report.
Best regards
-Lv
> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@sisk.pl]
> Sent: Saturday, January 05, 2013 7:52 AM
> To: Zheng, Lv
> Cc: Brown, Len; linux-acpi@vger.kernel.org; Moore, Robert
> Subject: Re: [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve
> performance.
>
> On Monday, December 31, 2012 08:06:04 AM Lv Zheng wrote:
> > From: Bob Moore <robert.moore@intel.com>
> >
> > Move check for "debug enable" to before the actual call to the debug
> > print routine. Improves time of ASLTS by about 15%. Also, remove
> > "safe" exit macros since no complex expressions are ever used in the
> > return statements.
>
> Can you please fix the build breakage introduced by this patch in
> processor_driver.c?
>
> Rafael
>
>
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> > drivers/acpi/acpica/acmacros.h | 132
> ++++++++++++++++++++--------------------
> > include/acpi/acoutput.h | 32 +++++++++-
> > 2 files changed, 96 insertions(+), 68 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/acmacros.h
> > b/drivers/acpi/acpica/acmacros.h index edfcbc8..cd96135 100644
> > --- a/drivers/acpi/acpica/acmacros.h
> > +++ b/drivers/acpi/acpica/acmacros.h
> > @@ -392,29 +392,51 @@
> > * Debug macros that are conditionally compiled
> > */
> > #ifdef ACPI_DEBUG_OUTPUT
> > +
> > /*
> > * Function entry tracing
> > + *
> > + * The name of the function is emitted as a local variable that is
> > + * intended to be used by both the entry trace and the exit trace.
> > */
> > -#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
> > - acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
> > -#define ACPI_FUNCTION_TRACE_PTR(a, b) ACPI_FUNCTION_NAME(a) \
> > - acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,
> (void *)b)
> > -#define ACPI_FUNCTION_TRACE_U32(a, b) ACPI_FUNCTION_NAME(a) \
> > -
> acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS, (u32)b)
> > -#define ACPI_FUNCTION_TRACE_STR(a, b) ACPI_FUNCTION_NAME(a) \
> > -
> acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS, (char *)b)
> >
> > -#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
> > +/* Helper macro */
> > +
> > +#define ACPI_TRACE_ENTRY(name, function, cast, param) \
> > + ACPI_FUNCTION_NAME (name) \
> > + function (ACPI_DEBUG_PARAMETERS, cast (param))
> > +
> > +/* The actual entry trace macros */
> > +
> > +#define ACPI_FUNCTION_TRACE(name) \
> > + ACPI_FUNCTION_NAME(name) \
> > + acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
> > +
> > +#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
> > + ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
> > +
> > +#define ACPI_FUNCTION_TRACE_U32(name, value) \
> > + ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
> > +
> > +#define ACPI_FUNCTION_TRACE_STR(name, string) \
> > + ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
> > +
> > +#define ACPI_FUNCTION_ENTRY() \
> > + acpi_ut_track_stack_ptr()
> >
> > /*
> > - * Function exit tracing.
> > - * WARNING: These macros include a return statement. This is usually
> > considered
> > - * bad form, but having a separate exit macro is very ugly and difficult to
> maintain.
> > - * One of the FUNCTION_TRACE macros above must be used in conjunction
> > with these macros
> > - * so that "_AcpiFunctionName" is defined.
> > + * Function exit tracing
> > + *
> > + * These macros include a return statement. This is usually
> > + considered
> > + * bad form, but having a separate exit macro before the actual
> > + return
> > + * is very ugly and difficult to maintain.
> > + *
> > + * One of the FUNCTION_TRACE macros above must be used in conjunction
> > + * with these macros so that "_AcpiFunctionName" is defined.
> > *
> > - * Note: the DO_WHILE0 macro is used to prevent some compilers from
> > complaining
> > - * about these constructs.
> > + * Note: the DO_WHILE0 macro is used to prevent some compilers from
> > + * complaining about these constructs. On other compilers the
> > + do...while
> > + * adds some extra code, so this feature is optional.
> > */
> > #ifdef ACPI_USE_DO_WHILE_0
> > #define ACPI_DO_WHILE0(a) do a while(0)
> > @@ -422,55 +444,35 @@
> > #define ACPI_DO_WHILE0(a) a
> > #endif
> >
> > -#define return_VOID ACPI_DO_WHILE0 ({ \
> > - acpi_ut_exit
> (ACPI_DEBUG_PARAMETERS); \
> > - return;})
> > -/*
> > - * There are two versions of most of the return macros. The default
> > version is
> > - * safer, since it avoids side-effects by guaranteeing that the
> > argument will
> > - * not be evaluated twice.
> > - *
> > - * A less-safe version of the macros is provided for optional use if
> > the
> > - * compiler uses excessive CPU stack (for example, this may happen in
> > the
> > - * debug case if code optimzation is disabled.)
> > - */
> > -#ifndef ACPI_SIMPLE_RETURN_MACROS
> > -
> > -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
> > - register acpi_status _s =
> (s); \
> > - acpi_ut_status_exit
> (ACPI_DEBUG_PARAMETERS, _s); \
> > - return (_s); })
> > -#define return_PTR(s) ACPI_DO_WHILE0 ({ \
> > - register void *_s = (void
> *) (s); \
> > - acpi_ut_ptr_exit
> (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \
> > - return (_s); })
> > -#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
> > - register u64 _s = (s); \
> > - acpi_ut_value_exit
> (ACPI_DEBUG_PARAMETERS, _s); \
> > - return (_s); })
> > -#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
> > - register u8 _s = (u8) (s);
> \
> > - acpi_ut_value_exit
> (ACPI_DEBUG_PARAMETERS, (u64) _s); \
> > - return (_s); })
> > -#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
> > - register u32 _s = (u32)
> (s); \
> > - acpi_ut_value_exit
> (ACPI_DEBUG_PARAMETERS, (u64) _s); \
> > - return (_s); })
> > -#else /* Use original less-safe macros */
> > -
> > -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
> > - acpi_ut_status_exit
> (ACPI_DEBUG_PARAMETERS, (s)); \
> > - return((s)); })
> > -#define return_PTR(s) ACPI_DO_WHILE0 ({ \
> > - acpi_ut_ptr_exit
> (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \
> > - return((s)); })
> > -#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
> > - acpi_ut_value_exit
> (ACPI_DEBUG_PARAMETERS, (u64) (s)); \
> > - return((s)); })
> > -#define return_UINT8(s) return_VALUE(s)
> > -#define return_UINT32(s) return_VALUE(s)
> > -
> > -#endif /* ACPI_SIMPLE_RETURN_MACROS */
> > +/* Exit trace helper macro */
> > +
> > +#define ACPI_TRACE_EXIT(function, cast, param) \
> > + ACPI_DO_WHILE0 ({ \
> > + function (ACPI_DEBUG_PARAMETERS, cast (param)); \
> > + return ((param)); \
> > + })
> > +
> > +/* The actual exit macros */
> > +
> > +#define return_VOID \
> > + ACPI_DO_WHILE0 ({ \
> > + acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
> > + return; \
> > + })
> > +
> > +#define return_ACPI_STATUS(status) \
> > + ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
> > +
> > +#define return_PTR(pointer) \
> > + ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
> > +
> > +#define return_VALUE(value) \
> > + ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
> > +
> > +/* These exit macros are superfluous and should be removed entirely
> > +*/
> > +
> > +#define return_UINT8 return_VALUE
> > +#define return_UINT32 return_VALUE
> >
> > /* Conditional execution */
> >
> > diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index
> > 38e1be0..be014bf 100644
> > --- a/include/acpi/acoutput.h
> > +++ b/include/acpi/acoutput.h
> > @@ -263,16 +263,42 @@
> > * Common parameters used for debug output functions:
> > * line number, function name, module(file) name, component ID
> > */
> > -#define ACPI_DEBUG_PARAMETERS __LINE__,
> ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
> > +#define ACPI_DEBUG_PARAMETERS \
> > + __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name,
> _COMPONENT
> >
> > /*
> > * Master debug print macros
> > * Print message if and only if:
> > * 1) Debug print for the current component is enabled
> > * 2) Debug error level or trace level for the print statement is enabled
> > + *
> > + * November 2012: Moved the runtime check for whether to actually
> > + emit the
> > + * debug message outside of the print function itself. This improves
> > + overall
> > + * performance at a relatively small code cost. Implementation
> > + involves the
> > + * use of variadic macros supported by C99.
> > */
> > -#define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist
> > -#define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist
> > +
> > +/* DEBUG_PRINT functions */
> > +
> > +#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
> > +#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW
> plist
> > +
> > +/* Helper macros for DEBUG_PRINT */
> > +
> > +#define ACPI_IS_DEBUG_ENABLED(level, component) \
> > + (level & acpi_dbg_level) && (component & acpi_dbg_layer)
> > +
> > +#define ACPI_DEBUG(function, level, line, filename, modulename,
> component, ...) \
> > + if (ACPI_IS_DEBUG_ENABLED (level, component)) \
> > + { \
> > + function (level, line, filename, modulename, component,
> __VA_ARGS__); \
> > + }
> > +
> > +#define ACPI_ACTUAL_DEBUG(level, line, filename, modulename,
> component, ...) \
> > + ACPI_DEBUG (acpi_debug_print, level, line, filename, modulename,
> > +component, __VA_ARGS__)
> > +
> > +#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename,
> component, ...) \
> > + ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename,
> > +component, __VA_ARGS__)
> >
> > #else
> > /*
> >
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH 10/27] ACPICA: FUNCTION_TRACE macros: Check if debug is enabled up-front.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (8 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 09/27] ACPICA: DEBUG_PRINT macros: Update to improve performance Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 11/27] ACPICA: Eliminate superfluous return_UINT8 and return_UINT32 macros Lv Zheng
` (16 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
In the functions that implement the macros, check if debug
is enabled up-front before the call to the lower debug print
function. This provides a small performance improvement.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/utdebug.c | 118 +++++++++++++++++++++++++++--------------
1 file changed, 78 insertions(+), 40 deletions(-)
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 5d95166..47857c4 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -166,11 +166,9 @@ acpi_debug_print(u32 requested_debug_level,
acpi_thread_id thread_id;
va_list args;
- /*
- * Stay silent if the debug level or component ID is disabled
- */
- if (!(requested_debug_level & acpi_dbg_level) ||
- !(component_id & acpi_dbg_layer)) {
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) {
return;
}
@@ -236,8 +234,9 @@ acpi_debug_print_raw(u32 requested_debug_level,
{
va_list args;
- if (!(requested_debug_level & acpi_dbg_level) ||
- !(component_id & acpi_dbg_layer)) {
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) {
return;
}
@@ -272,9 +271,13 @@ acpi_ut_trace(u32 line_number,
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr();
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s\n", acpi_gbl_fn_entry_str);
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s\n", acpi_gbl_fn_entry_str);
+ }
}
ACPI_EXPORT_SYMBOL(acpi_ut_trace)
@@ -304,9 +307,14 @@ acpi_ut_trace_ptr(u32 line_number,
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr();
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s %p\n", acpi_gbl_fn_entry_str, pointer);
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s %p\n", acpi_gbl_fn_entry_str,
+ pointer);
+ }
}
/*******************************************************************************
@@ -335,9 +343,14 @@ acpi_ut_trace_str(u32 line_number,
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr();
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s %s\n", acpi_gbl_fn_entry_str, string);
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s %s\n", acpi_gbl_fn_entry_str,
+ string);
+ }
}
/*******************************************************************************
@@ -366,9 +379,14 @@ acpi_ut_trace_u32(u32 line_number,
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr();
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s %08X\n", acpi_gbl_fn_entry_str, integer);
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s %08X\n",
+ acpi_gbl_fn_entry_str, integer);
+ }
}
/*******************************************************************************
@@ -393,9 +411,13 @@ acpi_ut_exit(u32 line_number,
const char *module_name, u32 component_id)
{
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s\n", acpi_gbl_fn_exit_str);
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s\n", acpi_gbl_fn_exit_str);
+ }
acpi_gbl_nesting_level--;
}
@@ -425,17 +447,23 @@ acpi_ut_status_exit(u32 line_number,
u32 component_id, acpi_status status)
{
- if (ACPI_SUCCESS(status)) {
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name,
- component_id, "%s %s\n", acpi_gbl_fn_exit_str,
- acpi_format_exception(status));
- } else {
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name,
- component_id, "%s ****Exception****: %s\n",
- acpi_gbl_fn_exit_str,
- acpi_format_exception(status));
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ if (ACPI_SUCCESS(status)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name,
+ module_name, component_id, "%s %s\n",
+ acpi_gbl_fn_exit_str,
+ acpi_format_exception(status));
+ } else {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name,
+ module_name, component_id,
+ "%s ****Exception****: %s\n",
+ acpi_gbl_fn_exit_str,
+ acpi_format_exception(status));
+ }
}
acpi_gbl_nesting_level--;
@@ -465,10 +493,15 @@ acpi_ut_value_exit(u32 line_number,
const char *module_name, u32 component_id, u64 value)
{
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
- ACPI_FORMAT_UINT64(value));
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s %8.8X%8.8X\n",
+ acpi_gbl_fn_exit_str,
+ ACPI_FORMAT_UINT64(value));
+ }
acpi_gbl_nesting_level--;
}
@@ -497,9 +530,14 @@ acpi_ut_ptr_exit(u32 line_number,
const char *module_name, u32 component_id, u8 *ptr)
{
- acpi_debug_print(ACPI_LV_FUNCTIONS,
- line_number, function_name, module_name, component_id,
- "%s %p\n", acpi_gbl_fn_exit_str, ptr);
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+ acpi_debug_print(ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name,
+ component_id, "%s %p\n", acpi_gbl_fn_exit_str,
+ ptr);
+ }
acpi_gbl_nesting_level--;
}
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 11/27] ACPICA: Eliminate superfluous return_UINT8 and return_UINT32 macros.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (9 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 10/27] ACPICA: FUNCTION_TRACE macros: Check if debug is enabled up-front Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 12/27] ACPICA: Update ACPI_IS_DEBUG_ENABLED macro Lv Zheng
` (15 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
These macros were implemented the same as return_VALUE and thus
they were not needed.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acmacros.h | 7 -------
drivers/acpi/acpica/dsutils.c | 10 +++++-----
drivers/acpi/acpica/evgpe.c | 6 +++---
drivers/acpi/acpica/evsci.c | 4 ++--
drivers/acpi/acpica/exprep.c | 4 ++--
drivers/acpi/acpica/exutils.c | 4 ++--
drivers/acpi/acpica/hwacpi.c | 8 ++++----
drivers/acpi/acpica/nsutils.c | 8 ++++----
drivers/acpi/acpica/psargs.c | 2 +-
drivers/acpi/acpica/utaddress.c | 4 ++--
10 files changed, 25 insertions(+), 32 deletions(-)
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index cd96135..81f3cf7 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -469,11 +469,6 @@
#define return_VALUE(value) \
ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
-/* These exit macros are superfluous and should be removed entirely */
-
-#define return_UINT8 return_VALUE
-#define return_UINT32 return_VALUE
-
/* Conditional execution */
#define ACPI_DEBUG_EXEC(a) a
@@ -515,8 +510,6 @@
#define return_VOID return
#define return_ACPI_STATUS(s) return(s)
#define return_VALUE(s) return(s)
-#define return_UINT8(s) return(s)
-#define return_UINT32(s) return(s)
#define return_PTR(s) return(s)
#endif /* ACPI_DEBUG_OUTPUT */
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index afeb99f..466f5f2 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -178,7 +178,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
if (!op) {
ACPI_ERROR((AE_INFO, "Null Op"));
- return_UINT8(TRUE);
+ return_VALUE(TRUE);
}
/*
@@ -210,7 +210,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
"At Method level, result of [%s] not used\n",
acpi_ps_get_opcode_name(op->common.
aml_opcode)));
- return_UINT8(FALSE);
+ return_VALUE(FALSE);
}
/* Get info on the parent. The root_op is AML_SCOPE */
@@ -219,7 +219,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_info(op->common.parent->common.aml_opcode);
if (parent_info->class == AML_CLASS_UNKNOWN) {
ACPI_ERROR((AE_INFO, "Unknown parent opcode Op=%p", op));
- return_UINT8(FALSE);
+ return_VALUE(FALSE);
}
/*
@@ -307,7 +307,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_name(op->common.parent->common.
aml_opcode), op));
- return_UINT8(TRUE);
+ return_VALUE(TRUE);
result_not_used:
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
@@ -316,7 +316,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_name(op->common.parent->common.
aml_opcode), op));
- return_UINT8(FALSE);
+ return_VALUE(FALSE);
}
/*******************************************************************************
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index 4cbb600..052d4c8 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -707,7 +707,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Unable to clear GPE%02X", gpe_number));
- return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
+ return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -724,7 +724,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Unable to disable GPE%02X", gpe_number));
- return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
+ return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
}
/*
@@ -784,7 +784,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
break;
}
- return_UINT32(ACPI_INTERRUPT_HANDLED);
+ return_VALUE(ACPI_INTERRUPT_HANDLED);
}
#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index f9661e2..6c90f15 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -89,7 +89,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
*/
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
- return_UINT32(interrupt_handled);
+ return_VALUE(interrupt_handled);
}
/*******************************************************************************
@@ -120,7 +120,7 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
- return_UINT32(interrupt_handled);
+ return_VALUE(interrupt_handled);
}
/******************************************************************************
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index ba9db4d..60ee5e9 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -276,7 +276,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
/* Invalid field access type */
ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
- return_UINT32(0);
+ return_VALUE(0);
}
if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) {
@@ -289,7 +289,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
}
*return_byte_alignment = byte_alignment;
- return_UINT32(bit_length);
+ return_VALUE(bit_length);
}
/*******************************************************************************
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index 264d22d..02ddc4c 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -336,7 +336,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base)
/* u64 is unsigned, so we don't worry about a '-' prefix */
if (value == 0) {
- return_UINT32(1);
+ return_VALUE(1);
}
current_value = value;
@@ -350,7 +350,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base)
num_digits++;
}
- return_UINT32(num_digits);
+ return_VALUE(num_digits);
}
/*******************************************************************************
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index effa2b0..2613e29 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -151,18 +151,18 @@ u32 acpi_hw_get_mode(void)
* system does not support mode transition.
*/
if (!acpi_gbl_FADT.smi_command) {
- return_UINT32(ACPI_SYS_MODE_ACPI);
+ return_VALUE(ACPI_SYS_MODE_ACPI);
}
status = acpi_read_bit_register(ACPI_BITREG_SCI_ENABLE, &value);
if (ACPI_FAILURE(status)) {
- return_UINT32(ACPI_SYS_MODE_LEGACY);
+ return_VALUE(ACPI_SYS_MODE_LEGACY);
}
if (value) {
- return_UINT32(ACPI_SYS_MODE_ACPI);
+ return_VALUE(ACPI_SYS_MODE_ACPI);
} else {
- return_UINT32(ACPI_SYS_MODE_LEGACY);
+ return_VALUE(ACPI_SYS_MODE_LEGACY);
}
}
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 596d4cc..a771c8c 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -112,10 +112,10 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node)
if (!node) {
ACPI_WARNING((AE_INFO, "Null Node parameter"));
- return_UINT32(ACPI_TYPE_ANY);
+ return_VALUE(ACPI_TYPE_ANY);
}
- return_UINT32((acpi_object_type) node->type);
+ return_VALUE(node->type);
}
/*******************************************************************************
@@ -140,10 +140,10 @@ u32 acpi_ns_local(acpi_object_type type)
/* Type code out of range */
ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type));
- return_UINT32(ACPI_NS_NORMAL);
+ return_VALUE(ACPI_NS_NORMAL);
}
- return_UINT32((u32) acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
+ return_VALUE(acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
}
/*******************************************************************************
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 9f31893..9256513 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -108,7 +108,7 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state)
/* Byte 0 is a special case, either bits [0:3] or [0:5] are used */
package_length |= (aml[0] & byte_zero_mask);
- return_UINT32(package_length);
+ return_VALUE(package_length);
}
/*******************************************************************************
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
index 6488030..b86ef85 100644
--- a/drivers/acpi/acpica/utaddress.c
+++ b/drivers/acpi/acpica/utaddress.c
@@ -214,7 +214,7 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
(space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
- return_UINT32(0);
+ return_VALUE(0);
}
range_info = acpi_gbl_address_range_list[space_id];
@@ -256,7 +256,7 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
range_info = range_info->next;
}
- return_UINT32(overlap_count);
+ return_VALUE(overlap_count);
}
/*******************************************************************************
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 12/27] ACPICA: Update ACPI_IS_DEBUG_ENABLED macro.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (10 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 11/27] ACPICA: Eliminate superfluous return_UINT8 and return_UINT32 macros Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 13/27] ACPICA: Deploy new ACPI_IS_DEBUG_ENABLED macro in debug output code Lv Zheng
` (14 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Add extra parens to allow use of !ACPI_IS_DEBUG_ENABLED.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/acoutput.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index be014bf..5ef4e57 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -286,7 +286,7 @@
/* Helper macros for DEBUG_PRINT */
#define ACPI_IS_DEBUG_ENABLED(level, component) \
- (level & acpi_dbg_level) && (component & acpi_dbg_layer)
+ ((level & acpi_dbg_level) && (component & acpi_dbg_layer))
#define ACPI_DEBUG(function, level, line, filename, modulename, component, ...) \
if (ACPI_IS_DEBUG_ENABLED (level, component)) \
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 13/27] ACPICA: Deploy new ACPI_IS_DEBUG_ENABLED macro in debug output code.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (11 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 12/27] ACPICA: Update ACPI_IS_DEBUG_ENABLED macro Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 14/27] ACPICA: Merge all debug output macros into a single file, acoutput Lv Zheng
` (13 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Simplifies check for debug output enables.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/exdump.c | 19 ++++++++++---------
drivers/acpi/acpica/nsdump.c | 7 ++++---
drivers/acpi/acpica/rsdump.c | 10 ++++++----
3 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 858b43a..8698bff 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -464,9 +464,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
ACPI_FUNCTION_NAME(ex_dump_operand)
- if (!
- ((ACPI_LV_EXEC & acpi_dbg_level)
- && (_COMPONENT & acpi_dbg_layer))) {
+ /* Check if debug output enabled */
+ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_EXEC, _COMPONENT)) {
return;
}
@@ -811,9 +810,10 @@ void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
ACPI_FUNCTION_ENTRY();
if (!flags) {
- if (!
- ((ACPI_LV_OBJECTS & acpi_dbg_level)
- && (_COMPONENT & acpi_dbg_layer))) {
+
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_OBJECTS, _COMPONENT)) {
return;
}
}
@@ -999,9 +999,10 @@ acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
}
if (!flags) {
- if (!
- ((ACPI_LV_OBJECTS & acpi_dbg_level)
- && (_COMPONENT & acpi_dbg_layer))) {
+
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_OBJECTS, _COMPONENT)) {
return_VOID;
}
}
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 8e6f0037..3e04879 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -77,8 +77,9 @@ void acpi_ns_print_pathname(u32 num_segments, char *pathname)
ACPI_FUNCTION_NAME(ns_print_pathname);
- if (!(acpi_dbg_level & ACPI_LV_NAMES)
- || !(acpi_dbg_layer & ACPI_NAMESPACE)) {
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_NAMES, ACPI_NAMESPACE)) {
return;
}
@@ -127,7 +128,7 @@ acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)
/* Do this only if the requested debug level and component are enabled */
- if (!(acpi_dbg_level & level) || !(acpi_dbg_layer & component)) {
+ if (!ACPI_IS_DEBUG_ENABLED(level, component)) {
return_VOID;
}
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 0b7381f..203b4ae 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -766,8 +766,9 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
ACPI_FUNCTION_ENTRY();
- if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
- || !(_COMPONENT & acpi_dbg_layer)) {
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
return;
}
@@ -828,8 +829,9 @@ void acpi_rs_dump_irq_list(u8 * route_table)
ACPI_FUNCTION_ENTRY();
- if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
- || !(_COMPONENT & acpi_dbg_layer)) {
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
return;
}
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 14/27] ACPICA: Merge all debug output macros into a single file, acoutput.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (12 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 13/27] ACPICA: Deploy new ACPI_IS_DEBUG_ENABLED macro in debug output code Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 15/27] ACPICA: iASL: Finish support for CSRT table Lv Zheng
` (12 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Moved the debug trace macros from acmacros.h into acoutput.h
where they belong.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acmacros.h | 126 ----------------------------------------
include/acpi/acoutput.h | 115 ++++++++++++++++++++++++++++++++++++
2 files changed, 115 insertions(+), 126 deletions(-)
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 81f3cf7..2db0f10 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -388,132 +388,6 @@
#endif /* ACPI_NO_ERROR_MESSAGES */
-/*
- * Debug macros that are conditionally compiled
- */
-#ifdef ACPI_DEBUG_OUTPUT
-
-/*
- * Function entry tracing
- *
- * The name of the function is emitted as a local variable that is
- * intended to be used by both the entry trace and the exit trace.
- */
-
-/* Helper macro */
-
-#define ACPI_TRACE_ENTRY(name, function, cast, param) \
- ACPI_FUNCTION_NAME (name) \
- function (ACPI_DEBUG_PARAMETERS, cast (param))
-
-/* The actual entry trace macros */
-
-#define ACPI_FUNCTION_TRACE(name) \
- ACPI_FUNCTION_NAME(name) \
- acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
-
-#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
- ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
-
-#define ACPI_FUNCTION_TRACE_U32(name, value) \
- ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
-
-#define ACPI_FUNCTION_TRACE_STR(name, string) \
- ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
-
-#define ACPI_FUNCTION_ENTRY() \
- acpi_ut_track_stack_ptr()
-
-/*
- * Function exit tracing
- *
- * These macros include a return statement. This is usually considered
- * bad form, but having a separate exit macro before the actual return
- * is very ugly and difficult to maintain.
- *
- * One of the FUNCTION_TRACE macros above must be used in conjunction
- * with these macros so that "_AcpiFunctionName" is defined.
- *
- * Note: the DO_WHILE0 macro is used to prevent some compilers from
- * complaining about these constructs. On other compilers the do...while
- * adds some extra code, so this feature is optional.
- */
-#ifdef ACPI_USE_DO_WHILE_0
-#define ACPI_DO_WHILE0(a) do a while(0)
-#else
-#define ACPI_DO_WHILE0(a) a
-#endif
-
-/* Exit trace helper macro */
-
-#define ACPI_TRACE_EXIT(function, cast, param) \
- ACPI_DO_WHILE0 ({ \
- function (ACPI_DEBUG_PARAMETERS, cast (param)); \
- return ((param)); \
- })
-
-/* The actual exit macros */
-
-#define return_VOID \
- ACPI_DO_WHILE0 ({ \
- acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
- return; \
- })
-
-#define return_ACPI_STATUS(status) \
- ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
-
-#define return_PTR(pointer) \
- ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
-
-#define return_VALUE(value) \
- ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
-
-/* Conditional execution */
-
-#define ACPI_DEBUG_EXEC(a) a
-#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
-#define _VERBOSE_STRUCTURES
-
-/* Various object display routines for debug */
-
-#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
-#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
-#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
-#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
-#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
-
-#else
-/*
- * This is the non-debug case -- make everything go away,
- * leaving no executable debug code!
- */
-#define ACPI_DEBUG_EXEC(a)
-#define ACPI_DEBUG_ONLY_MEMBERS(a)
-#define ACPI_FUNCTION_TRACE(a)
-#define ACPI_FUNCTION_TRACE_PTR(a, b)
-#define ACPI_FUNCTION_TRACE_U32(a, b)
-#define ACPI_FUNCTION_TRACE_STR(a, b)
-#define ACPI_FUNCTION_EXIT
-#define ACPI_FUNCTION_STATUS_EXIT(s)
-#define ACPI_FUNCTION_VALUE_EXIT(s)
-#define ACPI_FUNCTION_ENTRY()
-#define ACPI_DUMP_STACK_ENTRY(a)
-#define ACPI_DUMP_OPERANDS(a, b, c)
-#define ACPI_DUMP_ENTRY(a, b)
-#define ACPI_DUMP_TABLES(a, b)
-#define ACPI_DUMP_PATHNAME(a, b, c, d)
-#define ACPI_DUMP_BUFFER(a, b)
-#define ACPI_DEBUG_PRINT(pl)
-#define ACPI_DEBUG_PRINT_RAW(pl)
-
-#define return_VOID return
-#define return_ACPI_STATUS(s) return(s)
-#define return_VALUE(s) return(s)
-#define return_PTR(s) return(s)
-
-#endif /* ACPI_DEBUG_OUTPUT */
-
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr
#else
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 5ef4e57..c13b351 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -300,7 +300,97 @@
#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__)
+/*
+ * Function entry tracing
+ *
+ * The name of the function is emitted as a local variable that is
+ * intended to be used by both the entry trace and the exit trace.
+ */
+
+/* Helper macro */
+
+#define ACPI_TRACE_ENTRY(name, function, cast, param) \
+ ACPI_FUNCTION_NAME (name) \
+ function (ACPI_DEBUG_PARAMETERS, cast (param))
+
+/* The actual entry trace macros */
+
+#define ACPI_FUNCTION_TRACE(name) \
+ ACPI_FUNCTION_NAME(name) \
+ acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
+
+#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
+ ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
+
+#define ACPI_FUNCTION_TRACE_U32(name, value) \
+ ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
+
+#define ACPI_FUNCTION_TRACE_STR(name, string) \
+ ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
+
+#define ACPI_FUNCTION_ENTRY() \
+ acpi_ut_track_stack_ptr()
+
+/*
+ * Function exit tracing
+ *
+ * These macros include a return statement. This is usually considered
+ * bad form, but having a separate exit macro before the actual return
+ * is very ugly and difficult to maintain.
+ *
+ * One of the FUNCTION_TRACE macros above must be used in conjunction
+ * with these macros so that "_AcpiFunctionName" is defined.
+ *
+ * Note: the DO_WHILE0 macro is used to prevent some compilers from
+ * complaining about these constructs. On other compilers the do...while
+ * adds some extra code, so this feature is optional.
+ */
+#ifdef ACPI_USE_DO_WHILE_0
+#define ACPI_DO_WHILE0(a) do a while(0)
#else
+#define ACPI_DO_WHILE0(a) a
+#endif
+
+/* Exit trace helper macro */
+
+#define ACPI_TRACE_EXIT(function, cast, param) \
+ ACPI_DO_WHILE0 ({ \
+ function (ACPI_DEBUG_PARAMETERS, cast (param)); \
+ return ((param)); \
+ })
+
+/* The actual exit macros */
+
+#define return_VOID \
+ ACPI_DO_WHILE0 ({ \
+ acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
+ return; \
+ })
+
+#define return_ACPI_STATUS(status) \
+ ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
+
+#define return_PTR(pointer) \
+ ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
+
+#define return_VALUE(value) \
+ ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
+
+/* Conditional execution */
+
+#define ACPI_DEBUG_EXEC(a) a
+#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
+#define _VERBOSE_STRUCTURES
+
+/* Various object display routines for debug */
+
+#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
+#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
+#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
+#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
+#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
+
+#else /* ACPI_DEBUG_OUTPUT */
/*
* This is the non-debug case -- make everything go away,
* leaving no executable debug code!
@@ -308,6 +398,31 @@
#define ACPI_FUNCTION_NAME(a)
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_DEBUG_PRINT_RAW(pl)
+#define ACPI_DEBUG_EXEC(a)
+#define ACPI_DEBUG_ONLY_MEMBERS(a)
+#define ACPI_FUNCTION_TRACE(a)
+#define ACPI_FUNCTION_TRACE_PTR(a, b)
+#define ACPI_FUNCTION_TRACE_U32(a, b)
+#define ACPI_FUNCTION_TRACE_STR(a, b)
+#define ACPI_FUNCTION_EXIT
+#define ACPI_FUNCTION_STATUS_EXIT(s)
+#define ACPI_FUNCTION_VALUE_EXIT(s)
+#define ACPI_FUNCTION_ENTRY()
+#define ACPI_DUMP_STACK_ENTRY(a)
+#define ACPI_DUMP_OPERANDS(a, b, c)
+#define ACPI_DUMP_ENTRY(a, b)
+#define ACPI_DUMP_TABLES(a, b)
+#define ACPI_DUMP_PATHNAME(a, b, c, d)
+#define ACPI_DUMP_BUFFER(a, b)
+#define ACPI_DEBUG_PRINT(pl)
+#define ACPI_DEBUG_PRINT_RAW(pl)
+
+/* Return macros must have a return statement at the minimum */
+
+#define return_VOID return
+#define return_ACPI_STATUS(s) return(s)
+#define return_VALUE(s) return(s)
+#define return_PTR(s) return(s)
#endif /* ACPI_DEBUG_OUTPUT */
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 15/27] ACPICA: iASL: Finish support for CSRT table.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (13 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 14/27] ACPICA: Merge all debug output macros into a single file, acoutput Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 16/27] ACPICA: iASL: Finish support for the TPM2 table Lv Zheng
` (11 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Add intel-specific shared info subtable. Add data table compiler
and template support.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/actbl2.h | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 1b2b356..ef9dae1 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -261,9 +261,28 @@ struct acpi_csrt_group {
u16 subdevice_id;
u16 revision;
u16 reserved;
- u32 info_length;
+ u32 shared_info_length;
- /* Shared data (length = info_length) immediately follows */
+ /* Shared data immediately follows (Length = shared_info_length) */
+};
+
+/* Shared Info subtable */
+
+struct acpi_csrt_shared_info {
+ u16 major_version;
+ u16 minor_version;
+ u32 mmio_base_low;
+ u32 mmio_base_high;
+ u32 gsi_interrupt;
+ u8 interrupt_polarity;
+ u8 interrupt_mode;
+ u8 num_channels;
+ u8 dma_address_width;
+ u16 base_request_line;
+ u16 num_handshake_signals;
+ u32 max_block_size;
+
+ /* Resource descriptors immediately follow (Length = Group length - shared_info_length) */
};
/* Resource Descriptor subtable */
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 16/27] ACPICA: iASL: Finish support for the TPM2 table.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (14 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 15/27] ACPICA: iASL: Finish support for CSRT table Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 17/27] ACPICA: Update for non-configured ACPI_IS_DEBUG_ENABLED macro Lv Zheng
` (10 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Add disassembler, table compiler, and template support.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/actbl3.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index a067d7d..c4aae22 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -75,7 +75,6 @@
/* Reserved table signatures */
-#define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */
#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 17/27] ACPICA: Update for non-configured ACPI_IS_DEBUG_ENABLED macro.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (15 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 16/27] ACPICA: iASL: Finish support for the TPM2 table Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:06 ` [PATCH 18/27] ACPICA: Fix possible memory leak in dispatcher error path Lv Zheng
` (9 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Also add acoutput.h to the nsdump.c file.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/nsdump.c | 1 +
include/acpi/acoutput.h | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 3e04879..37b0e68 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -44,6 +44,7 @@
#include <acpi/acpi.h>
#include "accommon.h"
#include "acnamesp.h"
+#include <acpi/acoutput.h>
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsdump")
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index c13b351..23db272 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -266,6 +266,11 @@
#define ACPI_DEBUG_PARAMETERS \
__LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
+/* Check if debug output is currently dynamically enabled */
+
+#define ACPI_IS_DEBUG_ENABLED(level, component) \
+ ((level & acpi_dbg_level) && (component & acpi_dbg_layer))
+
/*
* Master debug print macros
* Print message if and only if:
@@ -285,9 +290,6 @@
/* Helper macros for DEBUG_PRINT */
-#define ACPI_IS_DEBUG_ENABLED(level, component) \
- ((level & acpi_dbg_level) && (component & acpi_dbg_layer))
-
#define ACPI_DEBUG(function, level, line, filename, modulename, component, ...) \
if (ACPI_IS_DEBUG_ENABLED (level, component)) \
{ \
@@ -416,6 +418,7 @@
#define ACPI_DUMP_BUFFER(a, b)
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_DEBUG_PRINT_RAW(pl)
+#define ACPI_IS_DEBUG_ENABLED(level, component) 0
/* Return macros must have a return statement at the minimum */
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 18/27] ACPICA: Fix possible memory leak in dispatcher error path.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (16 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 17/27] ACPICA: Update for non-configured ACPI_IS_DEBUG_ENABLED macro Lv Zheng
@ 2012-12-31 0:06 ` Lv Zheng
2012-12-31 0:07 ` [PATCH 19/27] ACPICA: Resource manager: Add support for ACPI 5 wake bit in IRQ descriptor Lv Zheng
` (8 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:06 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Tim Gardner, Bob Moore, Lv Zheng
From: Tim Gardner <tim.gardner@canonical.com>
On error, delete mutex object created during method mutex creation.
Reported by tim.gardner@canonical.com.
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/dsmethod.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 54c968a..4e5873a 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -151,6 +151,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc)
status = acpi_os_create_mutex(&mutex_desc->mutex.os_mutex);
if (ACPI_FAILURE(status)) {
+ acpi_ut_delete_object_desc(mutex_desc);
return_ACPI_STATUS(status);
}
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 19/27] ACPICA: Resource manager: Add support for ACPI 5 wake bit in IRQ descriptor.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (17 preceding siblings ...)
2012-12-31 0:06 ` [PATCH 18/27] ACPICA: Fix possible memory leak in dispatcher error path Lv Zheng
@ 2012-12-31 0:07 ` Lv Zheng
2012-12-31 0:07 ` [PATCH 20/27] ACPICA: Namespace: Eliminate dot...dot output during initialization Lv Zheng
` (7 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:07 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Aaron Lu, Bob Moore, Lv Zheng
From: Aaron Lu <aaron.lu@intel.com>
Add support to both get and set the extended share flags for the
IRQ() resource descriptor. Reported by Aaron Lu.
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/rsirq.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index a718eca..14cb76e 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -80,7 +80,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
- /* Get flags: Triggering[0], Polarity[3], Sharing[4] */
+ /* Get flags: Triggering[0], Polarity[3], sharing_and_wake[4:5] */
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
AML_OFFSET(irq.flags),
@@ -90,7 +90,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
AML_OFFSET(irq.flags),
3},
- {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
AML_OFFSET(irq.flags),
4}
};
@@ -114,7 +114,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
AML_OFFSET(irq.irq_mask),
ACPI_RS_OFFSET(data.irq.interrupt_count)},
- /* Set the flags byte */
+ /* Set flags: Triggering[0], Polarity[3], sharing_and_wake[4:5] */
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
AML_OFFSET(irq.flags),
@@ -124,7 +124,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
AML_OFFSET(irq.flags),
3},
- {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
AML_OFFSET(irq.flags),
4},
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 20/27] ACPICA: Namespace: Eliminate dot...dot output during initialization.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (18 preceding siblings ...)
2012-12-31 0:07 ` [PATCH 19/27] ACPICA: Resource manager: Add support for ACPI 5 wake bit in IRQ descriptor Lv Zheng
@ 2012-12-31 0:07 ` Lv Zheng
2012-12-31 0:07 ` [PATCH 21/27] ACPICA: Update ACPICA initialization messages Lv Zheng
` (6 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:07 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
This feature no longer serves any good purpose and also confuses any error
messages during ACPICA initialization.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/nsinit.c | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index 94c1500..59cd5b4 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -86,7 +86,7 @@ acpi_status acpi_ns_initialize_objects(void)
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
- "Completing Region/Field/Buffer/Package initialization:"));
+ "Completing Region/Field/Buffer/Package initialization:\n"));
/* Set all init info to zero */
@@ -102,7 +102,7 @@ acpi_status acpi_ns_initialize_objects(void)
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
- "\nInitialized %u/%u Regions %u/%u Fields %u/%u "
+ "Initialized %u/%u Regions %u/%u Fields %u/%u "
"Buffers %u/%u Packages (%u nodes)\n",
info.op_region_init, info.op_region_count,
info.field_init, info.field_count,
@@ -149,7 +149,7 @@ acpi_status acpi_ns_initialize_devices(void)
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing Device/Processor/Thermal objects "
- "by executing _INI methods:"));
+ "and executing _INI methods:\n"));
/* Tree analysis: find all subtrees that contain _INI methods */
@@ -207,7 +207,7 @@ acpi_status acpi_ns_initialize_devices(void)
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
- "\nExecuted %u _INI methods requiring %u _STA executions "
+ "Executed %u _INI methods requiring %u _STA executions "
"(examined %u objects)\n",
info.num_INI, info.num_STA, info.device_count));
@@ -349,14 +349,6 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
}
/*
- * Print a dot for each object unless we are going to print the entire
- * pathname
- */
- if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
- ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
- }
-
- /*
* We ignore errors from above, and always return OK, since we don't want
* to abort the walk on any single error.
*/
@@ -575,11 +567,6 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
if (ACPI_SUCCESS(status)) {
walk_info->num_INI++;
-
- if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) &&
- (!(acpi_dbg_level & ACPI_LV_INFO))) {
- ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
- }
}
#ifdef ACPI_DEBUG_OUTPUT
else if (status != AE_NOT_FOUND) {
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 21/27] ACPICA: Update ACPICA initialization messages.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (19 preceding siblings ...)
2012-12-31 0:07 ` [PATCH 20/27] ACPICA: Namespace: Eliminate dot...dot output during initialization Lv Zheng
@ 2012-12-31 0:07 ` Lv Zheng
2012-12-31 0:07 ` [PATCH 22/27] ACPICA: Interpreter: Add warning if 64-bit constant appears in 32-bit table Lv Zheng
` (5 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:07 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Clarify messages, indent if appropriate. Change a couple
appropriate messages to ACPI_INFO so they will appear even if
debug output is disabled.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/evgpeblk.c | 22 ++++++++++++----------
drivers/acpi/acpica/evgpeinit.c | 3 +++
drivers/acpi/acpica/nsinit.c | 6 +++---
drivers/acpi/acpica/tbxfload.c | 2 +-
4 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index 1571a61..78db9f5 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -405,13 +405,13 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
(*return_gpe_block) = gpe_block;
}
- ACPI_DEBUG_PRINT((ACPI_DB_INIT,
- "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
- (u32) gpe_block->block_base_number,
- (u32) (gpe_block->block_base_number +
- (gpe_block->gpe_count - 1)),
- gpe_device->name.ascii, gpe_block->register_count,
- interrupt_number));
+ ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
+ " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
+ (u32)gpe_block->block_base_number,
+ (u32)(gpe_block->block_base_number +
+ (gpe_block->gpe_count - 1)),
+ gpe_device->name.ascii, gpe_block->register_count,
+ interrupt_number));
/* Update global count of currently available GPEs */
@@ -496,9 +496,11 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
}
if (gpe_enabled_count) {
- ACPI_DEBUG_PRINT((ACPI_DB_INIT,
- "Enabled %u GPEs in this block\n",
- gpe_enabled_count));
+ ACPI_INFO((AE_INFO,
+ "Enabled %u GPEs in block %02X to %02X",
+ gpe_enabled_count, (u32)gpe_block->block_base_number,
+ (u32)(gpe_block->block_base_number +
+ (gpe_block->gpe_count - 1))));
}
gpe_block->initialized = TRUE;
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index da0add8..8ac86b0 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -86,6 +86,9 @@ acpi_status acpi_ev_gpe_initialize(void)
ACPI_FUNCTION_TRACE(ev_gpe_initialize);
+ ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
+ "Initializing General Purpose Events (GPEs):\n"));
+
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index 59cd5b4..0f8de6e 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -102,7 +102,7 @@ acpi_status acpi_ns_initialize_objects(void)
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
- "Initialized %u/%u Regions %u/%u Fields %u/%u "
+ " Initialized %u/%u Regions %u/%u Fields %u/%u "
"Buffers %u/%u Packages (%u nodes)\n",
info.op_region_init, info.op_region_count,
info.field_init, info.field_count,
@@ -149,7 +149,7 @@ acpi_status acpi_ns_initialize_devices(void)
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing Device/Processor/Thermal objects "
- "and executing _INI methods:\n"));
+ "and executing _INI/_STA methods:\n"));
/* Tree analysis: find all subtrees that contain _INI methods */
@@ -207,7 +207,7 @@ acpi_status acpi_ns_initialize_devices(void)
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
- "Executed %u _INI methods requiring %u _STA executions "
+ " Executed %u _INI methods requiring %u _STA executions "
"(examined %u objects)\n",
info.num_INI, info.num_STA, info.device_count));
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index a5e1e4e..7feaafd 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -192,7 +192,7 @@ static acpi_status acpi_tb_load_namespace(void)
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
}
- ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n"));
+ ACPI_INFO((AE_INFO, "All ACPI Tables successfully acquired"));
unlock_and_exit:
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 22/27] ACPICA: Interpreter: Add warning if 64-bit constant appears in 32-bit table.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (20 preceding siblings ...)
2012-12-31 0:07 ` [PATCH 21/27] ACPICA: Update ACPICA initialization messages Lv Zheng
@ 2012-12-31 0:07 ` Lv Zheng
2012-12-31 0:07 ` [PATCH 23/27] ACPICA: Resources: Support for ACPI 5 wake bit in ExtendedInterrupt descriptor Lv Zheng
` (4 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:07 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Some ASL compilers allow 64-bit constants within a 32-bit table
(DSDT version == 1). When encountered, emit a warning that the
constant will be truncated to 32 bits. This is potentially a
serious problem in the ACPI table(s).
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acinterp.h | 2 +-
drivers/acpi/acpica/dsobject.c | 14 ++++++++++++--
drivers/acpi/acpica/dswexec.c | 4 ++--
drivers/acpi/acpica/exconvrt.c | 2 +-
drivers/acpi/acpica/exstoren.c | 2 +-
drivers/acpi/acpica/exutils.c | 18 +++++++++++-------
6 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/acpica/acinterp.h b/drivers/acpi/acpica/acinterp.h
index eb30863..16469b0 100644
--- a/drivers/acpi/acpica/acinterp.h
+++ b/drivers/acpi/acpica/acinterp.h
@@ -458,7 +458,7 @@ 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_truncate_for32bit_table(union acpi_operand_object *obj_desc);
void acpi_ex_acquire_global_lock(u32 rule);
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index 13844a1..82050bc 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -703,7 +703,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
/* Truncate value if we are executing from a 32-bit ACPI table */
#ifndef ACPI_NO_METHOD_EXECUTION
- acpi_ex_truncate_for32bit_table(obj_desc);
+ (void)acpi_ex_truncate_for32bit_table(obj_desc);
#endif
break;
@@ -725,8 +725,18 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
case AML_TYPE_LITERAL:
obj_desc->integer.value = op->common.value.integer;
+
#ifndef ACPI_NO_METHOD_EXECUTION
- acpi_ex_truncate_for32bit_table(obj_desc);
+ if (acpi_ex_truncate_for32bit_table(obj_desc)) {
+
+ /* Warn if we found a 64-bit constant in a 32-bit table */
+
+ ACPI_WARNING((AE_INFO,
+ "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X",
+ ACPI_FORMAT_UINT64(op->common.
+ value.integer),
+ (u32)obj_desc->integer.value));
+ }
#endif
break;
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index 5859393..9e0d210 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -149,7 +149,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
/* Truncate the predicate to 32-bits if necessary */
- acpi_ex_truncate_for32bit_table(local_obj_desc);
+ (void)acpi_ex_truncate_for32bit_table(local_obj_desc);
/*
* Save the result of the predicate evaluation on
@@ -706,7 +706,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
* ACPI 2.0 support for 64-bit integers: Truncate numeric
* result value if we are executing from a 32-bit ACPI table
*/
- acpi_ex_truncate_for32bit_table(walk_state->result_obj);
+ (void)acpi_ex_truncate_for32bit_table(walk_state->result_obj);
/*
* Check if we just completed the evaluation of a
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c
index 4492a4e..d6a7b6f 100644
--- a/drivers/acpi/acpica/exconvrt.c
+++ b/drivers/acpi/acpica/exconvrt.c
@@ -176,7 +176,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
/* Save the Result */
- acpi_ex_truncate_for32bit_table(return_desc);
+ (void)acpi_ex_truncate_for32bit_table(return_desc);
*result_desc = return_desc;
return_ACPI_STATUS(AE_OK);
}
diff --git a/drivers/acpi/acpica/exstoren.c b/drivers/acpi/acpica/exstoren.c
index 87153bb..85a74b7 100644
--- a/drivers/acpi/acpica/exstoren.c
+++ b/drivers/acpi/acpica/exstoren.c
@@ -253,7 +253,7 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
/* Truncate value if we are executing from a 32-bit ACPI table */
- acpi_ex_truncate_for32bit_table(dest_desc);
+ (void)acpi_ex_truncate_for32bit_table(dest_desc);
break;
case ACPI_TYPE_STRING:
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index 02ddc4c..e624958 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -202,35 +202,39 @@ void acpi_ex_relinquish_interpreter(void)
*
* PARAMETERS: obj_desc - Object to be truncated
*
- * RETURN: none
+ * RETURN: TRUE if a truncation was performed, FALSE otherwise.
*
* DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is
* 32-bit, as determined by the revision of the DSDT.
*
******************************************************************************/
-void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
+u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
{
ACPI_FUNCTION_ENTRY();
/*
* Object must be a valid number and we must be executing
- * a control method. NS node could be there for AML_INT_NAMEPATH_OP.
+ * a control method. Object could be NS node for AML_INT_NAMEPATH_OP.
*/
if ((!obj_desc) ||
(ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) ||
(obj_desc->common.type != ACPI_TYPE_INTEGER)) {
- return;
+ return (FALSE);
}
- if (acpi_gbl_integer_byte_width == 4) {
+ if ((acpi_gbl_integer_byte_width == 4) &&
+ (obj_desc->integer.value > (u64)ACPI_UINT32_MAX)) {
/*
- * We are running a method that exists in a 32-bit ACPI table.
+ * We are executing in a 32-bit ACPI table.
* Truncate the value to 32 bits by zeroing out the upper 32-bit field
*/
- obj_desc->integer.value &= (u64) ACPI_UINT32_MAX;
+ obj_desc->integer.value &= (u64)ACPI_UINT32_MAX;
+ return (TRUE);
}
+
+ return (FALSE);
}
/*******************************************************************************
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 23/27] ACPICA: Resources: Support for ACPI 5 wake bit in ExtendedInterrupt descriptor.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (21 preceding siblings ...)
2012-12-31 0:07 ` [PATCH 22/27] ACPICA: Interpreter: Add warning if 64-bit constant appears in 32-bit table Lv Zheng
@ 2012-12-31 0:07 ` Lv Zheng
2012-12-31 0:07 ` [PATCH 24/27] ACPICA: Resources: Split interrupt share/wake bits into two fields Lv Zheng
` (3 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:07 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Aaron Lu, Bob Moore, Lv Zheng
From: Aaron Lu <aaron.lu@intel.com>
Add support to both get and set the extended share flags for the
Interrupt() resource descriptor. Reported by Aaron Lu.
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/rsirq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index 14cb76e..f3733ee 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -190,8 +190,10 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
sizeof(struct aml_resource_extended_irq),
0},
- /* Flag bits */
-
+ /*
+ * Flags: Producer/Consumer[0], Triggering[1], Polarity[2],
+ * sharing_and_wake[3:4]
+ */
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer),
AML_OFFSET(extended_irq.flags),
0},
@@ -204,7 +206,7 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
AML_OFFSET(extended_irq.flags),
2},
- {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
AML_OFFSET(extended_irq.flags),
3},
@@ -283,7 +285,6 @@ struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[4] = {
* request_lines
* Channels
*/
-
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_dma.request_lines),
AML_OFFSET(fixed_dma.request_lines),
2},
@@ -291,5 +292,4 @@ struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[4] = {
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_dma.width),
AML_OFFSET(fixed_dma.width),
1},
-
};
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 24/27] ACPICA: Resources: Split interrupt share/wake bits into two fields.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (22 preceding siblings ...)
2012-12-31 0:07 ` [PATCH 23/27] ACPICA: Resources: Support for ACPI 5 wake bit in ExtendedInterrupt descriptor Lv Zheng
@ 2012-12-31 0:07 ` Lv Zheng
2012-12-31 0:11 ` [PATCH 25/27] ACPICA: Interpreter: Fix Store() when implicit conversion is not possible Lv Zheng
` (2 subsequent siblings)
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:07 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
These two bits are merged at the external interface level for the
IRQ, Interrupt, and GpioInt resource descriptors. However, these
bits are logically independent and there is no need to keep them
merged internally. Therefore, this change splits the bits into
"sharable" and "wake capable" fields within the resource manager.
This simplifies drive code that needs to examine these bits.
Aaron Lu, Bob Moore.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/rsirq.c | 32 ++++++++++++++++++++++----------
| 8 ++++++--
include/acpi/acrestyp.h | 10 ++++++++--
3 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index f3733ee..9c1d74a 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsirq")
* acpi_rs_get_irq
*
******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
+struct acpi_rsconvert_info acpi_rs_get_irq[9] = {
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
ACPI_RS_SIZE(struct acpi_resource_irq),
ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)},
@@ -80,7 +80,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
- /* Get flags: Triggering[0], Polarity[3], sharing_and_wake[4:5] */
+ /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
AML_OFFSET(irq.flags),
@@ -90,9 +90,13 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
AML_OFFSET(irq.flags),
3},
- {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
AML_OFFSET(irq.flags),
- 4}
+ 4},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable),
+ AML_OFFSET(irq.flags),
+ 5}
};
/*******************************************************************************
@@ -101,7 +105,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
*
******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
+struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
/* Start with a default descriptor of length 3 */
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
@@ -114,7 +118,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
AML_OFFSET(irq.irq_mask),
ACPI_RS_OFFSET(data.irq.interrupt_count)},
- /* Set flags: Triggering[0], Polarity[3], sharing_and_wake[4:5] */
+ /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
AML_OFFSET(irq.flags),
@@ -124,10 +128,14 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
AML_OFFSET(irq.flags),
3},
- {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
AML_OFFSET(irq.flags),
4},
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable),
+ AML_OFFSET(irq.flags),
+ 5},
+
/*
* All done if the output descriptor length is required to be 3
* (i.e., optimization to 2 bytes cannot be attempted)
@@ -181,7 +189,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
*
******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
+struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = {
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
ACPI_RS_SIZE(struct acpi_resource_extended_irq),
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_irq)},
@@ -192,7 +200,7 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
/*
* Flags: Producer/Consumer[0], Triggering[1], Polarity[2],
- * sharing_and_wake[3:4]
+ * Sharing[3], Wake[4]
*/
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer),
AML_OFFSET(extended_irq.flags),
@@ -206,10 +214,14 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
AML_OFFSET(extended_irq.flags),
2},
- {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
AML_OFFSET(extended_irq.flags),
3},
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.wake_capable),
+ AML_OFFSET(extended_irq.flags),
+ 4},
+
/* IRQ Table length (Byte4) */
{ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count),
--git a/drivers/acpi/acpica/rsserial.c b/drivers/acpi/acpica/rsserial.c
index 9aa5e68..197bab0 100644
--- a/drivers/acpi/acpica/rsserial.c
+++ b/drivers/acpi/acpica/rsserial.c
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsserial")
* acpi_rs_convert_gpio
*
******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_convert_gpio[17] = {
+struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
ACPI_RS_SIZE(struct acpi_resource_gpio),
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_gpio)},
@@ -75,10 +75,14 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[17] = {
AML_OFFSET(gpio.flags),
0},
- {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
AML_OFFSET(gpio.int_flags),
3},
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.wake_capable),
+ AML_OFFSET(gpio.int_flags),
+ 4},
+
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.io_restriction),
AML_OFFSET(gpio.int_flags),
0},
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 17f2d05..b58c3cb 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -102,8 +102,11 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
#define ACPI_EXCLUSIVE (u8) 0x00
#define ACPI_SHARED (u8) 0x01
-#define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02
-#define ACPI_SHARED_AND_WAKE (u8) 0x03
+
+/* Wake */
+
+#define ACPI_NOT_WAKE_CAPABLE (u8) 0x00
+#define ACPI_WAKE_CAPABLE (u8) 0x01
/*
* DMA Attributes
@@ -171,6 +174,7 @@ struct acpi_resource_irq {
u8 triggering;
u8 polarity;
u8 sharable;
+ u8 wake_capable;
u8 interrupt_count;
u8 interrupts[1];
};
@@ -346,6 +350,7 @@ struct acpi_resource_extended_irq {
u8 triggering;
u8 polarity;
u8 sharable;
+ u8 wake_capable;
u8 interrupt_count;
struct acpi_resource_source resource_source;
u32 interrupts[1];
@@ -365,6 +370,7 @@ struct acpi_resource_gpio {
u8 producer_consumer; /* For values, see Producer/Consumer above */
u8 pin_config;
u8 sharable; /* For values, see Interrupt Attributes above */
+ u8 wake_capable; /* For values, see Interrupt Attributes above */
u8 io_restriction;
u8 triggering; /* For values, see Interrupt Attributes above */
u8 polarity; /* For values, see Interrupt Attributes above */
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 25/27] ACPICA: Interpreter: Fix Store() when implicit conversion is not possible.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (23 preceding siblings ...)
2012-12-31 0:07 ` [PATCH 24/27] ACPICA: Resources: Split interrupt share/wake bits into two fields Lv Zheng
@ 2012-12-31 0:11 ` Lv Zheng
2012-12-31 0:11 ` [PATCH 27/27] ACPICA: Update version to 20121220 Lv Zheng
2013-01-11 7:29 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Lv Zheng
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:11 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
For the cases such as a store of a string to an existing package
object, implement the store as a CopyObject().
This is a small departure from the ACPI specification which states
that the control method should be aborted in this case. However,
ASLTS suite depends on this behavior.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/exstore.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c
index 90431f1..4ff37e8 100644
--- a/drivers/acpi/acpica/exstore.c
+++ b/drivers/acpi/acpica/exstore.c
@@ -487,14 +487,33 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
default:
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
- "Storing %s (%p) directly into node (%p) with no implicit conversion\n",
+ "Storing [%s] (%p) directly into node [%s] (%p)"
+ " with no implicit conversion\n",
acpi_ut_get_object_type_name(source_desc),
- source_desc, node));
+ source_desc,
+ acpi_ut_get_object_type_name(target_desc),
+ node));
- /* No conversions for all other types. Just attach the source object */
+ /*
+ * No conversions for all other types. Directly store a copy of
+ * the source object. NOTE: This is a departure from the ACPI
+ * spec, which states "If conversion is impossible, abort the
+ * running control method".
+ *
+ * This code implements "If conversion is impossible, treat the
+ * Store operation as a CopyObject".
+ */
+ status =
+ acpi_ut_copy_iobject_to_iobject(source_desc, &new_desc,
+ walk_state);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
- status = acpi_ns_attach_object(node, source_desc,
- source_desc->common.type);
+ status =
+ acpi_ns_attach_object(node, new_desc,
+ new_desc->common.type);
+ acpi_ut_remove_reference(new_desc);
break;
}
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 27/27] ACPICA: Update version to 20121220.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (24 preceding siblings ...)
2012-12-31 0:11 ` [PATCH 25/27] ACPICA: Interpreter: Fix Store() when implicit conversion is not possible Lv Zheng
@ 2012-12-31 0:11 ` Lv Zheng
2013-01-11 7:29 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Lv Zheng
26 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2012-12-31 0:11 UTC (permalink / raw)
To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng
From: Bob Moore <robert.moore@intel.com>
Version 20121220.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/acpixf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index afacb5a..b86364d 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20121114
+#define ACPI_CA_VERSION 0x20121220
#include <acpi/acconfig.h>
#include <acpi/actypes.h>
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 0/3] ACPICA: Missing patches for 20121220 release.
2012-12-31 0:03 [PATCH 00/27] ACPICA 20121220 Release Lv Zheng
` (25 preceding siblings ...)
2012-12-31 0:11 ` [PATCH 27/27] ACPICA: Update version to 20121220 Lv Zheng
@ 2013-01-11 7:29 ` Lv Zheng
2013-01-11 7:29 ` [PATCH 2/3] ACPICA: Cleanup table handler naming conflicts Lv Zheng
` (2 more replies)
26 siblings, 3 replies; 33+ messages in thread
From: Lv Zheng @ 2013-01-11 7:29 UTC (permalink / raw)
To: Rafael J Wysocki, Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng
This patch set is based on the ACPICA 20121220 release currently can be
found in the linux-next branch of linux-pm tree.
This patch set has stayed in the acpica-201212 branch of the ACPICA
release test tree for one days.
The source code differences between Linux and ACPICA can be summarized as
follows:
1. 1963 Lines (70.0 Kbytes) before applying the patch set;
2. 1796 Lines (64.8 Kbytes) after applying the patch set.
Please review.
Bob Moore (1):
ACPICA: Source restructuring: split large files into 8 new files.
Lv Zheng (2):
ACPICA: Cleanup table handler naming conflicts.
ACPICA: Add new statistics interface.
drivers/acpi/acpica/Makefile | 8 +-
drivers/acpi/acpica/acdebug.h | 17 +
drivers/acpi/acpica/acevents.h | 21 +-
drivers/acpi/acpica/acglobal.h | 4 +-
drivers/acpi/acpica/acnamesp.h | 12 +
drivers/acpi/acpica/acparser.h | 23 +-
drivers/acpi/acpica/acresrc.h | 6 +-
drivers/acpi/acpica/acutils.h | 50 ++-
drivers/acpi/acpica/dsmethod.c | 1 +
drivers/acpi/acpica/evhandler.c | 529 ++++++++++++++++++++++++
drivers/acpi/acpica/evregion.c | 582 +++------------------------
drivers/acpi/acpica/evsci.c | 1 +
drivers/acpi/acpica/nspredef.c | 581 +-------------------------
drivers/acpi/acpica/nsprepkg.c | 621 ++++++++++++++++++++++++++++
drivers/acpi/acpica/psloop.c | 622 ----------------------------
drivers/acpi/acpica/psobject.c | 647 +++++++++++++++++++++++++++++
drivers/acpi/acpica/psopcode.c | 172 --------
drivers/acpi/acpica/psopinfo.c | 223 ++++++++++
drivers/acpi/acpica/rsdump.c | 409 +------------------
drivers/acpi/acpica/rsdumpinfo.c | 454 +++++++++++++++++++++
drivers/acpi/acpica/tbxface.c | 4 +-
drivers/acpi/acpica/utglobal.c | 11 +
drivers/acpi/acpica/utmisc.c | 828 ++++----------------------------------
drivers/acpi/acpica/utownerid.c | 218 ++++++++++
drivers/acpi/acpica/utstring.c | 574 ++++++++++++++++++++++++++
drivers/acpi/acpica/utxface.c | 38 ++
drivers/acpi/numa.c | 2 +-
drivers/acpi/tables.c | 6 +-
include/acpi/acconfig.h | 1 +
include/acpi/acpixf.h | 6 +-
include/acpi/actypes.h | 12 +-
include/linux/acpi.h | 15 +-
32 files changed, 3580 insertions(+), 3118 deletions(-)
create mode 100644 drivers/acpi/acpica/evhandler.c
create mode 100644 drivers/acpi/acpica/nsprepkg.c
create mode 100644 drivers/acpi/acpica/psobject.c
create mode 100644 drivers/acpi/acpica/psopinfo.c
create mode 100644 drivers/acpi/acpica/rsdumpinfo.c
create mode 100644 drivers/acpi/acpica/utownerid.c
create mode 100644 drivers/acpi/acpica/utstring.c
--
1.7.10
^ permalink raw reply [flat|nested] 33+ messages in thread* [PATCH 2/3] ACPICA: Cleanup table handler naming conflicts.
2013-01-11 7:29 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Lv Zheng
@ 2013-01-11 7:29 ` Lv Zheng
2013-01-11 7:30 ` [PATCH 3/3] ACPICA: Add new statistics interface Lv Zheng
2013-01-11 12:20 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Rafael J. Wysocki
2 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2013-01-11 7:29 UTC (permalink / raw)
To: Rafael J Wysocki, Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng
This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.
This patch does not affect the generation of the Linux binary.
This patch decreases 44 lines of 20121114 divergence.diff.
There are naming conflicts between Linux and ACPICA on table handlers. This
patch cleans up this conflicts to reduce the source code diff between Linux
and ACPICA.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
None
---
Divergences fixing result:
Before applying: 1963 Lines, 70.0 Kbytes
After applying: 1919 Lines, 68.3 Kbytes
---
drivers/acpi/acpica/acglobal.h | 2 +-
drivers/acpi/acpica/tbxface.c | 4 ++--
drivers/acpi/numa.c | 2 +-
drivers/acpi/tables.c | 6 +++---
include/acpi/acpixf.h | 4 ++--
include/acpi/actypes.h | 2 +-
include/linux/acpi.h | 15 ++++++++++-----
7 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 864806e..585d364 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -252,7 +252,7 @@ ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache;
ACPI_EXTERN struct acpi_global_notify_handler acpi_gbl_global_notify[2];
ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
-ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler;
+ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler;
ACPI_EXTERN void *acpi_gbl_table_handler_context;
ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler;
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index d102fe7..2115f22 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -436,7 +436,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_by_index)
*
******************************************************************************/
acpi_status
-acpi_install_table_handler(acpi_tbl_handler handler, void *context)
+acpi_install_table_handler(acpi_table_handler handler, void *context)
{
acpi_status status;
@@ -482,7 +482,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_table_handler)
* DESCRIPTION: Remove table event handler
*
******************************************************************************/
-acpi_status acpi_remove_table_handler(acpi_tbl_handler handler)
+acpi_status acpi_remove_table_handler(acpi_table_handler handler)
{
acpi_status status;
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index cb31298..5ddbc65 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -273,7 +273,7 @@ static int __init acpi_parse_srat(struct acpi_table_header *table)
static int __init
acpi_table_parse_srat(enum acpi_srat_type id,
- acpi_table_entry_handler handler, unsigned int max_entries)
+ acpi_tbl_entry_handler handler, unsigned int max_entries)
{
return acpi_table_parse_entries(ACPI_SIG_SRAT,
sizeof(struct acpi_table_srat), id,
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 2572d97..d67a1fe 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -204,7 +204,7 @@ int __init
acpi_table_parse_entries(char *id,
unsigned long table_size,
int entry_id,
- acpi_table_entry_handler handler,
+ acpi_tbl_entry_handler handler,
unsigned int max_entries)
{
struct acpi_table_header *table_header = NULL;
@@ -269,7 +269,7 @@ err:
int __init
acpi_table_parse_madt(enum acpi_madt_type id,
- acpi_table_entry_handler handler, unsigned int max_entries)
+ acpi_tbl_entry_handler handler, unsigned int max_entries)
{
return acpi_table_parse_entries(ACPI_SIG_MADT,
sizeof(struct acpi_table_madt), id,
@@ -285,7 +285,7 @@ acpi_table_parse_madt(enum acpi_madt_type id,
* Scan the ACPI System Descriptor Table (STD) for a table matching @id,
* run @handler on it. Return 0 if table found, return on if not.
*/
-int __init acpi_table_parse(char *id, acpi_table_handler handler)
+int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
{
struct acpi_table_header *table = NULL;
acpi_size tbl_size;
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index b86364d..d8b2ea6 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -197,9 +197,9 @@ acpi_status
acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table);
acpi_status
-acpi_install_table_handler(acpi_tbl_handler handler, void *context);
+acpi_install_table_handler(acpi_table_handler handler, void *context);
-acpi_status acpi_remove_table_handler(acpi_tbl_handler handler);
+acpi_status acpi_remove_table_handler(acpi_table_handler handler);
/*
* Namespace and name interfaces
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index cd89810..3d4e09c 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -984,7 +984,7 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status,
/* Table Event handler (Load, load_table, etc.) and types */
typedef
-acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context);
+acpi_status(*acpi_table_handler) (u32 event, void *table, void *context);
#define ACPI_TABLE_LOAD 0x0
#define ACPI_TABLE_UNLOAD 0x1
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 8c1d6f2..1e33ea0 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -74,9 +74,10 @@ enum acpi_address_range_id {
/* Table Handlers */
-typedef int (*acpi_table_handler) (struct acpi_table_header *table);
+typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);
-typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
+typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header,
+ const unsigned long end);
#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
void acpi_initrd_override(void *data, size_t size);
@@ -95,10 +96,14 @@ int acpi_mps_check (void);
int acpi_numa_init (void);
int acpi_table_init (void);
-int acpi_table_parse (char *id, acpi_table_handler handler);
+int acpi_table_parse(char *id, acpi_tbl_table_handler handler);
int __init acpi_table_parse_entries(char *id, unsigned long table_size,
- int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
-int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
+ int entry_id,
+ acpi_tbl_entry_handler handler,
+ unsigned int max_entries);
+int acpi_table_parse_madt(enum acpi_madt_type id,
+ acpi_tbl_entry_handler handler,
+ unsigned int max_entries);
int acpi_parse_mcfg (struct acpi_table_header *header);
void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH 3/3] ACPICA: Add new statistics interface.
2013-01-11 7:29 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Lv Zheng
2013-01-11 7:29 ` [PATCH 2/3] ACPICA: Cleanup table handler naming conflicts Lv Zheng
@ 2013-01-11 7:30 ` Lv Zheng
2013-01-11 12:20 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Rafael J. Wysocki
2 siblings, 0 replies; 33+ messages in thread
From: Lv Zheng @ 2013-01-11 7:30 UTC (permalink / raw)
To: Rafael J Wysocki, Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng
This patch decreases 123 lines of 20121114 divergence.diff.
This patch ports new counters and statistics interface to Linux as such
enhancement has already been implemented in ACPICA. This patch can also
reduce the source code differences between Linux and ACPICA.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Divergences fixing result:
Before applying: 1919 Lines, 68.3 Kbytes
After applying: 1796 Lines, 64.3 Kbytes
---
drivers/acpi/acpica/acglobal.h | 2 ++
drivers/acpi/acpica/dsmethod.c | 1 +
drivers/acpi/acpica/evsci.c | 1 +
drivers/acpi/acpica/utglobal.c | 11 +++++++++++
drivers/acpi/acpica/utxface.c | 38 ++++++++++++++++++++++++++++++++++++++
include/acpi/acpixf.h | 2 ++
include/acpi/actypes.h | 10 ++++++++++
7 files changed, 65 insertions(+)
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 585d364..e7ebb0b 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -393,7 +393,9 @@ extern u32 acpi_gbl_nesting_level;
/* Event counters */
+ACPI_EXTERN u32 acpi_method_count;
ACPI_EXTERN u32 acpi_gpe_count;
+ACPI_EXTERN u32 acpi_sci_count;
ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS];
/* Support for dynamic control method tracing mechanism */
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 4e5873a..7fed60c 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -292,6 +292,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
* reentered one more time (even if it is the same thread)
*/
obj_desc->method.thread_count++;
+ acpi_method_count++;
return_ACPI_STATUS(status);
cleanup:
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index 6c90f15..2f93ac5 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -89,6 +89,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
*/
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
+ acpi_sci_count++;
return_VALUE(interrupt_handled);
}
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 7b4dd21..82caa42 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -289,6 +289,16 @@ acpi_status acpi_ut_init_globals(void)
acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
+ /* Event counters */
+
+ acpi_method_count = 0;
+ acpi_sci_count = 0;
+ acpi_gpe_count = 0;
+
+ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
+ acpi_fixed_event_count[i] = 0;
+ }
+
#if (!ACPI_REDUCED_HARDWARE)
/* GPE support */
@@ -378,4 +388,5 @@ acpi_status acpi_ut_init_globals(void)
ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
ACPI_EXPORT_SYMBOL(acpi_dbg_level)
ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
+ ACPI_EXPORT_SYMBOL(acpi_gpe_count)
ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index cb85a7b..f1f0bb5 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -207,6 +207,44 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
ACPI_EXPORT_SYMBOL(acpi_get_system_info)
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_get_statistics
+ *
+ * PARAMETERS: stats - Where the statistics are returned
+ *
+ * RETURN: status - the status of the call
+ *
+ * DESCRIPTION: Get the contents of the various system counters
+ *
+ ******************************************************************************/
+acpi_status acpi_get_statistics(struct acpi_statistics *stats)
+{
+ ACPI_FUNCTION_TRACE(acpi_get_statistics);
+
+ /* Parameter validation */
+
+ if (!stats) {
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
+
+ /* Various interrupt-based event counters */
+
+ stats->sci_count = acpi_sci_count;
+ stats->gpe_count = acpi_gpe_count;
+
+ ACPI_MEMCPY(stats->fixed_event_count, acpi_fixed_event_count,
+ sizeof(acpi_fixed_event_count));
+
+ /* Other counters */
+
+ stats->method_count = acpi_method_count;
+
+ return_ACPI_STATUS(AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_get_statistics)
+
/*****************************************************************************
*
* FUNCTION: acpi_install_initialization_handler
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index d8b2ea6..110bc23 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -137,6 +137,8 @@ acpi_status acpi_subsystem_status(void);
acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
#endif
+acpi_status acpi_get_statistics(struct acpi_statistics *stats);
+
const char *acpi_format_exception(acpi_status exception);
acpi_status acpi_purge_cached_objects(void);
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 3d4e09c..46e6624 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -933,6 +933,16 @@ struct acpi_system_info {
u32 debug_layer;
};
+/*
+ * System statistics returned by acpi_get_statistics()
+ */
+struct acpi_statistics {
+ u32 sci_count;
+ u32 gpe_count;
+ u32 fixed_event_count[ACPI_NUM_FIXED_EVENTS];
+ u32 method_count;
+};
+
/* Table Event Types */
#define ACPI_TABLE_EVENT_LOAD 0x0
--
1.7.10
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [PATCH 0/3] ACPICA: Missing patches for 20121220 release.
2013-01-11 7:29 ` [PATCH 0/3] ACPICA: Missing patches for 20121220 release Lv Zheng
2013-01-11 7:29 ` [PATCH 2/3] ACPICA: Cleanup table handler naming conflicts Lv Zheng
2013-01-11 7:30 ` [PATCH 3/3] ACPICA: Add new statistics interface Lv Zheng
@ 2013-01-11 12:20 ` Rafael J. Wysocki
2 siblings, 0 replies; 33+ messages in thread
From: Rafael J. Wysocki @ 2013-01-11 12:20 UTC (permalink / raw)
To: Lv Zheng; +Cc: linux-acpi, Len Brown, Moore, Robert
On Saturday, January 12, 2013 11:28:50 PM Lv Zheng wrote:
> This patch set is based on the ACPICA 20121220 release currently can be
> found in the linux-next branch of linux-pm tree.
> This patch set has stayed in the acpica-201212 branch of the ACPICA
> release test tree for one days.
> The source code differences between Linux and ACPICA can be summarized as
> follows:
> 1. 1963 Lines (70.0 Kbytes) before applying the patch set;
> 2. 1796 Lines (64.8 Kbytes) after applying the patch set.
>
> Please review.
>
> Bob Moore (1):
> ACPICA: Source restructuring: split large files into 8 new files.
>
> Lv Zheng (2):
> ACPICA: Cleanup table handler naming conflicts.
> ACPICA: Add new statistics interface.
OK, applied.
I took [1/3] directly from my mailbox, because it looks like vger didn't allow
it to go to the list.
Please check the ACPICA material in the linux-next branch of my tree and if
there's anything more you'd like to go into v3.9, please let me know.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 33+ messages in thread