Skip to contentSkip to conversation

ACPICA 20130214 Release

PATCH In review Lv Zheng 2 participants 23 messages Mar 8, 2013 – Mar 26, 2013

Subsystems (2)
lore
Share & tools
lore

Lv Zheng

author
#0 lore raw

cover ACPICA 20130214 Release

The 20130214 ACPICA linuxized patches are based on the pm/linux-next branch.
The patch set has passed a basic build/boot test on z530. No new divergences are introduced by this patch set.

Bob Moore (14):
ACPICA: Resource Mgr: Prevent infinite loops in resource walks
ACPICA: Fix a couple warnings detected on FreeBSD build
ACPICA: Update error/debug messages for fixed events
ACPICA: Add parens within macros around parameter names
ACPICA: Update for ACPI 5 hardware-reduced feature
ACPICA: Regression fix: reinstate safe exit macros
ACPICA: Add macros to exception code definitions
ACPICA: Add exception descriptions to exception info table
ACPICA: Remove trailing comma in enum declarations
ACPICA: Add mechanism for early object repairs on a per-name basis
ACPICA: Split object conversion functions to a new file
ACPICA: Disassembler: Add warnings for unresolved control methods
ACPICA: Object repair: Allow 0-length packages for variable-length
packages
ACPICA: Update version to 20130214

Jung-uk Kim (2):
ACPICA: Fix a long-standing bug in local cache
ACPICA: Add macros to access pointer to next object in the descriptor
list

Lv Zheng (5):
ACPICA: Update RASF table definition
ACPICA: iASL/Disassembler: Add support for VRTC table
ACPICA: iASL/Disassembler: Add support for MTMR table
ACPICA: Return object repair: Add string-to-unicode conversion
ACPICA: Return object repair: Add resource template repairs

 drivers/acpi/acpica/Makefile    |    1 +
 drivers/acpi/acpica/acglobal.h  |    4 +-
 drivers/acpi/acpica/aclocal.h   |   16 ++
 drivers/acpi/acpica/acmacros.h  |    6 +-
 drivers/acpi/acpica/acnamesp.h  |   25 ++-
 drivers/acpi/acpica/acutils.h   |    3 +-
 drivers/acpi/acpica/dsutils.c   |   10 +-
 drivers/acpi/acpica/evevent.c   |   12 +-
 drivers/acpi/acpica/evgpe.c     |    6 +-
 drivers/acpi/acpica/evsci.c     |    4 +-
 drivers/acpi/acpica/evxface.c   |   21 +-
 drivers/acpi/acpica/evxfevnt.c  |   12 +
 drivers/acpi/acpica/exprep.c    |    4 +-
 drivers/acpi/acpica/exutils.c   |    4 +-
 drivers/acpi/acpica/hwacpi.c    |   20 +-
 drivers/acpi/acpica/nsconvert.c |  443 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nspredef.c  |  141 ++++++------
 drivers/acpi/acpica/nsprepkg.c  |   10 +-
 drivers/acpi/acpica/nsrepair.c  |  381 ++++++++++++--------------------
 drivers/acpi/acpica/nsrepair2.c |   16 +-
 drivers/acpi/acpica/nsutils.c   |    8 +-
 drivers/acpi/acpica/psargs.c    |    2 +-
 drivers/acpi/acpica/rscalc.c    |    6 +
 drivers/acpi/acpica/rsdump.c    |    8 +
 drivers/acpi/acpica/rslist.c    |    8 +
 drivers/acpi/acpica/rsxface.c   |    8 +-
 drivers/acpi/acpica/utaddress.c |    4 +-
 drivers/acpi/acpica/utcache.c   |   18 +-
 drivers/acpi/acpica/utexcep.c   |   26 ++-
 drivers/acpi/acpica/utglobal.c  |    2 +
 include/acpi/acexcep.h          |  461 +++++++++++++++++++++++----------------
 include/acpi/acoutput.h         |   53 ++++-
 include/acpi/acpixf.h           |    2 +-
 include/acpi/actbl2.h           |   47 ++++
 include/acpi/actbl3.h           |   55 ++++-
 include/acpi/actypes.h          |    1 -
 36 files changed, 1231 insertions(+), 617 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsconvert.c
Signature · 1 line
1.7.10
author
#1 lore raw

PATCH 1/21 ACPICA: Resource Mgr: Prevent infinite loops in resource walks

From: Bob Moore <[email protected]>

Add checks for zero-length resource descriptors in all code that loops through a resource descriptor list. This prevents possible infinite loops because the length is used to increment the traveral pointer and detect the end-of-descriptor.

---
 drivers/acpi/acpica/rscalc.c  |    6 ++++++
 drivers/acpi/acpica/rsdump.c  |    8 ++++++++
 drivers/acpi/acpica/rslist.c  |    8 ++++++++
 drivers/acpi/acpica/rsxface.c |    8 +++++++-
 4 files changed, 29 insertions(+), 1 deletion(-)
drivers/acpi/acpica/rscalc.c +6 -0
index 7816d4ee..72077fa 100644
@@ -202,6 +202,12 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
 			return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
 		}
 
+		/* Sanity check the length. It must not be zero, or we loop forever */
+
+		if (!resource->length) {
+			return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
+		}
+
 		/* Get the base size of the (external stream) resource descriptor */
 
 		total_size = acpi_gbl_aml_resource_sizes[resource->type];
drivers/acpi/acpica/rsdump.c +8 -0
index cab5144..b5fc0db 100644
@@ -385,6 +385,14 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
 			return;
 		}
 
+		/* Sanity check the length. It must not be zero, or we loop forever */
+
+		if (!resource_list->length) {
+			acpi_os_printf
+			    ("Invalid zero length descriptor in resource list\n");
+			return;
+		}
+
 		/* Dump the resource descriptor */
 
 		if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
drivers/acpi/acpica/rslist.c +8 -0
index ee2e206..6053aa1 100644
@@ -178,6 +178,14 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
 			return_ACPI_STATUS(AE_BAD_DATA);
 		}
 
+		/* Sanity check the length. It must not be zero, or we loop forever */
+
+		if (!resource->length) {
+			ACPI_ERROR((AE_INFO,
+				    "Invalid zero length descriptor in resource list\n"));
+			return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
+		}
+
 		/* Perform the conversion */
 
 		if (resource->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
drivers/acpi/acpica/rsxface.c +7 -1
index 15d6eae..c0e5d2d 100644
@@ -563,13 +563,19 @@ acpi_walk_resource_buffer(struct acpi_buffer * buffer,
 
 	while (resource < resource_end) {
 
-		/* Sanity check the resource */
+		/* Sanity check the resource type */
 
 		if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
 			status = AE_AML_INVALID_RESOURCE_TYPE;
 			break;
 		}
 
+		/* Sanity check the length. It must not be zero, or we loop forever */
+
+		if (!resource->length) {
+			return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
+		}
+
 		/* Invoke the user function, abort on any error returned */
 
 		status = user_function(resource, context);
Signature · 1 line
1.7.10
author
#2 lore raw

PATCH 2/21 ACPICA: Fix a couple warnings detected on FreeBSD build

In reply to Lv Zheng

From: Jung-uk Kim <[email protected]>

This fixes a global and a pointer cast. Jung-uk Kim.

---
 drivers/acpi/acpica/acglobal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/acglobal.h +1 -1
index ecb4992..feaa5d5 100644
@@ -413,7 +413,7 @@ ACPI_EXTERN u8 acpi_gbl_db_output_flags;
 
 #ifdef ACPI_DISASSEMBLER
 
-u8 ACPI_INIT_GLOBAL(acpi_gbl_ignore_noop_operator, FALSE);
+ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_ignore_noop_operator, FALSE);
 
 ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
 ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
Signature · 1 line
1.7.10
author
#3 lore raw

PATCH 3/21 ACPICA: Update RASF table definition

In reply to Lv Zheng

Update to reflect final ACPI 5.0 changes. Lv Zheng.

---
 include/acpi/actbl3.h |   51 ++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 42 insertions(+), 9 deletions(-)
include/acpi/actbl3.h +42 -9
index 332b17e..9f27890 100644
@@ -505,26 +505,59 @@ struct acpi_rasf_shared_memory {
 	u32 signature;
 	u16 command;
 	u16 status;
-	u64 requested_address;
-	u64 requested_length;
-	u64 actual_address;
-	u64 actual_length;
+	u16 version;
+	u8 capabilities[16];
+	u8 set_capabilities[16];
+	u16 num_parameter_blocks;
+	u32 set_capabilities_status;
+};
+
+/* RASF Parameter Block Structure Header */
+
+struct acpi_rasf_parameter_block {
+	u16 type;
+	u16 version;
+	u16 length;
+};
+
+/* RASF Parameter Block Structure for PATROL_SCRUB */
+
+struct acpi_rasf_patrol_scrub_parameter {
+	struct acpi_rasf_parameter_block header;
+	u16 patrol_scrub_command;
+	u64 requested_address_range[2];
+	u64 actual_address_range[2];
 	u16 flags;
-	u8 speed;
+	u8 requested_speed;
 };
 
 /* Masks for Flags and Speed fields above */
 
 #define ACPI_RASF_SCRUBBER_RUNNING      1
 #define ACPI_RASF_SPEED                 (7<<1)
+#define ACPI_RASF_SPEED_SLOW            (0<<1)
+#define ACPI_RASF_SPEED_MEDIUM          (4<<1)
+#define ACPI_RASF_SPEED_FAST            (7<<1)
 
 /* Channel Commands */
 
 enum acpi_rasf_commands {
-	ACPI_RASF_GET_RAS_CAPABILITIES = 1,
-	ACPI_RASF_GET_PATROL_PARAMETERS = 2,
-	ACPI_RASF_START_PATROL_SCRUBBER = 3,
-	ACPI_RASF_STOP_PATROL_SCRUBBER = 4
+	ACPI_RASF_EXECUTE_RASF_COMMAND = 1
+};
+
+/* Platform RAS Capabilities */
+
+enum acpi_rasf_capabiliities {
+	ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
+	ACPI_SW_PATROL_SCRUB_EXPOSED = 1
+};
+
+/* Patrol Scrub Commands */
+
+enum acpi_rasf_patrol_scrub_commands {
+	ACPI_RASF_GET_PATROL_PARAMETERS = 1,
+	ACPI_RASF_START_PATROL_SCRUBBER = 2,
+	ACPI_RASF_STOP_PATROL_SCRUBBER = 3
 };
 
 /* Channel Command flags */
Signature · 1 line
1.7.10
author
#4 lore raw

PATCH 4/21 ACPICA: iASL/Disassembler: Add support for VRTC table

In reply to Lv Zheng

VRTC is used in Intel MID platforms as a replacement of the traditional x86 RTC. VRTC table can be found in the recent ACPI BIOS enabled Intel MID platforms. The format of this table has been defined in the "Simple Firmware Interface Specification" except it uses GAS instead of 64-bit values for address fields. This patch introduces VRTC table support into ACPICA. Lv Zheng.

---
 include/acpi/actbl2.h |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
include/acpi/actbl2.h +23 -0
index 77dc7a4..3f1b0a4 100644
@@ -77,6 +77,7 @@
 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
 #define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
 #define ACPI_SIG_UEFI           "UEFI"	/* Uefi Boot Optimization Table */
+#define ACPI_SIG_VRTC           "VRTC"	/* Virtual Real Time Clock Table */
 #define ACPI_SIG_WAET           "WAET"	/* Windows ACPI Emulated devices Table */
 #define ACPI_SIG_WDAT           "WDAT"	/* Watchdog Action Table */
 #define ACPI_SIG_WDDT           "WDDT"	/* Watchdog Timer Description Table */
@@ -1025,6 +1026,28 @@ struct acpi_table_uefi {
 
 /*******************************************************************************
  *
+ * VRTC - Virtual Real Time Clock Table
+ *        Version 1
+ *
+ * Conforms to "Simple Firmware Interface Specification",
+ * Draft 0.8.2, Oct 19, 2010
+ * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
+ *
+ ******************************************************************************/
+
+struct acpi_table_vrtc {
+	struct acpi_table_header header;	/* Common ACPI table header */
+};
+
+/* VRTC entry */
+
+struct acpi_vrtc_entry {
+	struct acpi_generic_address physical_address;
+	u32 irq;
+};
+
+/*******************************************************************************
+ *
  * WAET - Windows ACPI Emulated devices Table
  *        Version 1
  *
Signature · 1 line
1.7.10
author
#5 lore raw

PATCH 5/21 ACPICA: iASL/Disassembler: Add support for MTMR table

In reply to Lv Zheng

MTMR table is used in the recent ACPI BIOS enabled Intel MID platforms. The format of this table has been defined in the "Simple Firmware Interface Specification" except it uses GAS instead of 64-bit values for address fields. This patch introduces MTMR table support into ACPICA. Lv Zheng.

---
 include/acpi/actbl2.h |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
include/acpi/actbl2.h +24 -0
index 3f1b0a4..ffaac0e 100644
@@ -72,6 +72,7 @@
 #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
 #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
+#define ACPI_SIG_MTMR           "MTMR"	/* MID Timer table */
 #define ACPI_SIG_SLIC           "SLIC"	/* Software Licensing Description Table */
 #define ACPI_SIG_SPCR           "SPCR"	/* Serial Port Console Redirection table */
 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
@@ -853,6 +854,29 @@ struct acpi_table_mchi {
 
 /*******************************************************************************
  *
+ * MTMR - MID Timer Table
+ *        Version 1
+ *
+ * Conforms to "Simple Firmware Interface Specification",
+ * Draft 0.8.2, Oct 19, 2010
+ * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
+ *
+ ******************************************************************************/
+
+struct acpi_table_mtmr {
+	struct acpi_table_header header;	/* Common ACPI table header */
+};
+
+/* MTMR entry */
+
+struct acpi_mtmr_entry {
+	struct acpi_generic_address physical_address;
+	u32 frequency;
+	u32 irq;
+};
+
+/*******************************************************************************
+ *
  * SLIC - Software Licensing Description Table
  *        Version 1
  *
Signature · 1 line
1.7.10
author
#6 lore raw

PATCH 6/21 ACPICA: Fix a long-standing bug in local cache

In reply to Lv Zheng

From: Jung-uk Kim <[email protected]>

Since 20060317, the pointer to next object is the first element in its common header. Remove bogus LinkOffset from ACPI_MEMORY_LIST and directly use NextObject.

---
 drivers/acpi/acpica/utcache.c |   20 +++++++-------------
 include/acpi/actypes.h        |    1 -
 2 files changed, 7 insertions(+), 14 deletions(-)
drivers/acpi/acpica/utcache.c +7 -13
index e0e8579..2de22fb 100644
@@ -85,7 +85,6 @@ acpi_os_create_cache(char *cache_name,
 	/* Populate the cache object and return it */
 
 	ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list));
-	cache->link_offset = 8;
 	cache->list_name = cache_name;
 	cache->object_size = object_size;
 	cache->max_depth = max_depth;
@@ -108,7 +107,7 @@ acpi_os_create_cache(char *cache_name,
 
 acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
 {
-	char *next;
+	void *next;
 	acpi_status status;
 
 	ACPI_FUNCTION_ENTRY();
@@ -128,10 +127,9 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
 
 		/* Delete and unlink one cached state object */
 
-		next = *(ACPI_CAST_INDIRECT_PTR(char,
-						&(((char *)cache->
-						   list_head)[cache->
-							      link_offset])));
+		next =
+		    ((struct acpi_object_common *)cache->list_head)->
+		    next_object;
 		ACPI_FREE(cache->list_head);
 
 		cache->list_head = next;
@@ -221,9 +219,7 @@ acpi_os_release_object(struct acpi_memory_list * cache, void *object)
 
 		/* Put the object at the head of the cache list */
 
-		*(ACPI_CAST_INDIRECT_PTR(char,
-					 &(((char *)object)[cache->
-							    link_offset]))) =
+		((struct acpi_object_common *)object)->next_object =
 		    cache->list_head;
 		cache->list_head = object;
 		cache->current_depth++;
@@ -272,10 +268,8 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
 		/* There is an object available, use it */
 
 		object = cache->list_head;
-		cache->list_head = *(ACPI_CAST_INDIRECT_PTR(char,
-							    &(((char *)
-							       object)[cache->
-								       link_offset])));
+		cache->list_head =
+		    ((struct acpi_object_common *)object)->next_object;
 
 		cache->current_depth--;
 
include/acpi/actypes.h +0 -1
index 845e75f..3fac1be 100644
@@ -1128,7 +1128,6 @@ struct acpi_memory_list {
 	u16 object_size;
 	u16 max_depth;
 	u16 current_depth;
-	u16 link_offset;
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 
Signature · 1 line
1.7.10
author
#8 lore raw

PATCH 8/21 ACPICA: Add macros to access pointer to next object in the descriptor list

In reply to Lv Zheng

From: Jung-uk Kim <[email protected]>

---
 drivers/acpi/acpica/acmacros.h |    4 +++-
 drivers/acpi/acpica/utcache.c  |   10 +++-------
 2 files changed, 6 insertions(+), 8 deletions(-)
drivers/acpi/acpica/acmacros.h +3 -1
index ed7943b..8b7ca40 100644
@@ -322,8 +322,10 @@
  * where a pointer to an object of type union acpi_operand_object can also
  * appear. This macro is used to distinguish them.
  *
- * The "Descriptor" field is the first field in both structures.
+ * The "DescriptorType" field is the second field in both structures.
  */
+#define ACPI_GET_DESCRIPTOR_PTR(d)      (((union acpi_descriptor *)(void *)(d))->common.common_pointer)
+#define ACPI_SET_DESCRIPTOR_PTR(d, o)   (((union acpi_descriptor *)(void *)(d))->common.common_pointer = o)
 #define ACPI_GET_DESCRIPTOR_TYPE(d)     (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
 #define ACPI_SET_DESCRIPTOR_TYPE(d, t)  (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t)
 
drivers/acpi/acpica/utcache.c +3 -7
index 2de22fb..a877a96 100644
@@ -127,9 +127,7 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
 
 		/* Delete and unlink one cached state object */
 
-		next =
-		    ((struct acpi_object_common *)cache->list_head)->
-		    next_object;
+		next = ACPI_GET_DESCRIPTOR_PTR(cache->list_head);
 		ACPI_FREE(cache->list_head);
 
 		cache->list_head = next;
@@ -219,8 +217,7 @@ acpi_os_release_object(struct acpi_memory_list * cache, void *object)
 
 		/* Put the object at the head of the cache list */
 
-		((struct acpi_object_common *)object)->next_object =
-		    cache->list_head;
+		ACPI_SET_DESCRIPTOR_PTR(object, cache->list_head);
 		cache->list_head = object;
 		cache->current_depth++;
 
@@ -268,8 +265,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
 		/* There is an object available, use it */
 
 		object = cache->list_head;
-		cache->list_head =
-		    ((struct acpi_object_common *)object)->next_object;
+		cache->list_head = ACPI_GET_DESCRIPTOR_PTR(object);
 
 		cache->current_depth--;
 
Signature · 1 line
1.7.10
author
#7 lore raw

PATCH 7/21 ACPICA: Update error/debug messages for fixed events

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Add the actual fixed event name to all messages for clarity.

---
 drivers/acpi/acpica/evevent.c |   12 +++++++-----
 drivers/acpi/acpica/evxface.c |   21 ++++++++++++---------
 2 files changed, 19 insertions(+), 14 deletions(-)
drivers/acpi/acpica/evevent.c +7 -5
index b8ea0b2..02219ff 100644
@@ -257,6 +257,8 @@ u32 acpi_ev_fixed_event_detect(void)
  *
  * DESCRIPTION: Clears the status bit for the requested event, calls the
  *              handler that previously registered for the event.
+ *              NOTE: If there is no handler for the event, the event is
+ *              disabled to prevent futher interrupts.
  *
  ******************************************************************************/
 
@@ -271,17 +273,17 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
 				      status_register_id, ACPI_CLEAR_STATUS);
 
 	/*
-	 * Make sure we've got a handler. If not, report an error. The event is
-	 * disabled to prevent further interrupts.
+	 * Make sure that a handler exists. If not, report an error
+	 * and disable the event to prevent further interrupts.
 	 */
-	if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
+	if (!acpi_gbl_fixed_event_handlers[event].handler) {
 		(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
 					      enable_register_id,
 					      ACPI_DISABLE_EVENT);
 
 		ACPI_ERROR((AE_INFO,
-			    "No installed handler for fixed event [0x%08X]",
-			    event));
+			    "No installed handler for fixed event - %s (%u), disabling",
+			    acpi_ut_get_event_name(event), event));
 
 		return (ACPI_INTERRUPT_NOT_HANDLED);
 	}
drivers/acpi/acpica/evxface.c +12 -9
index ddffd68..ca5fba9 100644
@@ -467,9 +467,9 @@ acpi_install_fixed_event_handler(u32 event,
 		return_ACPI_STATUS(status);
 	}
 
-	/* Don't allow two handlers. */
+	/* Do not allow multiple handlers */
 
-	if (NULL != acpi_gbl_fixed_event_handlers[event].handler) {
+	if (acpi_gbl_fixed_event_handlers[event].handler) {
 		status = AE_ALREADY_EXISTS;
 		goto cleanup;
 	}
@@ -483,8 +483,9 @@ acpi_install_fixed_event_handler(u32 event,
 	if (ACPI_SUCCESS(status))
 		status = acpi_enable_event(event, 0);
 	if (ACPI_FAILURE(status)) {
-		ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X",
-			      event));
+		ACPI_WARNING((AE_INFO,
+			      "Could not enable fixed event - %s (%u)",
+			      acpi_ut_get_event_name(event), event));
 
 		/* Remove the handler */
 
@@ -492,7 +493,8 @@ acpi_install_fixed_event_handler(u32 event,
 		acpi_gbl_fixed_event_handlers[event].context = NULL;
 	} else {
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Enabled fixed event %X, Handler=%p\n", event,
+				  "Enabled fixed event %s (%X), Handler=%p\n",
+				  acpi_ut_get_event_name(event), event,
 				  handler));
 	}
 
@@ -544,11 +546,12 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
 
 	if (ACPI_FAILURE(status)) {
 		ACPI_WARNING((AE_INFO,
-			      "Could not write to fixed event enable register 0x%X",
-			      event));
+			      "Could not disable fixed event - %s (%u)",
+			      acpi_ut_get_event_name(event), event));
 	} else {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
-				  event));
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+				  "Disabled fixed event - %s (%X)\n",
+				  acpi_ut_get_event_name(event), event));
 	}
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
Signature · 1 line
1.7.10
author
#9 lore raw

PATCH 9/21 ACPICA: Add parens within macros around parameter names

In reply to Lv Zheng

From: Bob Moore <[email protected]>

---
 drivers/acpi/acpica/acmacros.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/acmacros.h +2 -2
index 8b7ca40..53666bd 100644
@@ -325,9 +325,9 @@
  * The "DescriptorType" field is the second field in both structures.
  */
 #define ACPI_GET_DESCRIPTOR_PTR(d)      (((union acpi_descriptor *)(void *)(d))->common.common_pointer)
-#define ACPI_SET_DESCRIPTOR_PTR(d, o)   (((union acpi_descriptor *)(void *)(d))->common.common_pointer = o)
+#define ACPI_SET_DESCRIPTOR_PTR(d, p)   (((union acpi_descriptor *)(void *)(d))->common.common_pointer = (p))
 #define ACPI_GET_DESCRIPTOR_TYPE(d)     (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
-#define ACPI_SET_DESCRIPTOR_TYPE(d, t)  (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t)
+#define ACPI_SET_DESCRIPTOR_TYPE(d, t)  (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = (t))
 
 /*
  * Macros for the master AML opcode table
Signature · 1 line
1.7.10
author
#10 lore raw

PATCH 10/21 ACPICA: Update for ACPI 5 hardware-reduced feature

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Ensure that AcpiEnable and AcpiDisable work properly when the hardware-reduced flag is set in the FADT.

---
 drivers/acpi/acpica/evxfevnt.c |   12 ++++++++++++
 drivers/acpi/acpica/hwacpi.c   |   12 ++++++++++++
 2 files changed, 24 insertions(+)
drivers/acpi/acpica/evxfevnt.c +12 -0
index d6e4e42..7039606 100644
@@ -74,6 +74,12 @@ acpi_status acpi_enable(void)
 		return_ACPI_STATUS(AE_NO_ACPI_TABLES);
 	}
 
+	/* If the Hardware Reduced flag is set, machine is always in acpi mode */
+
+	if (acpi_gbl_reduced_hardware) {
+		return_ACPI_STATUS(AE_OK);
+	}
+
 	/* Check current mode */
 
 	if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
@@ -126,6 +132,12 @@ acpi_status acpi_disable(void)
 
 	ACPI_FUNCTION_TRACE(acpi_disable);
 
+	/* If the Hardware Reduced flag is set, machine is always in acpi mode */
+
+	if (acpi_gbl_reduced_hardware) {
+		return_ACPI_STATUS(AE_OK);
+	}
+
 	if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY) {
 		ACPI_DEBUG_PRINT((ACPI_DB_INIT,
 				  "System is already in legacy (non-ACPI) mode\n"));
drivers/acpi/acpica/hwacpi.c +12 -0
index deb3f61..9b02a9f 100644
@@ -66,6 +66,12 @@ acpi_status acpi_hw_set_mode(u32 mode)
 
 	ACPI_FUNCTION_TRACE(hw_set_mode);
 
+	/* If the Hardware Reduced flag is set, machine is always in acpi mode */
+
+	if (acpi_gbl_reduced_hardware) {
+		return_ACPI_STATUS(AE_OK);
+	}
+
 	/*
 	 * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
 	 * system does not support mode transition.
@@ -146,6 +152,12 @@ u32 acpi_hw_get_mode(void)
 
 	ACPI_FUNCTION_TRACE(hw_get_mode);
 
+	/* If the Hardware Reduced flag is set, machine is always in acpi mode */
+
+	if (acpi_gbl_reduced_hardware) {
+		return_VALUE(ACPI_SYS_MODE_ACPI);
+	}
+
 	/*
 	 * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
 	 * system does not support mode transition.
Signature · 1 line
1.7.10
author
#11 lore raw

PATCH 11/21 ACPICA: Regression fix: reinstate safe exit macros

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Removal caused a regression on at least FreeBSD. This fix reinstates the macros.

---
 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    |   10 ++++----
 drivers/acpi/acpica/nsutils.c   |    8 +++---
 drivers/acpi/acpica/psargs.c    |    2 +-
 drivers/acpi/acpica/utaddress.c |    4 +--
 include/acpi/acoutput.h         |   53 ++++++++++++++++++++++++++++++---------
 10 files changed, 67 insertions(+), 38 deletions(-)
drivers/acpi/acpica/dsutils.c +5 -5
index 4d8c992..9977899 100644
@@ -178,7 +178,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
 
 	if (!op) {
 		ACPI_ERROR((AE_INFO, "Null Op"));
-		return_VALUE(TRUE);
+		return_UINT8(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_VALUE(FALSE);
+		return_UINT8(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_VALUE(FALSE);
+		return_UINT8(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_VALUE(TRUE);
+	return_UINT8(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_VALUE(FALSE);
+	return_UINT8(FALSE);
 }
 
 /*******************************************************************************
drivers/acpi/acpica/evgpe.c +3 -3
index b9adb9a..a493b52 100644
@@ -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_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
+			return_UINT32(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_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
+		return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
 	}
 
 	/*
@@ -784,7 +784,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
 		break;
 	}
 
-	return_VALUE(ACPI_INTERRUPT_HANDLED);
+	return_UINT32(ACPI_INTERRUPT_HANDLED);
 }
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evsci.c +2 -2
index f4b43be..b905acf 100644
@@ -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_VALUE(interrupt_handled);
+	return_UINT32(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_VALUE(interrupt_handled);
+	return_UINT32(interrupt_handled);
 }
 
 /******************************************************************************
drivers/acpi/acpica/exprep.c +2 -2
index d6eab81..6b728ae 100644
@@ -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_VALUE(0);
+		return_UINT32(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_VALUE(bit_length);
+	return_UINT32(bit_length);
 }
 
 /*******************************************************************************
drivers/acpi/acpica/exutils.c +2 -2
index b205cbb..99dc7b2 100644
@@ -340,7 +340,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_VALUE(1);
+		return_UINT32(1);
 	}
 
 	current_value = value;
@@ -354,7 +354,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base)
 		num_digits++;
 	}
 
-	return_VALUE(num_digits);
+	return_UINT32(num_digits);
 }
 
 /*******************************************************************************
drivers/acpi/acpica/hwacpi.c +5 -5
index 9b02a9f..579c3a5 100644
@@ -155,7 +155,7 @@ u32 acpi_hw_get_mode(void)
 	/* If the Hardware Reduced flag is set, machine is always in acpi mode */
 
 	if (acpi_gbl_reduced_hardware) {
-		return_VALUE(ACPI_SYS_MODE_ACPI);
+		return_UINT32(ACPI_SYS_MODE_ACPI);
 	}
 
 	/*
@@ -163,18 +163,18 @@ u32 acpi_hw_get_mode(void)
 	 * system does not support mode transition.
 	 */
 	if (!acpi_gbl_FADT.smi_command) {
-		return_VALUE(ACPI_SYS_MODE_ACPI);
+		return_UINT32(ACPI_SYS_MODE_ACPI);
 	}
 
 	status = acpi_read_bit_register(ACPI_BITREG_SCI_ENABLE, &value);
 	if (ACPI_FAILURE(status)) {
-		return_VALUE(ACPI_SYS_MODE_LEGACY);
+		return_UINT32(ACPI_SYS_MODE_LEGACY);
 	}
 
 	if (value) {
-		return_VALUE(ACPI_SYS_MODE_ACPI);
+		return_UINT32(ACPI_SYS_MODE_ACPI);
 	} else {
-		return_VALUE(ACPI_SYS_MODE_LEGACY);
+		return_UINT32(ACPI_SYS_MODE_LEGACY);
 	}
 }
 
drivers/acpi/acpica/nsutils.c +4 -4
index 686420d..2808586 100644
@@ -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_VALUE(ACPI_TYPE_ANY);
+		return_UINT8(ACPI_TYPE_ANY);
 	}
 
-	return_VALUE(node->type);
+	return_UINT8(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_VALUE(ACPI_NS_NORMAL);
+		return_UINT32(ACPI_NS_NORMAL);
 	}
 
-	return_VALUE(acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
+	return_UINT32(acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
 }
 
 /*******************************************************************************
drivers/acpi/acpica/psargs.c +1 -1
index f51308c..9f25a3d 100644
@@ -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_VALUE(package_length);
+	return_UINT32(package_length);
 }
 
 /*******************************************************************************
drivers/acpi/acpica/utaddress.c +2 -2
index 698b9d3..e0a2e27 100644
@@ -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_VALUE(0);
+		return_UINT32(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_VALUE(overlap_count);
+	return_UINT32(overlap_count);
 }
 
 /*******************************************************************************
include/acpi/acoutput.h +41 -12

100 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#12 lore raw

PATCH 12/21 ACPICA: Add macros to exception code definitions

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Simplifies the definitions of new and existing codes.

---
 include/acpi/acexcep.h |  192 ++++++++++++++++++++++++++----------------------
 1 file changed, 103 insertions(+), 89 deletions(-)
include/acpi/acexcep.h +103 -89
index 9bf59d0..3e6b163 100644
@@ -44,8 +44,10 @@
 #ifndef __ACEXCEP_H__
 #define __ACEXCEP_H__
 
+/* This module contains all possible exception codes for acpi_status */
+
 /*
- * Exceptions returned by external ACPI interfaces
+ * Exception code classes
  */
 #define AE_CODE_ENVIRONMENTAL           0x0000
 #define AE_CODE_PROGRAMMER              0x1000
@@ -55,6 +57,18 @@
 #define AE_CODE_MAX                     0x4000
 #define AE_CODE_MASK                    0xF000
 
+/*
+ * Macros to insert the exception code classes
+ */
+#define EXCEP_ENV(code)                 ((acpi_status) (code | AE_CODE_ENVIRONMENTAL))
+#define EXCEP_PGM(code)                 ((acpi_status) (code | AE_CODE_PROGRAMMER))
+#define EXCEP_TBL(code)                 ((acpi_status) (code | AE_CODE_ACPI_TABLES))
+#define EXCEP_AML(code)                 ((acpi_status) (code | AE_CODE_AML))
+#define EXCEP_CTL(code)                 ((acpi_status) (code | AE_CODE_CONTROL))
+
+/*
+ * Success is always zero, failure is non-zero
+ */
 #define ACPI_SUCCESS(a)                 (!(a))
 #define ACPI_FAILURE(a)                 (a)
 
@@ -64,60 +78,60 @@
 /*
  * Environmental exceptions
  */
-#define AE_ERROR                        (acpi_status) (0x0001 | AE_CODE_ENVIRONMENTAL)
-#define AE_NO_ACPI_TABLES               (acpi_status) (0x0002 | AE_CODE_ENVIRONMENTAL)
-#define AE_NO_NAMESPACE                 (acpi_status) (0x0003 | AE_CODE_ENVIRONMENTAL)
-#define AE_NO_MEMORY                    (acpi_status) (0x0004 | AE_CODE_ENVIRONMENTAL)
-#define AE_NOT_FOUND                    (acpi_status) (0x0005 | AE_CODE_ENVIRONMENTAL)
-#define AE_NOT_EXIST                    (acpi_status) (0x0006 | AE_CODE_ENVIRONMENTAL)
-#define AE_ALREADY_EXISTS               (acpi_status) (0x0007 | AE_CODE_ENVIRONMENTAL)
-#define AE_TYPE                         (acpi_status) (0x0008 | AE_CODE_ENVIRONMENTAL)
-#define AE_NULL_OBJECT                  (acpi_status) (0x0009 | AE_CODE_ENVIRONMENTAL)
-#define AE_NULL_ENTRY                   (acpi_status) (0x000A | AE_CODE_ENVIRONMENTAL)
-#define AE_BUFFER_OVERFLOW              (acpi_status) (0x000B | AE_CODE_ENVIRONMENTAL)
-#define AE_STACK_OVERFLOW               (acpi_status) (0x000C | AE_CODE_ENVIRONMENTAL)
-#define AE_STACK_UNDERFLOW              (acpi_status) (0x000D | AE_CODE_ENVIRONMENTAL)
-#define AE_NOT_IMPLEMENTED              (acpi_status) (0x000E | AE_CODE_ENVIRONMENTAL)
-#define AE_SUPPORT                      (acpi_status) (0x000F | AE_CODE_ENVIRONMENTAL)
-#define AE_LIMIT                        (acpi_status) (0x0010 | AE_CODE_ENVIRONMENTAL)
-#define AE_TIME                         (acpi_status) (0x0011 | AE_CODE_ENVIRONMENTAL)
-#define AE_ACQUIRE_DEADLOCK             (acpi_status) (0x0012 | AE_CODE_ENVIRONMENTAL)
-#define AE_RELEASE_DEADLOCK             (acpi_status) (0x0013 | AE_CODE_ENVIRONMENTAL)
-#define AE_NOT_ACQUIRED                 (acpi_status) (0x0014 | AE_CODE_ENVIRONMENTAL)
-#define AE_ALREADY_ACQUIRED             (acpi_status) (0x0015 | AE_CODE_ENVIRONMENTAL)
-#define AE_NO_HARDWARE_RESPONSE         (acpi_status) (0x0016 | AE_CODE_ENVIRONMENTAL)
-#define AE_NO_GLOBAL_LOCK               (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL)
-#define AE_ABORT_METHOD                 (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL)
-#define AE_SAME_HANDLER                 (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
-#define AE_NO_HANDLER                   (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
-#define AE_OWNER_ID_LIMIT               (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
-#define AE_NOT_CONFIGURED               (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
+#define AE_ERROR                        EXCEP_ENV (0x0001)
+#define AE_NO_ACPI_TABLES               EXCEP_ENV (0x0002)
+#define AE_NO_NAMESPACE                 EXCEP_ENV (0x0003)
+#define AE_NO_MEMORY                    EXCEP_ENV (0x0004)
+#define AE_NOT_FOUND                    EXCEP_ENV (0x0005)
+#define AE_NOT_EXIST                    EXCEP_ENV (0x0006)
+#define AE_ALREADY_EXISTS               EXCEP_ENV (0x0007)
+#define AE_TYPE                         EXCEP_ENV (0x0008)
+#define AE_NULL_OBJECT                  EXCEP_ENV (0x0009)
+#define AE_NULL_ENTRY                   EXCEP_ENV (0x000A)
+#define AE_BUFFER_OVERFLOW              EXCEP_ENV (0x000B)
+#define AE_STACK_OVERFLOW               EXCEP_ENV (0x000C)
+#define AE_STACK_UNDERFLOW              EXCEP_ENV (0x000D)
+#define AE_NOT_IMPLEMENTED              EXCEP_ENV (0x000E)
+#define AE_SUPPORT                      EXCEP_ENV (0x000F)
+#define AE_LIMIT                        EXCEP_ENV (0x0010)
+#define AE_TIME                         EXCEP_ENV (0x0011)
+#define AE_ACQUIRE_DEADLOCK             EXCEP_ENV (0x0012)
+#define AE_RELEASE_DEADLOCK             EXCEP_ENV (0x0013)
+#define AE_NOT_ACQUIRED                 EXCEP_ENV (0x0014)
+#define AE_ALREADY_ACQUIRED             EXCEP_ENV (0x0015)
+#define AE_NO_HARDWARE_RESPONSE         EXCEP_ENV (0x0016)
+#define AE_NO_GLOBAL_LOCK               EXCEP_ENV (0x0017)
+#define AE_ABORT_METHOD                 EXCEP_ENV (0x0018)
+#define AE_SAME_HANDLER                 EXCEP_ENV (0x0019)
+#define AE_NO_HANDLER                   EXCEP_ENV (0x001A)
+#define AE_OWNER_ID_LIMIT               EXCEP_ENV (0x001B)
+#define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)
 
 #define AE_CODE_ENV_MAX                 0x001C
 
 /*
  * Programmer exceptions
  */
-#define AE_BAD_PARAMETER                (acpi_status) (0x0001 | AE_CODE_PROGRAMMER)
-#define AE_BAD_CHARACTER                (acpi_status) (0x0002 | AE_CODE_PROGRAMMER)
-#define AE_BAD_PATHNAME                 (acpi_status) (0x0003 | AE_CODE_PROGRAMMER)
-#define AE_BAD_DATA                     (acpi_status) (0x0004 | AE_CODE_PROGRAMMER)
-#define AE_BAD_HEX_CONSTANT             (acpi_status) (0x0005 | AE_CODE_PROGRAMMER)
-#define AE_BAD_OCTAL_CONSTANT           (acpi_status) (0x0006 | AE_CODE_PROGRAMMER)
-#define AE_BAD_DECIMAL_CONSTANT         (acpi_status) (0x0007 | AE_CODE_PROGRAMMER)
-#define AE_MISSING_ARGUMENTS            (acpi_status) (0x0008 | AE_CODE_PROGRAMMER)
-#define AE_BAD_ADDRESS                  (acpi_status) (0x0009 | AE_CODE_PROGRAMMER)
+#define AE_BAD_PARAMETER                EXCEP_PGM (0x0001)
+#define AE_BAD_CHARACTER                EXCEP_PGM (0x0002)
+#define AE_BAD_PATHNAME                 EXCEP_PGM (0x0003)
+#define AE_BAD_DATA                     EXCEP_PGM (0x0004)
+#define AE_BAD_HEX_CONSTANT             EXCEP_PGM (0x0005)
+#define AE_BAD_OCTAL_CONSTANT           EXCEP_PGM (0x0006)
+#define AE_BAD_DECIMAL_CONSTANT         EXCEP_PGM (0x0007)
+#define AE_MISSING_ARGUMENTS            EXCEP_PGM (0x0008)
+#define AE_BAD_ADDRESS                  EXCEP_PGM (0x0009)
 
 #define AE_CODE_PGM_MAX                 0x0009
 
 /*
  * Acpi table exceptions
  */
-#define AE_BAD_SIGNATURE                (acpi_status) (0x0001 | AE_CODE_ACPI_TABLES)
-#define AE_BAD_HEADER                   (acpi_status) (0x0002 | AE_CODE_ACPI_TABLES)
-#define AE_BAD_CHECKSUM                 (acpi_status) (0x0003 | AE_CODE_ACPI_TABLES)
-#define AE_BAD_VALUE                    (acpi_status) (0x0004 | AE_CODE_ACPI_TABLES)
-#define AE_INVALID_TABLE_LENGTH         (acpi_status) (0x0005 | AE_CODE_ACPI_TABLES)
+#define AE_BAD_SIGNATURE                EXCEP_TBL (0x0001)
+#define AE_BAD_HEADER                   EXCEP_TBL (0x0002)
+#define AE_BAD_CHECKSUM                 EXCEP_TBL (0x0003)
+#define AE_BAD_VALUE                    EXCEP_TBL (0x0004)
+#define AE_INVALID_TABLE_LENGTH         EXCEP_TBL (0x0005)
 
 #define AE_CODE_TBL_MAX                 0x0005
 
@@ -125,58 +139,58 @@
  * AML exceptions. These are caused by problems with
  * the actual AML byte stream
  */
-#define AE_AML_BAD_OPCODE               (acpi_status) (0x0001 | AE_CODE_AML)
-#define AE_AML_NO_OPERAND               (acpi_status) (0x0002 | AE_CODE_AML)
-#define AE_AML_OPERAND_TYPE             (acpi_status) (0x0003 | AE_CODE_AML)
-#define AE_AML_OPERAND_VALUE            (acpi_status) (0x0004 | AE_CODE_AML)
-#define AE_AML_UNINITIALIZED_LOCAL      (acpi_status) (0x0005 | AE_CODE_AML)
-#define AE_AML_UNINITIALIZED_ARG        (acpi_status) (0x0006 | AE_CODE_AML)
-#define AE_AML_UNINITIALIZED_ELEMENT    (acpi_status) (0x0007 | AE_CODE_AML)
-#define AE_AML_NUMERIC_OVERFLOW         (acpi_status) (0x0008 | AE_CODE_AML)
-#define AE_AML_REGION_LIMIT             (acpi_status) (0x0009 | AE_CODE_AML)
-#define AE_AML_BUFFER_LIMIT             (acpi_status) (0x000A | AE_CODE_AML)
-#define AE_AML_PACKAGE_LIMIT            (acpi_status) (0x000B | AE_CODE_AML)
-#define AE_AML_DIVIDE_BY_ZERO           (acpi_status) (0x000C | AE_CODE_AML)
-#define AE_AML_BAD_NAME                 (acpi_status) (0x000D | AE_CODE_AML)
-#define AE_AML_NAME_NOT_FOUND           (acpi_status) (0x000E | AE_CODE_AML)
-#define AE_AML_INTERNAL                 (acpi_status) (0x000F | AE_CODE_AML)
-#define AE_AML_INVALID_SPACE_ID         (acpi_status) (0x0010 | AE_CODE_AML)
-#define AE_AML_STRING_LIMIT             (acpi_status) (0x0011 | AE_CODE_AML)
-#define AE_AML_NO_RETURN_VALUE          (acpi_status) (0x0012 | AE_CODE_AML)
-#define AE_AML_METHOD_LIMIT             (acpi_status) (0x0013 | AE_CODE_AML)
-#define AE_AML_NOT_OWNER                (acpi_status) (0x0014 | AE_CODE_AML)
-#define AE_AML_MUTEX_ORDER              (acpi_status) (0x0015 | AE_CODE_AML)
-#define AE_AML_MUTEX_NOT_ACQUIRED       (acpi_status) (0x0016 | AE_CODE_AML)
-#define AE_AML_INVALID_RESOURCE_TYPE    (acpi_status) (0x0017 | AE_CODE_AML)
-#define AE_AML_INVALID_INDEX            (acpi_status) (0x0018 | AE_CODE_AML)
-#define AE_AML_REGISTER_LIMIT           (acpi_status) (0x0019 | AE_CODE_AML)
-#define AE_AML_NO_WHILE                 (acpi_status) (0x001A | AE_CODE_AML)
-#define AE_AML_ALIGNMENT                (acpi_status) (0x001B | AE_CODE_AML)
-#define AE_AML_NO_RESOURCE_END_TAG      (acpi_status) (0x001C | AE_CODE_AML)
-#define AE_AML_BAD_RESOURCE_VALUE       (acpi_status) (0x001D | AE_CODE_AML)
-#define AE_AML_CIRCULAR_REFERENCE       (acpi_status) (0x001E | AE_CODE_AML)
-#define AE_AML_BAD_RESOURCE_LENGTH      (acpi_status) (0x001F | AE_CODE_AML)
-#define AE_AML_ILLEGAL_ADDRESS          (acpi_status) (0x0020 | AE_CODE_AML)
-#define AE_AML_INFINITE_LOOP            (acpi_status) (0x0021 | AE_CODE_AML)
+#define AE_AML_BAD_OPCODE               EXCEP_AML (0x0001)
+#define AE_AML_NO_OPERAND               EXCEP_AML (0x0002)
+#define AE_AML_OPERAND_TYPE             EXCEP_AML (0x0003)
+#define AE_AML_OPERAND_VALUE            EXCEP_AML (0x0004)
+#define AE_AML_UNINITIALIZED_LOCAL      EXCEP_AML (0x0005)
+#define AE_AML_UNINITIALIZED_ARG        EXCEP_AML (0x0006)
+#define AE_AML_UNINITIALIZED_ELEMENT    EXCEP_AML (0x0007)
+#define AE_AML_NUMERIC_OVERFLOW         EXCEP_AML (0x0008)
+#define AE_AML_REGION_LIMIT             EXCEP_AML (0x0009)
+#define AE_AML_BUFFER_LIMIT             EXCEP_AML (0x000A)
+#define AE_AML_PACKAGE_LIMIT            EXCEP_AML (0x000B)
+#define AE_AML_DIVIDE_BY_ZERO           EXCEP_AML (0x000C)
+#define AE_AML_BAD_NAME                 EXCEP_AML (0x000D)
+#define AE_AML_NAME_NOT_FOUND           EXCEP_AML (0x000E)
+#define AE_AML_INTERNAL                 EXCEP_AML (0x000F)
+#define AE_AML_INVALID_SPACE_ID         EXCEP_AML (0x0010)
+#define AE_AML_STRING_LIMIT             EXCEP_AML (0x0011)
+#define AE_AML_NO_RETURN_VALUE          EXCEP_AML (0x0012)
+#define AE_AML_METHOD_LIMIT             EXCEP_AML (0x0013)
+#define AE_AML_NOT_OWNER                EXCEP_AML (0x0014)
+#define AE_AML_MUTEX_ORDER              EXCEP_AML (0x0015)
+#define AE_AML_MUTEX_NOT_ACQUIRED       EXCEP_AML (0x0016)
+#define AE_AML_INVALID_RESOURCE_TYPE    EXCEP_AML (0x0017)
+#define AE_AML_INVALID_INDEX            EXCEP_AML (0x0018)
+#define AE_AML_REGISTER_LIMIT           EXCEP_AML (0x0019)
+#define AE_AML_NO_WHILE                 EXCEP_AML (0x001A)
+#define AE_AML_ALIGNMENT                EXCEP_AML (0x001B)
+#define AE_AML_NO_RESOURCE_END_TAG      EXCEP_AML (0x001C)
+#define AE_AML_BAD_RESOURCE_VALUE       EXCEP_AML (0x001D)
+#define AE_AML_CIRCULAR_REFERENCE       EXCEP_AML (0x001E)
+#define AE_AML_BAD_RESOURCE_LENGTH      EXCEP_AML (0x001F)
+#define AE_AML_ILLEGAL_ADDRESS          EXCEP_AML (0x0020)
+#define AE_AML_INFINITE_LOOP            EXCEP_AML (0x0021)
 
 #define AE_CODE_AML_MAX                 0x0021
 
 /*
  * Internal exceptions used for control
  */
-#define AE_CTRL_RETURN_VALUE            (acpi_status) (0x0001 | AE_CODE_CONTROL)
-#define AE_CTRL_PENDING                 (acpi_status) (0x0002 | AE_CODE_CONTROL)
-#define AE_CTRL_TERMINATE               (acpi_status) (0x0003 | AE_CODE_CONTROL)
-#define AE_CTRL_TRUE                    (acpi_status) (0x0004 | AE_CODE_CONTROL)
-#define AE_CTRL_FALSE                   (acpi_status) (0x0005 | AE_CODE_CONTROL)
-#define AE_CTRL_DEPTH                   (acpi_status) (0x0006 | AE_CODE_CONTROL)
-#define AE_CTRL_END                     (acpi_status) (0x0007 | AE_CODE_CONTROL)
-#define AE_CTRL_TRANSFER                (acpi_status) (0x0008 | AE_CODE_CONTROL)
-#define AE_CTRL_BREAK                   (acpi_status) (0x0009 | AE_CODE_CONTROL)
-#define AE_CTRL_CONTINUE                (acpi_status) (0x000A | AE_CODE_CONTROL)
-#define AE_CTRL_SKIP                    (acpi_status) (0x000B | AE_CODE_CONTROL)
-#define AE_CTRL_PARSE_CONTINUE          (acpi_status) (0x000C | AE_CODE_CONTROL)
-#define AE_CTRL_PARSE_PENDING           (acpi_status) (0x000D | AE_CODE_CONTROL)
+#define AE_CTRL_RETURN_VALUE            EXCEP_CTL (0x0001)
+#define AE_CTRL_PENDING                 EXCEP_CTL (0x0002)
+#define AE_CTRL_TERMINATE               EXCEP_CTL (0x0003)
+#define AE_CTRL_TRUE                    EXCEP_CTL (0x0004)
+#define AE_CTRL_FALSE                   EXCEP_CTL (0x0005)
+#define AE_CTRL_DEPTH                   EXCEP_CTL (0x0006)
+#define AE_CTRL_END                     EXCEP_CTL (0x0007)
+#define AE_CTRL_TRANSFER                EXCEP_CTL (0x0008)
+#define AE_CTRL_BREAK                   EXCEP_CTL (0x0009)
+#define AE_CTRL_CONTINUE                EXCEP_CTL (0x000A)
+#define AE_CTRL_SKIP                    EXCEP_CTL (0x000B)
+#define AE_CTRL_PARSE_CONTINUE          EXCEP_CTL (0x000C)
+#define AE_CTRL_PARSE_PENDING           EXCEP_CTL (0x000D)
 
 #define AE_CODE_CTRL_MAX                0x000D
 
Signature · 1 line
1.7.10
author
#13 lore raw

PATCH 13/21 ACPICA: Add exception descriptions to exception info table

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Descriptions to be compiled/used by the acpihelp utility only. Not compiled for the kernel ACPICA code.

---
 drivers/acpi/acpica/acutils.h |    3 +-
 drivers/acpi/acpica/utexcep.c |   26 ++--
 include/acpi/acexcep.h        |  269 +++++++++++++++++++++++++----------------
 3 files changed, 183 insertions(+), 115 deletions(-)
drivers/acpi/acpica/acutils.h +2 -1
index 0082fa0..c01f1a1 100644
@@ -483,7 +483,8 @@ acpi_ut_short_divide(u64 in_dividend,
 /*
  * utmisc
  */
-const char *acpi_ut_validate_exception(acpi_status status);
+const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
+							     status);
 
 u8 acpi_ut_is_pci_root_bridge(char *id);
 
drivers/acpi/acpica/utexcep.c +15 -11
index a0ab7c0..b543a14 100644
@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("utexcep")
  ******************************************************************************/
 const char *acpi_format_exception(acpi_status status)
 {
-	const char *exception = NULL;
+	const struct acpi_exception_info *exception;
 
 	ACPI_FUNCTION_ENTRY();
 
@@ -76,10 +76,10 @@ const char *acpi_format_exception(acpi_status status)
 		ACPI_ERROR((AE_INFO,
 			    "Unknown exception code: 0x%8.8X", status));
 
-		exception = "UNKNOWN_STATUS_CODE";
+		return ("UNKNOWN_STATUS_CODE");
 	}
 
-	return (ACPI_CAST_PTR(const char, exception));
+	return (exception->name);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_format_exception)
@@ -97,10 +97,10 @@ ACPI_EXPORT_SYMBOL(acpi_format_exception)
  *              an ASCII string.
  *
  ******************************************************************************/
-const char *acpi_ut_validate_exception(acpi_status status)
+const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status status)
 {
 	u32 sub_status;
-	const char *exception = NULL;
+	const struct acpi_exception_info *exception = NULL;
 
 	ACPI_FUNCTION_ENTRY();
 
@@ -113,35 +113,35 @@ const char *acpi_ut_validate_exception(acpi_status status)
 	case AE_CODE_ENVIRONMENTAL:
 
 		if (sub_status <= AE_CODE_ENV_MAX) {
-			exception = acpi_gbl_exception_names_env[sub_status];
+			exception = &acpi_gbl_exception_names_env[sub_status];
 		}
 		break;
 
 	case AE_CODE_PROGRAMMER:
 
 		if (sub_status <= AE_CODE_PGM_MAX) {
-			exception = acpi_gbl_exception_names_pgm[sub_status];
+			exception = &acpi_gbl_exception_names_pgm[sub_status];
 		}
 		break;
 
 	case AE_CODE_ACPI_TABLES:
 
 		if (sub_status <= AE_CODE_TBL_MAX) {
-			exception = acpi_gbl_exception_names_tbl[sub_status];
+			exception = &acpi_gbl_exception_names_tbl[sub_status];
 		}
 		break;
 
 	case AE_CODE_AML:
 
 		if (sub_status <= AE_CODE_AML_MAX) {
-			exception = acpi_gbl_exception_names_aml[sub_status];
+			exception = &acpi_gbl_exception_names_aml[sub_status];
 		}
 		break;
 
 	case AE_CODE_CONTROL:
 
 		if (sub_status <= AE_CODE_CTRL_MAX) {
-			exception = acpi_gbl_exception_names_ctrl[sub_status];
+			exception = &acpi_gbl_exception_names_ctrl[sub_status];
 		}
 		break;
 
@@ -149,5 +149,9 @@ const char *acpi_ut_validate_exception(acpi_status status)
 		break;
 	}
 
-	return (ACPI_CAST_PTR(const char, exception));
+	if (!exception || !exception->name) {
+		return (NULL);
+	}
+
+	return (exception);
 }
include/acpi/acexcep.h +166 -103

295 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#14 lore raw

PATCH 14/21 ACPICA: Remove trailing comma in enum declarations

In reply to Lv Zheng

From: Bob Moore <[email protected]>

SunStudio compiler complains about trailing commas in enum declarations.

---
 include/acpi/actbl3.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/acpi/actbl3.h +2 -2
index 9f27890..e2c0931 100644
@@ -174,7 +174,7 @@ struct acpi_fpdt_header {
 
 enum acpi_fpdt_type {
 	ACPI_FPDT_TYPE_BOOT = 0,
-	ACPI_FPDT_TYPE_S3PERF = 1,
+	ACPI_FPDT_TYPE_S3PERF = 1
 };
 
 /*
@@ -223,7 +223,7 @@ struct acpi_s3pt_header {
 
 enum acpi_s3pt_type {
 	ACPI_S3PT_TYPE_RESUME = 0,
-	ACPI_S3PT_TYPE_SUSPEND = 1,
+	ACPI_S3PT_TYPE_SUSPEND = 1
 };
 
 struct acpi_s3pt_resume {
Signature · 1 line
1.7.10
author
#15 lore raw

PATCH 15/21 ACPICA: Add mechanism for early object repairs on a per-name basis

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Adds the framework to allow object repairs very early in the return object analysis. Enables repairs like string->unicode, etc. Bob Moore, Lv Zheng.

---
 drivers/acpi/acpica/aclocal.h   |   15 +++++
 drivers/acpi/acpica/acnamesp.h  |    2 +-
 drivers/acpi/acpica/nspredef.c  |  141 +++++++++++++++++++--------------------
 drivers/acpi/acpica/nsrepair.c  |  134 +++++++++++++++++++++++++++++++++++--
 drivers/acpi/acpica/nsrepair2.c |   16 ++---
 5 files changed, 221 insertions(+), 87 deletions(-)
drivers/acpi/acpica/aclocal.h +15 -0
index 805f419..9d45f97 100644
@@ -363,6 +363,7 @@ struct acpi_predefined_data {
 	union acpi_operand_object *parent_package;
 	struct acpi_namespace_node *node;
 	u32 flags;
+	u32 return_btype;
 	u8 node_flags;
 };
 
@@ -371,6 +372,20 @@ struct acpi_predefined_data {
 #define ACPI_OBJECT_REPAIRED    1
 #define ACPI_OBJECT_WRAPPED     2
 
+/* Return object auto-repair info */
+
+typedef acpi_status(*acpi_object_converter) (union acpi_operand_object
+					     *original_object,
+					     union acpi_operand_object
+					     **converted_object);
+
+struct acpi_simple_repair_info {
+	char name[ACPI_NAME_SIZE];
+	u32 unexpected_btypes;
+	u32 package_index;
+	acpi_object_converter object_converter;
+};
+
 /*
  * Bitmapped return value types
  * Note: the actual data types must be contiguous, a loop in nspredef.c
drivers/acpi/acpica/acnamesp.h +1 -1
index 02cd548..dec6e9e 100644
@@ -289,7 +289,7 @@ acpi_ns_get_attached_data(struct acpi_namespace_node *node,
  * predefined methods/objects
  */
 acpi_status
-acpi_ns_repair_object(struct acpi_predefined_data *data,
+acpi_ns_simple_repair(struct acpi_predefined_data *data,
 		      u32 expected_btypes,
 		      u32 package_index,
 		      union acpi_operand_object **return_object_ptr);
drivers/acpi/acpica/nspredef.c +67 -74

192 lines not on this page · raw message

drivers/acpi/acpica/nsrepair.c +130 -4

179 lines not on this page · raw message

drivers/acpi/acpica/nsrepair2.c +8 -8
index ba4d982..149e9b9 100644
@@ -66,9 +66,9 @@ typedef struct acpi_repair_info {
 
 /* Local prototypes */
 
-static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct
-								    acpi_namespace_node
-								    *node);
+static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
+								   acpi_namespace_node
+								   *node);
 
 static acpi_status
 acpi_ns_repair_ALR(struct acpi_predefined_data *data,
@@ -175,7 +175,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
 
 	/* Check if this name is in the list of repairable names */
 
-	predefined = acpi_ns_match_repairable_name(node);
+	predefined = acpi_ns_match_complex_repair(node);
 	if (!predefined) {
 		return (validate_status);
 	}
@@ -186,7 +186,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
 
 /******************************************************************************
  *
- * FUNCTION:    acpi_ns_match_repairable_name
+ * FUNCTION:    acpi_ns_match_complex_repair
  *
  * PARAMETERS:  node                - Namespace node for the method/object
  *
@@ -196,9 +196,9 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
  *
  *****************************************************************************/
 
-static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct
-								    acpi_namespace_node
-								    *node)
+static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
+								   acpi_namespace_node
+								   *node)
 {
 	const struct acpi_repair_info *this_name;
 
Signature · 1 line
1.7.10
author
#16 lore raw

PATCH 16/21 ACPICA: Split object conversion functions to a new file

In reply to Lv Zheng

From: Bob Moore <[email protected]>

New file, nsconvert.c, for return object conversion functions. Created in preparation for new conversion functions forthcoming.

---
 drivers/acpi/acpica/Makefile    |    1 +
 drivers/acpi/acpica/acnamesp.h  |   15 ++
 drivers/acpi/acpica/nsconvert.c |  302 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nsrepair.c  |  262 ---------------------------------
 4 files changed, 318 insertions(+), 262 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsconvert.c
drivers/acpi/acpica/Makefile +1 -0
index a1b9bf5..5a542c8 100644
@@ -83,6 +83,7 @@ acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
 acpi-y +=		\
 	nsaccess.o	\
 	nsalloc.o	\
+	nsconvert.o	\
 	nsdump.o	\
 	nseval.o	\
 	nsinit.o	\
drivers/acpi/acpica/acnamesp.h +15 -0
index dec6e9e..7156bc7 100644
@@ -167,6 +167,21 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent);
 int acpi_ns_compare_names(char *name1, char *name2);
 
 /*
+ * nsconvert - Dynamic object conversion routines
+ */
+acpi_status
+acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
+			   union acpi_operand_object **return_object);
+
+acpi_status
+acpi_ns_convert_to_string(union acpi_operand_object *original_object,
+			  union acpi_operand_object **return_object);
+
+acpi_status
+acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
+			  union acpi_operand_object **return_object);
+
+/*
  * nsdump - Namespace dump/print utilities
  */
 #ifdef	ACPI_FUTURE_USAGE
drivers/acpi/acpica/nsconvert.c new file +302 -0

302 lines not on this page · raw message

drivers/acpi/acpica/nsrepair.c +0 -262

274 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#17 lore raw

PATCH 17/21 ACPICA: Return object repair: Add string-to-unicode conversion

In reply to Lv Zheng

Used for the _STR and _MLS predefined names. Lv Zheng.

---
 drivers/acpi/acpica/acnamesp.h  |    4 +++
 drivers/acpi/acpica/nsconvert.c |   64 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nsrepair.c  |    7 +++++
 3 files changed, 75 insertions(+)
drivers/acpi/acpica/acnamesp.h +4 -0
index 7156bc7..b6ee519 100644
@@ -181,6 +181,10 @@ acpi_status
 acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
 			  union acpi_operand_object **return_object);
 
+acpi_status
+acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
+			   union acpi_operand_object **return_object);
+
 /*
  * nsdump - Namespace dump/print utilities
  */
drivers/acpi/acpica/nsconvert.c +64 -0

67 lines not on this page · raw message

drivers/acpi/acpica/nsrepair.c +7 -0
index c5e828f..a1918fd 100644
@@ -98,6 +98,13 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
  * 2nd argument: Unexpected types that can be repaired
  */
 static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
+	/* Unicode conversions */
+
+	{"_MLS", ACPI_RTYPE_STRING, 1,
+	 acpi_ns_convert_to_unicode},
+	{"_STR", ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER,
+	 ACPI_NOT_PACKAGE_ELEMENT,
+	 acpi_ns_convert_to_unicode},
 	{{0, 0, 0, 0}, 0, 0, NULL}	/* Table terminator */
 };
 
Signature · 1 line
1.7.10
author
#18 lore raw

PATCH 18/21 ACPICA: Return object repair: Add resource template repairs

In reply to Lv Zheng

Fixes several possible problems with resource templates returned by _CRS/_PRS/_DMA predefined names. Lv Zheng.

---
 drivers/acpi/acpica/acnamesp.h  |    4 ++
 drivers/acpi/acpica/nsconvert.c |   77 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nsrepair.c  |   18 +++++++++
 3 files changed, 99 insertions(+)
drivers/acpi/acpica/acnamesp.h +4 -0
index b6ee519..6475962 100644
@@ -185,6 +185,10 @@ acpi_status
 acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
 			   union acpi_operand_object **return_object);
 
+acpi_status
+acpi_ns_convert_to_resource(union acpi_operand_object *original_object,
+			    union acpi_operand_object **return_object);
+
 /*
  * nsdump - Namespace dump/print utilities
  */
drivers/acpi/acpica/nsconvert.c +77 -0

80 lines not on this page · raw message

drivers/acpi/acpica/nsrepair.c +18 -0
index a1918fd..18f02e4 100644
@@ -98,6 +98,24 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
  * 2nd argument: Unexpected types that can be repaired
  */
 static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
+	/* Resource descriptor conversions */
+
+	{"_CRS",
+	 ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER |
+	 ACPI_RTYPE_NONE,
+	 ACPI_NOT_PACKAGE_ELEMENT,
+	 acpi_ns_convert_to_resource},
+	{"_DMA",
+	 ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER |
+	 ACPI_RTYPE_NONE,
+	 ACPI_NOT_PACKAGE_ELEMENT,
+	 acpi_ns_convert_to_resource},
+	{"_PRS",
+	 ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER |
+	 ACPI_RTYPE_NONE,
+	 ACPI_NOT_PACKAGE_ELEMENT,
+	 acpi_ns_convert_to_resource},
+
 	/* Unicode conversions */
 
 	{"_MLS", ACPI_RTYPE_STRING, 1,
Signature · 1 line
1.7.10
author
#19 lore raw

PATCH 19/21 ACPICA: Disassembler: Add warnings for unresolved control methods

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Flags the case where external control methods are unresolved, meaning that the disassembler had no idea how many arguments to parse for the method invocation.

---
 drivers/acpi/acpica/acglobal.h |    2 ++
 drivers/acpi/acpica/aclocal.h  |    1 +
 drivers/acpi/acpica/utglobal.c |    2 ++
 3 files changed, 5 insertions(+)
drivers/acpi/acpica/acglobal.h +2 -0
index feaa5d5..833fbc5 100644
@@ -417,6 +417,8 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_ignore_noop_operator, FALSE);
 
 ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
 ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
+ACPI_EXTERN u8 acpi_gbl_num_external_methods;
+ACPI_EXTERN u32 acpi_gbl_resolved_external_methods;
 ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list;
 ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list;
 #endif
drivers/acpi/acpica/aclocal.h +1 -0
index 9d45f97..636658f 100644
@@ -1052,6 +1052,7 @@ struct acpi_external_list {
 	u16 length;
 	u8 type;
 	u8 flags;
+	u8 resolved;
 };
 
 /* Values for Flags field above */
drivers/acpi/acpica/utglobal.c +2 -0
index ffecf4b..f736448 100644
@@ -359,6 +359,8 @@ acpi_status acpi_ut_init_globals(void)
 
 #ifdef ACPI_DISASSEMBLER
 	acpi_gbl_external_list = NULL;
+	acpi_gbl_num_external_methods = 0;
+	acpi_gbl_resolved_external_methods = 0;
 #endif
 
 #ifdef ACPI_DEBUG_OUTPUT
Signature · 1 line
1.7.10
author
#20 lore raw

PATCH 20/21 ACPICA: Object repair: Allow 0-length packages for variable-length packages

In reply to Lv Zheng

From: Bob Moore <[email protected]>

For the predefined names that return fully variable-length packages, allow a zero-length package with no warning, since it is technically a legal construct (and BIOS writers use it.)

---
 drivers/acpi/acpica/nsprepkg.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/acpi/acpica/nsprepkg.c +8 -2
index a401554..77cdd53 100644
@@ -112,9 +112,15 @@ acpi_ns_check_package(struct acpi_predefined_data *data,
 	elements = return_object->package.elements;
 	count = return_object->package.count;
 
-	/* The package must have at least one element, else invalid */
-
+	/*
+	 * Most packages must have at least one element. The only exception
+	 * is the variable-length package (ACPI_PTYPE1_VAR).
+	 */
 	if (!count) {
+		if (package->ret_info.type == ACPI_PTYPE1_VAR) {
+			return (AE_OK);
+		}
+
 		ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
 				      "Return Package has no elements (empty)"));
 
Signature · 1 line
1.7.10
author
#21 lore raw

PATCH 21/21 ACPICA: Update version to 20130214

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Version 20130214.

---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 03322dd..7aa231b 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20130117
+#define ACPI_CA_VERSION                 0x20130214
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
1.7.10
#22 lore raw
In reply to Lv Zheng
Quoted 27 lines · Lv Zheng

The 20130214 ACPICA linuxized patches are based on the pm/linux-next branch.
The patch set has passed a basic build/boot test on z530. No new divergences are introduced by this patch set.

Bob Moore (14):
ACPICA: Resource Mgr: Prevent infinite loops in resource walks
ACPICA: Fix a couple warnings detected on FreeBSD build
ACPICA: Update error/debug messages for fixed events
ACPICA: Add parens within macros around parameter names
ACPICA: Update for ACPI 5 hardware-reduced feature
ACPICA: Regression fix: reinstate safe exit macros
ACPICA: Add macros to exception code definitions
ACPICA: Add exception descriptions to exception info table
ACPICA: Remove trailing comma in enum declarations
ACPICA: Add mechanism for early object repairs on a per-name basis
ACPICA: Split object conversion functions to a new file
ACPICA: Disassembler: Add warnings for unresolved control methods
ACPICA: Object repair: Allow 0-length packages for variable-length
packages
ACPICA: Update version to 20130214

Jung-uk Kim (2):
ACPICA: Fix a long-standing bug in local cache
ACPICA: Add macros to access pointer to next object in the descriptor
list

Quoted 6 lines

Lv Zheng (5):
ACPICA: Update RASF table definition
ACPICA: iASL/Disassembler: Add support for VRTC table
ACPICA: iASL/Disassembler: Add support for MTMR table
ACPICA: Return object repair: Add string-to-unicode conversion
ACPICA: Return object repair: Add resource template repairs

All patches in the series applied to linux-pm.git/linux-next.

Thanks Lv!

Rafael

Quoted 40 lines
 drivers/acpi/acpica/Makefile    |    1 +
 drivers/acpi/acpica/acglobal.h  |    4 +-
 drivers/acpi/acpica/aclocal.h   |   16 ++
 drivers/acpi/acpica/acmacros.h  |    6 +-
 drivers/acpi/acpica/acnamesp.h  |   25 ++-
 drivers/acpi/acpica/acutils.h   |    3 +-
 drivers/acpi/acpica/dsutils.c   |   10 +-
 drivers/acpi/acpica/evevent.c   |   12 +-
 drivers/acpi/acpica/evgpe.c     |    6 +-
 drivers/acpi/acpica/evsci.c     |    4 +-
 drivers/acpi/acpica/evxface.c   |   21 +-
 drivers/acpi/acpica/evxfevnt.c  |   12 +
 drivers/acpi/acpica/exprep.c    |    4 +-
 drivers/acpi/acpica/exutils.c   |    4 +-
 drivers/acpi/acpica/hwacpi.c    |   20 +-
 drivers/acpi/acpica/nsconvert.c |  443 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nspredef.c  |  141 ++++++------
 drivers/acpi/acpica/nsprepkg.c  |   10 +-
 drivers/acpi/acpica/nsrepair.c  |  381 ++++++++++++--------------------
 drivers/acpi/acpica/nsrepair2.c |   16 +-
 drivers/acpi/acpica/nsutils.c   |    8 +-
 drivers/acpi/acpica/psargs.c    |    2 +-
 drivers/acpi/acpica/rscalc.c    |    6 +
 drivers/acpi/acpica/rsdump.c    |    8 +
 drivers/acpi/acpica/rslist.c    |    8 +
 drivers/acpi/acpica/rsxface.c   |    8 +-
 drivers/acpi/acpica/utaddress.c |    4 +-
 drivers/acpi/acpica/utcache.c   |   18 +-
 drivers/acpi/acpica/utexcep.c   |   26 ++-
 drivers/acpi/acpica/utglobal.c  |    2 +
 include/acpi/acexcep.h          |  461 +++++++++++++++++++++++----------------
 include/acpi/acoutput.h         |   53 ++++-
 include/acpi/acpixf.h           |    2 +-
 include/acpi/actbl2.h           |   47 ++++
 include/acpi/actbl3.h           |   55 ++++-
 include/acpi/actypes.h          |    1 -
 36 files changed, 1231 insertions(+), 617 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsconvert.c
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.