Skip to contentSkip to conversation

ACPICA: 20150930 Release

PATCH Superseded Lv Zheng 4 participants 18 messages Oct 15, 2015 – Oct 16, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lv Zheng

author
#0 lore raw

cover ACPICA: 20150930 Release

The 20150930 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150818 Release):
517 lines
After applying (20150930 Release):
517 lines

Note there are still 2 ACPICA debugger patches not released during this release cycle, so the debugger IO driver is not released in this cycle. In this series the ACPICA debugger core is compile time enabled as all ACPICA debugger files can be built with ACPI_DEBUGGER=y, but not runtime enabled as there is no invocations calling ACPICA debugger APIs and its required OSls are just stubs.

Bob Moore (8):
ACPICA: Remove unnecessary conditional compilation.
ACPICA: iASL: Add symbolic operator support for Index() operator.
ACPICA: Update exception code for "file not found" error
ACPICA: Debugger: Update mutexes used for multithreaded debugger
ACPICA: Update NFIT table to rename a flags field
ACPICA: Improve typechecking, both compile-time and runtime
ACPICA: iASL: General cleanup of the file suffix #defines
ACPICA: Update version to 20150930

Lv Zheng (5):
ACPICA: Linuxize: Export debugger files to Linux
ACPICA: Debugger: Fix "quit/exit" command by cleaning up user
commands termination logic
ACPICA: Debugger: Fix "terminate" command by cleaning up subsystem
shutdown logic
ACPI: Enable build of AML interpreter debugger
ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode

 drivers/acpi/Kconfig                      |    9 +
 drivers/acpi/acpica/Makefile              |   16 +
 drivers/acpi/acpica/acapps.h              |    2 +-
 drivers/acpi/acpica/acdebug.h             |    6 +
 drivers/acpi/acpica/acglobal.h            |    6 +-
 drivers/acpi/acpica/acinterp.h            |    2 -
 drivers/acpi/acpica/aclocal.h             |   14 +-
 drivers/acpi/acpica/acnamesp.h            |    4 -
 drivers/acpi/acpica/acopcode.h            |    4 +-
 drivers/acpi/acpica/acparser.h            |    4 -
 drivers/acpi/acpica/acutils.h             |    2 -
 drivers/acpi/acpica/amlcode.h             |   11 +-
 drivers/acpi/acpica/dbcmds.c              | 1187 +++++++++++++++++++++++++++
 drivers/acpi/acpica/dbconvert.c           |  484 +++++++++++
 drivers/acpi/acpica/dbdisply.c            | 1108 +++++++++++++++++++++++++
 drivers/acpi/acpica/dbexec.c              |  763 +++++++++++++++++
 drivers/acpi/acpica/dbfileio.c            |  256 ++++++
 drivers/acpi/acpica/dbhistry.c            |  239 ++++++
 drivers/acpi/acpica/dbinput.c             | 1267 +++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbmethod.c            |  369 +++++++++
 drivers/acpi/acpica/dbnames.c             |  947 +++++++++++++++++++++
 drivers/acpi/acpica/dbobject.c            |  533 ++++++++++++
 drivers/acpi/acpica/dbstats.c             |  546 +++++++++++++
 drivers/acpi/acpica/dbtest.c              | 1057 ++++++++++++++++++++++++
 drivers/acpi/acpica/dbutils.c             |  457 +++++++++++
 drivers/acpi/acpica/dbxface.c             |  487 +++++++++++
 drivers/acpi/acpica/evxface.c             |    2 +-
 drivers/acpi/acpica/exconvrt.c            |    1 +
 drivers/acpi/acpica/exresolv.c            |    1 -
 drivers/acpi/acpica/exresop.c             |    2 +
 drivers/acpi/acpica/exstore.c             |  120 ++-
 drivers/acpi/acpica/exstoren.c            |    5 +-
 drivers/acpi/acpica/nsdump.c              |    6 -
 drivers/acpi/acpica/nspredef.c            |    2 +-
 drivers/acpi/acpica/pstree.c              |    2 -
 drivers/acpi/acpica/psutils.c             |    2 -
 drivers/acpi/acpica/rsdump.c              |    3 -
 drivers/acpi/acpica/rsutils.c             |    2 -
 drivers/acpi/acpica/rsxface.c             |    4 +-
 drivers/acpi/acpica/utdecode.c            |   21 +-
 drivers/acpi/acpica/utfileio.c            |    6 +
 drivers/acpi/acpica/utinit.c              |   15 +-
 drivers/acpi/acpica/utmutex.c             |   21 +
 drivers/acpi/acpica/utxface.c             |   19 +-
 drivers/acpi/nfit.c                       |    6 +-
 drivers/acpi/nfit.h                       |    2 +-
 drivers/acpi/osl.c                        |   11 +-
 include/acpi/acexcep.h                    |    7 +-
 include/acpi/acpixf.h                     |   12 +-
 include/acpi/actbl1.h                     |    2 +-
 include/acpi/platform/acenv.h             |    8 +-
 include/acpi/platform/aclinux.h           |    7 +-
 include/acpi/platform/aclinuxex.h         |    5 +
 tools/power/acpi/tools/acpidump/apfiles.c |    2 +-
 54 files changed, 9941 insertions(+), 135 deletions(-)
 create mode 100644 drivers/acpi/acpica/dbcmds.c
 create mode 100644 drivers/acpi/acpica/dbconvert.c
 create mode 100644 drivers/acpi/acpica/dbdisply.c
 create mode 100644 drivers/acpi/acpica/dbexec.c
 create mode 100644 drivers/acpi/acpica/dbfileio.c
 create mode 100644 drivers/acpi/acpica/dbhistry.c
 create mode 100644 drivers/acpi/acpica/dbinput.c
 create mode 100644 drivers/acpi/acpica/dbmethod.c
 create mode 100644 drivers/acpi/acpica/dbnames.c
 create mode 100644 drivers/acpi/acpica/dbobject.c
 create mode 100644 drivers/acpi/acpica/dbstats.c
 create mode 100644 drivers/acpi/acpica/dbtest.c
 create mode 100644 drivers/acpi/acpica/dbutils.c
 create mode 100644 drivers/acpi/acpica/dbxface.c
Signature · 1 line
1.7.10
author
#1 lore raw

PATCH 1/13 ACPICA: Remove unnecessary conditional compilation.

From: Bob Moore <[email protected]>

ACPICA commit eea1f0e561893b6d6417913b2d224082fe3a0a5e

Remove use of ACPI_DEBUGGER and ACPI_DISASSEMBLER where these defines are used around entire modules.

Note: This type of code also causes problems with IDEs.

---
 drivers/acpi/acpica/acdebug.h |    6 ++++++
 drivers/acpi/acpica/rsdump.c  |    3 ---
 include/acpi/platform/acenv.h |    2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)
drivers/acpi/acpica/acdebug.h +6 -0
index eb2e926..c928ba4 100644
@@ -44,6 +44,12 @@
 #ifndef __ACDEBUG_H__
 #define __ACDEBUG_H__
 
+/* The debugger is used in conjunction with the disassembler most of time */
+
+#ifdef ACPI_DISASSEMBLER
+#include "acdisasm.h"
+#endif
+
 #define ACPI_DEBUG_BUFFER_SIZE  0x4000	/* 16K buffer for return objects */
 
 struct acpi_db_command_info {
drivers/acpi/acpica/rsdump.c +0 -3
index c428bb3..2a09288 100644
@@ -51,7 +51,6 @@ ACPI_MODULE_NAME("rsdump")
 /*
  * All functions in this module are used by the AML Debugger only
  */
-#if defined(ACPI_DEBUGGER)
 /* Local prototypes */
 static void acpi_rs_out_string(char *title, char *value);
 
@@ -565,5 +564,3 @@ static void acpi_rs_dump_word_list(u16 length, u16 *data)
 		acpi_os_printf("%25s%2.2X : %4.4X\n", "Word", i, data[i]);
 	}
 }
-
-#endif
include/acpi/platform/acenv.h +1 -1
index ec00e2b..15ef08c 100644
@@ -142,7 +142,7 @@
 
 #ifdef ACPI_LIBRARY
 #define ACPI_USE_LOCAL_CACHE
-#define ACPI_FUTURE_USAGE
+#define ACPI_FULL_DEBUG
 #endif
 
 /* Common for all ACPICA applications */
Signature · 1 line
1.7.10
author
#6 lore raw

PATCH 2/13 ACPICA: iASL: Add symbolic operator support for Index() operator.

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit fbe67c46830f10c839941f8512cac5bddcb86bd3

Index (XXXX, 2) is now supported by XXXX [2]

This patch doesn't affect Linux kernel.

---
 drivers/acpi/acpica/aclocal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/aclocal.h +1 -1
index 6f70826..8a66fef 100644
@@ -848,7 +848,7 @@ struct acpi_parse_state {
 #define ACPI_PARSEOP_PARAMLIST          0x02
 #define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
 #define ACPI_PARSEOP_PREDEF_CHECKED     0x08
-#define ACPI_PARSEOP_SPECIAL            0x10
+#define ACPI_PARSEOP_CLOSING_PAREN      0x10
 #define ACPI_PARSEOP_COMPOUND           0x20
 #define ACPI_PARSEOP_ASSIGNMENT         0x40
 
Signature · 1 line
1.7.10
author
#7 lore raw

PATCH 3/13 ACPICA: Update exception code for "file not found" error

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit ac1564c26d239348ef13455f61d5616f3961ff43

Used by the ACPICA applications.

This patch is a bit broken due to non-portable <errno.h> inclusion as on some platforms, there is no such a header file for their lib-c exports. Fortunately, Linux doesn't compile utfileio.c for either the kernel space ACPICA core (drivers/acpi/acpica) or the userspace ACPICA tools (tools/power/acpi) for now, so it's safe to leave this patch as it is.

---
 drivers/acpi/acpica/utfileio.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/acpi/acpica/utfileio.c +6 -0
index 75a94f5..d435b7b 100644
@@ -45,6 +45,7 @@
 #include "accommon.h"
 #include "actables.h"
 #include "acapps.h"
+#include "errno.h"
 
 #ifdef ACPI_ASL_COMPILER
 #include "aslcompiler.h"
@@ -301,6 +302,11 @@ acpi_ut_read_table_from_file(char *filename, struct acpi_table_header ** table)
 	file = fopen(filename, "rb");
 	if (!file) {
 		perror("Could not open input file");
+
+		if (errno == ENOENT) {
+			return (AE_NOT_EXIST);
+		}
+
 		return (status);
 	}
 
Signature · 1 line
1.7.10
author
#8 lore raw

PATCH 4/13 ACPICA: Debugger: Update mutexes used for multithreaded debugger

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 6b2701f619040e803313363f516b200e362a9100

Make these mutex objects independent of the deadlock detection mechanism. This mechanism caused failures with the multithread debugger.

This patch doesn't affect Linux kernel as debugger is currently not fully functioning in the Linux kernel. And the further debugger cleanups will take care of handling debugger command signalling correctly instead of using such kind of mutexes. So it is safe to leave this patch as it is.

---
 drivers/acpi/acpica/acglobal.h |    3 +++
 drivers/acpi/acpica/aclocal.h  |    4 +---
 drivers/acpi/acpica/utdecode.c |    2 --
 drivers/acpi/acpica/utmutex.c  |   21 +++++++++++++++++++++
 include/acpi/platform/acenv.h  |    6 +++---
 5 files changed, 28 insertions(+), 8 deletions(-)
drivers/acpi/acpica/acglobal.h +3 -0
index 09f37b5..593de41 100644
@@ -357,6 +357,9 @@ ACPI_GLOBAL(u16, acpi_gbl_node_type_count_misc);
 ACPI_GLOBAL(u32, acpi_gbl_num_nodes);
 ACPI_GLOBAL(u32, acpi_gbl_num_objects);
 
+ACPI_GLOBAL(acpi_mutex, acpi_gbl_db_command_ready);
+ACPI_GLOBAL(acpi_mutex, acpi_gbl_db_command_complete);
+
 #endif				/* ACPI_DEBUGGER */
 
 /*****************************************************************************
drivers/acpi/acpica/aclocal.h +1 -3
index 8a66fef..918f70d 100644
@@ -83,10 +83,8 @@ union acpi_parse_object;
 #define ACPI_MTX_EVENTS                 3	/* Data for ACPI events */
 #define ACPI_MTX_CACHES                 4	/* Internal caches, general purposes */
 #define ACPI_MTX_MEMORY                 5	/* Debug memory tracking lists */
-#define ACPI_MTX_DEBUG_CMD_COMPLETE     6	/* AML debugger */
-#define ACPI_MTX_DEBUG_CMD_READY        7	/* AML debugger */
 
-#define ACPI_MAX_MUTEX                  7
+#define ACPI_MAX_MUTEX                  5
 #define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
 
 /* Lock structure for reader/writer interfaces */
drivers/acpi/acpica/utdecode.c +0 -2
index 988e23b..d452a78 100644
@@ -407,8 +407,6 @@ static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
 	"ACPI_MTX_Events",
 	"ACPI_MTX_Caches",
 	"ACPI_MTX_Memory",
-	"ACPI_MTX_CommandComplete",
-	"ACPI_MTX_CommandReady"
 };
 
 char *acpi_ut_get_mutex_name(u32 mutex_id)
drivers/acpi/acpica/utmutex.c +21 -0
index 37b8b58..ce406e3 100644
@@ -108,6 +108,21 @@ acpi_status acpi_ut_mutex_initialize(void)
 	/* Create the reader/writer lock for namespace access */
 
 	status = acpi_ut_create_rw_lock(&acpi_gbl_namespace_rw_lock);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+#ifdef ACPI_DEBUGGER
+
+	/* Debugger Support */
+
+	status = acpi_os_create_mutex(&acpi_gbl_db_command_ready);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	status = acpi_os_create_mutex(&acpi_gbl_db_command_complete);
+#endif
+
 	return_ACPI_STATUS(status);
 }
 
@@ -147,6 +162,12 @@ void acpi_ut_mutex_terminate(void)
 	/* Delete the reader/writer lock */
 
 	acpi_ut_delete_rw_lock(&acpi_gbl_namespace_rw_lock);
+
+#ifdef ACPI_DEBUGGER
+	acpi_os_delete_mutex(acpi_gbl_db_command_ready);
+	acpi_os_delete_mutex(acpi_gbl_db_command_complete);
+#endif
+
 	return_VOID;
 }
 
include/acpi/platform/acenv.h +3 -3
index 15ef08c..056f245 100644
@@ -304,11 +304,11 @@
  * multi-threaded if ACPI_APPLICATION is not set.
  */
 #ifndef DEBUGGER_THREADING
-#ifdef ACPI_APPLICATION
-#define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
+#if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
+#define DEBUGGER_THREADING          DEBUGGER_MULTI_THREADED
 
 #else
-#define DEBUGGER_THREADING          DEBUGGER_MULTI_THREADED
+#define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
 #endif
 #endif				/* !DEBUGGER_THREADING */
 
Signature · 1 line
1.7.10
author
#9 lore raw

PATCH 5/13 ACPICA: Update NFIT table to rename a flags field

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 534deab97fb416a13bfede15c538e2c9eac9384a

Updated one of the memory subtable flags to clarify.

---
 drivers/acpi/nfit.c   |    6 +++---
 drivers/acpi/nfit.h   |    2 +-
 include/acpi/actbl1.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/nfit.c +3 -3
index c1b8d03..bc18aa2 100644
@@ -706,7 +706,7 @@ static ssize_t flags_show(struct device *dev,
 		flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
 		flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail " : "",
 		flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : "",
-		flags & ACPI_NFIT_MEM_ARMED ? "not_armed " : "",
+		flags & ACPI_NFIT_MEM_NOT_ARMED ? "not_armed " : "",
 		flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " : "");
 }
 static DEVICE_ATTR_RO(flags);
@@ -815,7 +815,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
 			flags |= NDD_ALIASING;
 
 		mem_flags = __to_nfit_memdev(nfit_mem)->flags;
-		if (mem_flags & ACPI_NFIT_MEM_ARMED)
+		if (mem_flags & ACPI_NFIT_MEM_NOT_ARMED)
 			flags |= NDD_UNARMED;
 
 		rc = acpi_nfit_add_dimm(acpi_desc, nfit_mem, device_handle);
@@ -839,7 +839,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
 		  mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? " save_fail" : "",
 		  mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? " restore_fail":"",
 		  mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? " flush_fail" : "",
-		  mem_flags & ACPI_NFIT_MEM_ARMED ? " not_armed" : "");
+		  mem_flags & ACPI_NFIT_MEM_NOT_ARMED ? " not_armed" : "");
 
 	}
 
drivers/acpi/nfit.h +1 -1
index 7e74015..329a1eb 100644
@@ -24,7 +24,7 @@
 #define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"
 #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
 		| ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
-		| ACPI_NFIT_MEM_ARMED)
+		| ACPI_NFIT_MEM_NOT_ARMED)
 
 enum nfit_uuids {
 	NFIT_SPA_VOLATILE,
include/acpi/actbl1.h +1 -1
index fcd5709..1bb979e 100644
@@ -1012,7 +1012,7 @@ struct acpi_nfit_memory_map {
 #define ACPI_NFIT_MEM_SAVE_FAILED       (1)	/* 00: Last SAVE to Memory Device failed */
 #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)	/* 01: Last RESTORE from Memory Device failed */
 #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)	/* 02: Platform flush failed */
-#define ACPI_NFIT_MEM_ARMED             (1<<3)	/* 03: Memory Device observed to be not armed */
+#define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
 #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
 #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
 
Signature · 1 line
1.7.10
author
#10 lore raw

PATCH 6/13 ACPICA: Improve typechecking, both compile-time and runtime

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 8d0f96e2a11a4ceabb2cae4b41e0ce1f4d3786b9

Adds much stricter typechecking in the iASL compiler, and also adds some additional checking in the interpreter.

---
 drivers/acpi/acpica/aclocal.h  |    8 ++-
 drivers/acpi/acpica/acopcode.h |    4 +-
 drivers/acpi/acpica/amlcode.h  |   11 ++--
 drivers/acpi/acpica/exconvrt.c |    1 +
 drivers/acpi/acpica/exresolv.c |    1 -
 drivers/acpi/acpica/exresop.c  |    2 +
 drivers/acpi/acpica/exstore.c  |  120 ++++++++++++++++++++++++++++++----------
 drivers/acpi/acpica/exstoren.c |    5 +-
 drivers/acpi/acpica/nspredef.c |    2 +-
 drivers/acpi/acpica/utdecode.c |   19 ++++++-
 include/acpi/acexcep.h         |    7 ++-
 11 files changed, 134 insertions(+), 46 deletions(-)
drivers/acpi/acpica/aclocal.h +6 -2
index 918f70d..4e41b43 100644
@@ -285,13 +285,17 @@ acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
 #define ACPI_BTYPE_BUFFER_FIELD         0x00002000
 #define ACPI_BTYPE_DDB_HANDLE           0x00004000
 #define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
-#define ACPI_BTYPE_REFERENCE            0x00010000
+#define ACPI_BTYPE_REFERENCE_OBJECT     0x00010000	/* From Index(), ref_of(), etc (type6_opcodes) */
 #define ACPI_BTYPE_RESOURCE             0x00020000
+#define ACPI_BTYPE_NAMED_REFERENCE      0x00040000	/* Generic unresolved Name or Namepath */
 
 #define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
 
 #define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
-#define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
+
+	/* Used by Copy, de_ref_of, Store, Printf, Fprintf */
+
+#define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE)
 #define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
 #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF	/* ARG or LOCAL */
 #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
drivers/acpi/acpica/acopcode.h +2 -2
index fd85ad0..f9acf92 100644
@@ -211,7 +211,7 @@
 #define ARGI_ARG4                       ARG_NONE
 #define ARGI_ARG5                       ARG_NONE
 #define ARGI_ARG6                       ARG_NONE
-#define ARGI_BANK_FIELD_OP              ARGI_INVALID_OPCODE
+#define ARGI_BANK_FIELD_OP              ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_BIT_AND_OP                 ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_BIT_NAND_OP                ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_BIT_NOR_OP                 ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
@@ -307,7 +307,7 @@
 #define ARGI_SLEEP_OP                   ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_STALL_OP                   ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_STATICSTRING_OP            ARGI_INVALID_OPCODE
-#define ARGI_STORE_OP                   ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF)
+#define ARGI_STORE_OP                   ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_STORE_TARGET)
 #define ARGI_STRING_OP                  ARGI_INVALID_OPCODE
 #define ARGI_SUBTRACT_OP                ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_THERMAL_ZONE_OP            ARGI_INVALID_OPCODE
drivers/acpi/acpica/amlcode.h +6 -5
index be9fd00..883f20c 100644
@@ -277,14 +277,15 @@
 #define ARGI_TARGETREF              0x0F	/* Target, subject to implicit conversion */
 #define ARGI_FIXED_TARGET           0x10	/* Target, no implicit conversion */
 #define ARGI_SIMPLE_TARGET          0x11	/* Name, Local, Arg -- no implicit conversion */
+#define ARGI_STORE_TARGET           0x12	/* Target for store is TARGETREF + package objects */
 
 /* Multiple/complex types */
 
-#define ARGI_DATAOBJECT             0x12	/* Buffer, String, package or reference to a node - Used only by size_of operator */
-#define ARGI_COMPLEXOBJ             0x13	/* Buffer, String, or package (Used by INDEX op only) */
-#define ARGI_REF_OR_STRING          0x14	/* Reference or String (Used by DEREFOF op only) */
-#define ARGI_REGION_OR_BUFFER       0x15	/* Used by LOAD op only */
-#define ARGI_DATAREFOBJ             0x16
+#define ARGI_DATAOBJECT             0x13	/* Buffer, String, package or reference to a node - Used only by size_of operator */
+#define ARGI_COMPLEXOBJ             0x14	/* Buffer, String, or package (Used by INDEX op only) */
+#define ARGI_REF_OR_STRING          0x15	/* Reference or String (Used by DEREFOF op only) */
+#define ARGI_REGION_OR_BUFFER       0x16	/* Used by LOAD op only */
+#define ARGI_DATAREFOBJ             0x17
 
 /* Note: types above can expand to 0x1F maximum */
 
drivers/acpi/acpica/exconvrt.c +1 -0
index 075d654..1e4c5b6 100644
@@ -618,6 +618,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
 		break;
 
 	case ARGI_TARGETREF:
+	case ARGI_STORE_TARGET:
 
 		switch (destination_type) {
 		case ACPI_TYPE_INTEGER:
drivers/acpi/acpica/exresolv.c +0 -1
index 7b10912..a1afe1a 100644
@@ -209,7 +209,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 					 * (i.e., dereference the package index)
 					 * Delete the ref object, increment the returned object
 					 */
-					acpi_ut_remove_reference(stack_desc);
 					acpi_ut_add_reference(obj_desc);
 					*stack_ptr = obj_desc;
 				} else {
drivers/acpi/acpica/exresop.c +2 -0
index d2964af..424442d 100644
@@ -307,6 +307,8 @@ acpi_ex_resolve_operands(u16 opcode,
 		case ARGI_TARGETREF:	/* Allows implicit conversion rules before store */
 		case ARGI_FIXED_TARGET:	/* No implicit conversion before store to target */
 		case ARGI_SIMPLE_TARGET:	/* Name, Local, or arg - no implicit conversion  */
+		case ARGI_STORE_TARGET:
+
 			/*
 			 * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
 			 * A Namespace Node is OK as-is
drivers/acpi/acpica/exstore.c +91 -29

186 lines not on this page · raw message

drivers/acpi/acpica/exstoren.c +3 -2
index 3101607..d1841de 100644
@@ -122,9 +122,10 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
 			/* Conversion successful but still not a valid type */
 
 			ACPI_ERROR((AE_INFO,
-				    "Cannot assign type %s to %s (must be type Int/Str/Buf)",
+				    "Cannot assign type [%s] to [%s] (must be type Int/Str/Buf)",
 				    acpi_ut_get_object_type_name(source_desc),
 				    acpi_ut_get_type_name(target_type)));
+
 			status = AE_AML_OPERAND_TYPE;
 		}
 		break;
@@ -275,7 +276,7 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
 		/*
 		 * All other types come here.
 		 */
-		ACPI_WARNING((AE_INFO, "Store into type %s not implemented",
+		ACPI_WARNING((AE_INFO, "Store into type [%s] not implemented",
 			      acpi_ut_get_object_type_name(dest_desc)));
 
 		status = AE_NOT_IMPLEMENTED;
drivers/acpi/acpica/nspredef.c +1 -1
index 0eb5431..0c20980 100644
@@ -226,7 +226,7 @@ acpi_ns_check_object_type(struct acpi_evaluate_info *info,
 {
 	union acpi_operand_object *return_object = *return_object_ptr;
 	acpi_status status = AE_OK;
-	char type_buffer[48];	/* Room for 5 types */
+	char type_buffer[96];	/* Room for 10 types */
 
 	/* A Namespace node should not get here, but make sure */
 
drivers/acpi/acpica/utdecode.c +17 -2
index d452a78..ecaaaff 100644
@@ -232,12 +232,27 @@ char *acpi_ut_get_type_name(acpi_object_type type)
 
 char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
 {
+	ACPI_FUNCTION_TRACE(ut_get_object_type_name);
 
 	if (!obj_desc) {
-		return ("[NULL Object Descriptor]");
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
+		return_PTR("[NULL Object Descriptor]");
 	}
 
-	return (acpi_ut_get_type_name(obj_desc->common.type));
+	/* These descriptor types share a common area */
+
+	if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) &&
+	    (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_NAMED)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n",
+				  ACPI_GET_DESCRIPTOR_TYPE(obj_desc),
+				  acpi_ut_get_descriptor_name(obj_desc),
+				  obj_desc));
+
+		return_PTR("Invalid object");
+	}
+
+	return_PTR(acpi_ut_get_type_name(obj_desc->common.type));
 }
 
 /*******************************************************************************
include/acpi/acexcep.h +5 -2
index 9f20eb4a..204f581 100644
@@ -193,8 +193,9 @@ struct acpi_exception_info {
 #define AE_AML_ILLEGAL_ADDRESS          EXCEP_AML (0x0020)
 #define AE_AML_INFINITE_LOOP            EXCEP_AML (0x0021)
 #define AE_AML_UNINITIALIZED_NODE       EXCEP_AML (0x0022)
+#define AE_AML_TARGET_TYPE              EXCEP_AML (0x0023)
 
-#define AE_CODE_AML_MAX                 0x0022
+#define AE_CODE_AML_MAX                 0x0023
 
 /*
  * Internal exceptions used for control
@@ -358,7 +359,9 @@ static const struct acpi_exception_info acpi_gbl_exception_names_aml[] = {
 	EXCEP_TXT("AE_AML_INFINITE_LOOP",
 		  "An apparent infinite AML While loop, method was aborted"),
 	EXCEP_TXT("AE_AML_UNINITIALIZED_NODE",
-		  "A namespace node is uninitialized or unresolved")
+		  "A namespace node is uninitialized or unresolved"),
+	EXCEP_TXT("AE_AML_TARGET_TYPE",
+		  "A target operand of an incorrect type was encountered")
 };
 
 static const struct acpi_exception_info acpi_gbl_exception_names_ctrl[] = {
Signature · 1 line
1.7.10
author
#11 lore raw

PATCH 7/13 ACPICA: iASL: General cleanup of the file suffix #defines

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit bed456ed2976bdaafdef406b982fdf6c539befc0

Removed some extraneous defines, reordered others.

---
 drivers/acpi/acpica/acapps.h              |    2 +-
 tools/power/acpi/tools/acpidump/apfiles.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/acapps.h +1 -1
index e9f0833..e4cc48f 100644
@@ -88,7 +88,7 @@
 	acpi_os_printf (" %-18s%s\n", name, description);
 
 #define FILE_SUFFIX_DISASSEMBLY     "dsl"
-#define ACPI_TABLE_FILE_SUFFIX      ".dat"
+#define FILE_SUFFIX_BINARY_TABLE    ".dat"	/* Needs the dot */
 
 /*
  * getopt
tools/power/acpi/tools/acpidump/apfiles.c +1 -1
index a37f970..a1c62de 100644
@@ -150,7 +150,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
 		strcat(filename, instance_str);
 	}
 
-	strcat(filename, ACPI_TABLE_FILE_SUFFIX);
+	strcat(filename, FILE_SUFFIX_BINARY_TABLE);
 
 	if (gbl_verbose_mode) {
 		acpi_log_error
Signature · 1 line
1.7.10
author
#12 lore raw

PATCH 8/13 ACPICA: Linuxize: Export debugger files to Linux

In reply to Lv Zheng

ACPICA commit bc2d3daa4bd429611451f28800def9fea55e63de

This patch exports debugger files to Linux.

---
 drivers/acpi/acpica/dbcmds.c    | 1187 ++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbconvert.c |  484 +++++++++++++++
 drivers/acpi/acpica/dbdisply.c  | 1108 ++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbexec.c    |  753 +++++++++++++++++++++++
 drivers/acpi/acpica/dbfileio.c  |  256 ++++++++
 drivers/acpi/acpica/dbhistry.c  |  239 ++++++++
 drivers/acpi/acpica/dbinput.c   | 1274 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbmethod.c  |  369 ++++++++++++
 drivers/acpi/acpica/dbnames.c   |  947 +++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbobject.c  |  533 ++++++++++++++++
 drivers/acpi/acpica/dbstats.c   |  546 +++++++++++++++++
 drivers/acpi/acpica/dbtest.c    | 1057 ++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbutils.c   |  457 ++++++++++++++
 drivers/acpi/acpica/dbxface.c   |  467 ++++++++++++++
 14 files changed, 9677 insertions(+)
 create mode 100644 drivers/acpi/acpica/dbcmds.c
 create mode 100644 drivers/acpi/acpica/dbconvert.c
 create mode 100644 drivers/acpi/acpica/dbdisply.c
 create mode 100644 drivers/acpi/acpica/dbexec.c
 create mode 100644 drivers/acpi/acpica/dbfileio.c
 create mode 100644 drivers/acpi/acpica/dbhistry.c
 create mode 100644 drivers/acpi/acpica/dbinput.c
 create mode 100644 drivers/acpi/acpica/dbmethod.c
 create mode 100644 drivers/acpi/acpica/dbnames.c
 create mode 100644 drivers/acpi/acpica/dbobject.c
 create mode 100644 drivers/acpi/acpica/dbstats.c
 create mode 100644 drivers/acpi/acpica/dbtest.c
 create mode 100644 drivers/acpi/acpica/dbutils.c
 create mode 100644 drivers/acpi/acpica/dbxface.c
drivers/acpi/acpica/dbcmds.c new file +1187 -0
new file mode 100644
index 0000000..30414b3
@@ -0,0 +1,1187 @@
+/*******************************************************************************
+ *
+ * Module Name: dbcmds - Miscellaneous debug commands and output routines
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <acpi/acpi.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acdebug.h"
+#include "acnamesp.h"
+#include "acresrc.h"
+#include "actables.h"
+
+#define _COMPONENT          ACPI_CA_DEBUGGER
+ACPI_MODULE_NAME("dbcmds")
+
+/* Local prototypes */
+static void
+acpi_dm_compare_aml_resources(u8 *aml1_buffer,
+			      acpi_rsdesc_size aml1_buffer_length,
+			      u8 *aml2_buffer,
+			      acpi_rsdesc_size aml2_buffer_length);
+
+static acpi_status
+acpi_dm_test_resource_conversion(struct acpi_namespace_node *node, char *name);
+
+static acpi_status
+acpi_db_resource_callback(struct acpi_resource *resource, void *context);
+
+static acpi_status
+acpi_db_device_resources(acpi_handle obj_handle,
+			 u32 nesting_level, void *context, void **return_value);
+
+static void acpi_db_do_one_sleep_state(u8 sleep_state);
+
+static char *acpi_db_trace_method_name = NULL;
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_convert_to_node
+ *
+ * PARAMETERS:  in_string           - String to convert
+ *
+ * RETURN:      Pointer to a NS node
+ *
+ * DESCRIPTION: Convert a string to a valid NS pointer. Handles numeric or
+ *              alphanumeric strings.
+ *
+ ******************************************************************************/
+
+struct acpi_namespace_node *acpi_db_convert_to_node(char *in_string)
+{
+	struct acpi_namespace_node *node;
+	acpi_size address;
+
+	if ((*in_string >= 0x30) && (*in_string <= 0x39)) {
+
+		/* Numeric argument, convert */
+
+		address = strtoul(in_string, NULL, 16);
+		node = ACPI_TO_POINTER(address);
+		if (!acpi_os_readable(node, sizeof(struct acpi_namespace_node))) {
+			acpi_os_printf("Address %p is invalid", node);
+			return (NULL);
+		}
+
+		/* Make sure pointer is valid NS node */
+
+		if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
+			acpi_os_printf
+			    ("Address %p is not a valid namespace node [%s]\n",
+			     node, acpi_ut_get_descriptor_name(node));
+			return (NULL);
+		}
+	} else {
+		/*
+		 * Alpha argument: The parameter is a name string that must be
+		 * resolved to a Namespace object.
+		 */
+		node = acpi_db_local_ns_lookup(in_string);
+		if (!node) {
+			acpi_os_printf
+			    ("Could not find [%s] in namespace, defaulting to root node\n",
+			     in_string);
+			node = acpi_gbl_root_node;
+		}
+	}
+
+	return (node);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_sleep
+ *
+ * PARAMETERS:  object_arg          - Desired sleep state (0-5). NULL means
+ *                                    invoke all possible sleep states.
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Simulate sleep/wake sequences
+ *
+ ******************************************************************************/
+
+acpi_status acpi_db_sleep(char *object_arg)
+{
+	u8 sleep_state;
+	u32 i;
+
+	ACPI_FUNCTION_TRACE(acpi_db_sleep);
+
+	/* Null input (no arguments) means to invoke all sleep states */
+
+	if (!object_arg) {
+		acpi_os_printf("Invoking all possible sleep states, 0-%d\n",
+			       ACPI_S_STATES_MAX);
+
+		for (i = 0; i <= ACPI_S_STATES_MAX; i++) {
+			acpi_db_do_one_sleep_state((u8)i);
+		}
+
+		return_ACPI_STATUS(AE_OK);
+	}
+
+	/* Convert argument to binary and invoke the sleep state */
+
+	sleep_state = (u8)strtoul(object_arg, NULL, 0);
+	acpi_db_do_one_sleep_state(sleep_state);
+	return_ACPI_STATUS(AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_do_one_sleep_state
+ *
+ * PARAMETERS:  sleep_state         - Desired sleep state (0-5)
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Simulate a sleep/wake sequence
+ *
+ ******************************************************************************/
+
+static void acpi_db_do_one_sleep_state(u8 sleep_state)
+{
+	acpi_status status;
+	u8 sleep_type_a;
+	u8 sleep_type_b;
+
+	/* Validate parameter */
+
+	if (sleep_state > ACPI_S_STATES_MAX) {
+		acpi_os_printf("Sleep state %d out of range (%d max)\n",
+			       sleep_state, ACPI_S_STATES_MAX);
+		return;
+	}
+
+	acpi_os_printf("\n---- Invoking sleep state S%d (%s):\n",
+		       sleep_state, acpi_gbl_sleep_state_names[sleep_state]);
+
+	/* Get the values for the sleep type registers (for display only) */
+
+	status =
+	    acpi_get_sleep_type_data(sleep_state, &sleep_type_a, &sleep_type_b);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("Could not evaluate [%s] method, %s\n",
+			       acpi_gbl_sleep_state_names[sleep_state],
+			       acpi_format_exception(status));
+		return;
+	}
+
+	acpi_os_printf
+	    ("Register values for sleep state S%d: Sleep-A: %.2X, Sleep-B: %.2X\n",
+	     sleep_state, sleep_type_a, sleep_type_b);
+
+	/* Invoke the various sleep/wake interfaces */
+
+	acpi_os_printf("**** Sleep: Prepare to sleep (S%d) ****\n",
+		       sleep_state);
+	status = acpi_enter_sleep_state_prep(sleep_state);
+	if (ACPI_FAILURE(status)) {
+		goto error_exit;
+	}
+
+	acpi_os_printf("**** Sleep: Going to sleep (S%d) ****\n", sleep_state);
+	status = acpi_enter_sleep_state(sleep_state);
+	if (ACPI_FAILURE(status)) {
+		goto error_exit;
+	}
+
+	acpi_os_printf("**** Wake: Prepare to return from sleep (S%d) ****\n",
+		       sleep_state);
+	status = acpi_leave_sleep_state_prep(sleep_state);
+	if (ACPI_FAILURE(status)) {
+		goto error_exit;
+	}
+
+	acpi_os_printf("**** Wake: Return from sleep (S%d) ****\n",
+		       sleep_state);
+	status = acpi_leave_sleep_state(sleep_state);
+	if (ACPI_FAILURE(status)) {
+		goto error_exit;
+	}
+
+	return;
+
+error_exit:
+	ACPI_EXCEPTION((AE_INFO, status, "During invocation of sleep state S%d",
+			sleep_state));
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_display_locks
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display information about internal mutexes.
+ *
+ ******************************************************************************/
+
+void acpi_db_display_locks(void)
+{
+	u32 i;
+
+	for (i = 0; i < ACPI_MAX_MUTEX; i++) {
+		acpi_os_printf("%26s : %s\n", acpi_ut_get_mutex_name(i),
+			       acpi_gbl_mutex_info[i].thread_id ==
+			       ACPI_MUTEX_NOT_ACQUIRED ? "Locked" : "Unlocked");
+	}
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_display_table_info
+ *
+ * PARAMETERS:  table_arg           - Name of table to be displayed
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display information about loaded tables. Current
+ *              implementation displays all loaded tables.
+ *
+ ******************************************************************************/
+
+void acpi_db_display_table_info(char *table_arg)
+{
+	u32 i;
+	struct acpi_table_desc *table_desc;
+	acpi_status status;
+
+	/* Header */
+
+	acpi_os_printf("Idx ID  Status Type                    "
+		       "TableHeader (Sig, Address, Length, Misc)\n");
+
+	/* Walk the entire root table list */
+
+	for (i = 0; i < acpi_gbl_root_table_list.current_table_count; i++) {
+		table_desc = &acpi_gbl_root_table_list.tables[i];
+
+		/* Index and Table ID */
+
+		acpi_os_printf("%3u %.2u ", i, table_desc->owner_id);
+
+		/* Decode the table flags */
+
+		if (!(table_desc->flags & ACPI_TABLE_IS_LOADED)) {
+			acpi_os_printf("NotLoaded ");
+		} else {
+			acpi_os_printf(" Loaded ");
+		}
+
+		switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) {
+		case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+
+			acpi_os_printf("External/virtual ");
+			break;
+
+		case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+			acpi_os_printf("Internal/physical ");
+			break;
+
+		case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+
+			acpi_os_printf("Internal/virtual ");
+			break;
+
+		default:
+
+			acpi_os_printf("INVALID TYPE    ");
+			break;
+		}
+
+		/* Make sure that the table is mapped */
+
+		status = acpi_tb_validate_table(table_desc);
+		if (ACPI_FAILURE(status)) {
+			return;
+		}
+
+		/* Dump the table header */
+
+		if (table_desc->pointer) {
+			acpi_tb_print_table_header(table_desc->address,
+						   table_desc->pointer);
+		} else {
+			/* If the pointer is null, the table has been unloaded */
+
+			ACPI_INFO((AE_INFO, "%4.4s - Table has been unloaded",
+				   table_desc->signature.ascii));
+		}
+	}
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_unload_acpi_table
+ *
+ * PARAMETERS:  object_name         - Namespace pathname for an object that
+ *                                    is owned by the table to be unloaded
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Unload an ACPI table, via any namespace node that is owned
+ *              by the table.
+ *
+ ******************************************************************************/
+
+void acpi_db_unload_acpi_table(char *object_name)
+{
+	struct acpi_namespace_node *node;
+	acpi_status status;
+
+	/* Translate name to an Named object */
+
+	node = acpi_db_convert_to_node(object_name);
+	if (!node) {
+		return;
+	}
+
+	status = acpi_unload_parent_table(ACPI_CAST_PTR(acpi_handle, node));
+	if (ACPI_SUCCESS(status)) {
+		acpi_os_printf("Parent of [%s] (%p) unloaded and uninstalled\n",
+			       object_name, node);
+	} else {
+		acpi_os_printf("%s, while unloading parent table of [%s]\n",
+			       acpi_format_exception(status), object_name);
+	}
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_send_notify
+ *
+ * PARAMETERS:  name                - Name of ACPI object where to send notify
+ *              value               - Value of the notify to send.
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Send an ACPI notification. The value specified is sent to the
+ *              named object as an ACPI notify.
+ *
+ ******************************************************************************/
+
+void acpi_db_send_notify(char *name, u32 value)
+{
+	struct acpi_namespace_node *node;
+	acpi_status status;
+
+	/* Translate name to an Named object */
+
+	node = acpi_db_convert_to_node(name);
+	if (!node) {
+		return;
+	}
+
+	/* Dispatch the notify if legal */
+
+	if (acpi_ev_is_notify_object(node)) {
+		status = acpi_ev_queue_notify_request(node, value);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("Could not queue notify\n");
+		}
+	} else {
+		acpi_os_printf("Named object [%4.4s] Type %s, "
+			       "must be Device/Thermal/Processor type\n",
+			       acpi_ut_get_node_name(node),
+			       acpi_ut_get_type_name(node->type));
+	}
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_display_interfaces
+ *
+ * PARAMETERS:  action_arg          - Null, "install", or "remove"
+ *              interface_name_arg  - Name for install/remove options
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display or modify the global _OSI interface list
+ *
+ ******************************************************************************/
+
+void acpi_db_display_interfaces(char *action_arg, char *interface_name_arg)
+{
+	struct acpi_interface_info *next_interface;
+	char *sub_string;
+	acpi_status status;
+
+	/* If no arguments, just display current interface list */
+
+	if (!action_arg) {
+		(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex,
+					    ACPI_WAIT_FOREVER);
+
+		next_interface = acpi_gbl_supported_interfaces;
+		while (next_interface) {
+			if (!(next_interface->flags & ACPI_OSI_INVALID)) {
+				acpi_os_printf("%s\n", next_interface->name);
+			}
+
+			next_interface = next_interface->next;
+		}
+
+		acpi_os_release_mutex(acpi_gbl_osi_mutex);
+		return;
+	}
+
+	/* If action_arg exists, so must interface_name_arg */
+
+	if (!interface_name_arg) {
+		acpi_os_printf("Missing Interface Name argument\n");
+		return;
+	}
+
+	/* Uppercase the action for match below */
+
+	acpi_ut_strupr(action_arg);
+
+	/* install - install an interface */
+
+	sub_string = strstr("INSTALL", action_arg);
+	if (sub_string) {
+		status = acpi_install_interface(interface_name_arg);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("%s, while installing \"%s\"\n",
+				       acpi_format_exception(status),
+				       interface_name_arg);
+		}
+		return;
+	}
+
+	/* remove - remove an interface */
+
+	sub_string = strstr("REMOVE", action_arg);
+	if (sub_string) {
+		status = acpi_remove_interface(interface_name_arg);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("%s, while removing \"%s\"\n",
+				       acpi_format_exception(status),
+				       interface_name_arg);
+		}
+		return;
+	}
+
+	/* Invalid action_arg */
+
+	acpi_os_printf("Invalid action argument: %s\n", action_arg);
+	return;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_display_template
+ *
+ * PARAMETERS:  buffer_arg          - Buffer name or address
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Dump a buffer that contains a resource template
+ *
+ ******************************************************************************/
+
+void acpi_db_display_template(char *buffer_arg)
+{
+	struct acpi_namespace_node *node;
+	acpi_status status;
+	struct acpi_buffer return_buffer;
+
+	/* Translate buffer_arg to an Named object */
+
+	node = acpi_db_convert_to_node(buffer_arg);
+	if (!node || (node == acpi_gbl_root_node)) {
+		acpi_os_printf("Invalid argument: %s\n", buffer_arg);
+		return;
+	}
+
+	/* We must have a buffer object */
+
+	if (node->type != ACPI_TYPE_BUFFER) {
+		acpi_os_printf
+		    ("Not a Buffer object, cannot be a template: %s\n",
+		     buffer_arg);
+		return;
+	}
+
+	return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+	return_buffer.pointer = acpi_gbl_db_buffer;
+
+	/* Attempt to convert the raw buffer to a resource list */
+
+	status = acpi_rs_create_resource_list(node->object, &return_buffer);
+
+	acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT);
+	acpi_dbg_level |= ACPI_LV_RESOURCES;
+
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf
+		    ("Could not convert Buffer to a resource list: %s, %s\n",
+		     buffer_arg, acpi_format_exception(status));
+		goto dump_buffer;
+	}
+
+	/* Now we can dump the resource list */
+
+	acpi_rs_dump_resource_list(ACPI_CAST_PTR(struct acpi_resource,
+						 return_buffer.pointer));
+
+dump_buffer:
+	acpi_os_printf("\nRaw data buffer:\n");
+	acpi_ut_debug_dump_buffer((u8 *)node->object->buffer.pointer,
+				  node->object->buffer.length,
+				  DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
+
+	acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT);
+	return;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_dm_compare_aml_resources
+ *
+ * PARAMETERS:  aml1_buffer         - Contains first resource list
+ *              aml1_buffer_length  - Length of first resource list
+ *              aml2_buffer         - Contains second resource list
+ *              aml2_buffer_length  - Length of second resource list
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Compare two AML resource lists, descriptor by descriptor (in
+ *              order to isolate a miscompare to an individual resource)
+ *
+ ******************************************************************************/
+
+static void
+acpi_dm_compare_aml_resources(u8 *aml1_buffer,
+			      acpi_rsdesc_size aml1_buffer_length,
+			      u8 *aml2_buffer,
+			      acpi_rsdesc_size aml2_buffer_length)
+{
+	u8 *aml1;
+	u8 *aml2;
+	u8 *aml1_end;
+	u8 *aml2_end;
+	acpi_rsdesc_size aml1_length;
+	acpi_rsdesc_size aml2_length;
+	acpi_rsdesc_size offset = 0;
+	u8 resource_type;
+	u32 count = 0;
+	u32 i;
+
+	/* Compare overall buffer sizes (may be different due to size rounding) */
+
+	if (aml1_buffer_length != aml2_buffer_length) {
+		acpi_os_printf("**** Buffer length mismatch in converted "
+			       "AML: Original %X, New %X ****\n",
+			       aml1_buffer_length, aml2_buffer_length);
+	}
+
+	aml1 = aml1_buffer;
+	aml2 = aml2_buffer;
+	aml1_end = aml1_buffer + aml1_buffer_length;
+	aml2_end = aml2_buffer + aml2_buffer_length;
+
+	/* Walk the descriptor lists, comparing each descriptor */
+
+	while ((aml1 < aml1_end) && (aml2 < aml2_end)) {
+
+		/* Get the lengths of each descriptor */
+
+		aml1_length = acpi_ut_get_descriptor_length(aml1);
+		aml2_length = acpi_ut_get_descriptor_length(aml2);
+		resource_type = acpi_ut_get_resource_type(aml1);
+
+		/* Check for descriptor length match */
+
+		if (aml1_length != aml2_length) {
+			acpi_os_printf
+			    ("**** Length mismatch in descriptor [%.2X] type %2.2X, "
+			     "Offset %8.8X Len1 %X, Len2 %X ****\n", count,
+			     resource_type, offset, aml1_length, aml2_length);
+		}
+
+		/* Check for descriptor byte match */
+
+		else if (memcmp(aml1, aml2, aml1_length)) {
+			acpi_os_printf
+			    ("**** Data mismatch in descriptor [%.2X] type %2.2X, "
+			     "Offset %8.8X ****\n", count, resource_type,
+			     offset);
+
+			for (i = 0; i < aml1_length; i++) {
+				if (aml1[i] != aml2[i]) {
+					acpi_os_printf
+					    ("Mismatch at byte offset %.2X: is %2.2X, "
+					     "should be %2.2X\n", i, aml2[i],
+					     aml1[i]);
+				}
+			}
+		}
+
+		/* Exit on end_tag descriptor */
+
+		if (resource_type == ACPI_RESOURCE_NAME_END_TAG) {
+			return;
+		}
+
+		/* Point to next descriptor in each buffer */
+
+		count++;
+		offset += aml1_length;
+		aml1 += aml1_length;
+		aml2 += aml2_length;
+	}
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_dm_test_resource_conversion
+ *
+ * PARAMETERS:  node                - Parent device node
+ *              name                - resource method name (_CRS)
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Compare the original AML with a conversion of the AML to
+ *              internal resource list, then back to AML.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_dm_test_resource_conversion(struct acpi_namespace_node *node, char *name)
+{
+	acpi_status status;
+	struct acpi_buffer return_buffer;
+	struct acpi_buffer resource_buffer;
+	struct acpi_buffer new_aml;
+	union acpi_object *original_aml;
+
+	acpi_os_printf("Resource Conversion Comparison:\n");
+
+	new_aml.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+	return_buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+	resource_buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+
+	/* Get the original _CRS AML resource template */
+
+	status = acpi_evaluate_object(node, name, NULL, &return_buffer);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("Could not obtain %s: %s\n",
+			       name, acpi_format_exception(status));
+		return (status);
+	}
+
+	/* Get the AML resource template, converted to internal resource structs */
+
+	status = acpi_get_current_resources(node, &resource_buffer);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("AcpiGetCurrentResources failed: %s\n",
+			       acpi_format_exception(status));
+		goto exit1;
+	}
+
+	/* Convert internal resource list to external AML resource template */
+
+	status = acpi_rs_create_aml_resources(&resource_buffer, &new_aml);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("AcpiRsCreateAmlResources failed: %s\n",
+			       acpi_format_exception(status));
+		goto exit2;
+	}
+
+	/* Compare original AML to the newly created AML resource list */
+
+	original_aml = return_buffer.pointer;
+
+	acpi_dm_compare_aml_resources(original_aml->buffer.pointer,
+				      (acpi_rsdesc_size) original_aml->buffer.
+				      length, new_aml.pointer,
+				      (acpi_rsdesc_size) new_aml.length);
+
+	/* Cleanup and exit */
+
+	ACPI_FREE(new_aml.pointer);
+exit2:
+	ACPI_FREE(resource_buffer.pointer);
+exit1:
+	ACPI_FREE(return_buffer.pointer);
+	return (status);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_resource_callback
+ *
+ * PARAMETERS:  acpi_walk_resource_callback
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Simple callback to exercise acpi_walk_resources and
+ *              acpi_walk_resource_buffer.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_db_resource_callback(struct acpi_resource *resource, void *context)
+{
+
+	return (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_device_resources
+ *
+ * PARAMETERS:  acpi_walk_callback
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Display the _PRT/_CRS/_PRS resources for a device object.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_db_device_resources(acpi_handle obj_handle,
+			 u32 nesting_level, void *context, void **return_value)
+{
+	struct acpi_namespace_node *node;
+	struct acpi_namespace_node *prt_node = NULL;
+	struct acpi_namespace_node *crs_node = NULL;
+	struct acpi_namespace_node *prs_node = NULL;
+	struct acpi_namespace_node *aei_node = NULL;
+	char *parent_path;
+	struct acpi_buffer return_buffer;
+	acpi_status status;
+
+	node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle);
+	parent_path = acpi_ns_get_external_pathname(node);
+	if (!parent_path) {
+		return (AE_NO_MEMORY);
+	}
+
+	/* Get handles to the resource methods for this device */
+
+	(void)acpi_get_handle(node, METHOD_NAME__PRT,
+			      ACPI_CAST_PTR(acpi_handle, &prt_node));
+	(void)acpi_get_handle(node, METHOD_NAME__CRS,
+			      ACPI_CAST_PTR(acpi_handle, &crs_node));
+	(void)acpi_get_handle(node, METHOD_NAME__PRS,
+			      ACPI_CAST_PTR(acpi_handle, &prs_node));
+	(void)acpi_get_handle(node, METHOD_NAME__AEI,
+			      ACPI_CAST_PTR(acpi_handle, &aei_node));
+
+	if (!prt_node && !crs_node && !prs_node && !aei_node) {
+		goto cleanup;	/* Nothing to do */
+	}
+
+	acpi_os_printf("\nDevice: %s\n", parent_path);
+
+	/* Prepare for a return object of arbitrary size */
+
+	return_buffer.pointer = acpi_gbl_db_buffer;
+	return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+	/* _PRT */
+
+	if (prt_node) {
+		acpi_os_printf("Evaluating _PRT\n");
+
+		status =
+		    acpi_evaluate_object(prt_node, NULL, NULL, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("Could not evaluate _PRT: %s\n",
+				       acpi_format_exception(status));
+			goto get_crs;
+		}
+
+		return_buffer.pointer = acpi_gbl_db_buffer;
+		return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+		status = acpi_get_irq_routing_table(node, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("GetIrqRoutingTable failed: %s\n",
+				       acpi_format_exception(status));
+			goto get_crs;
+		}
+
+		acpi_rs_dump_irq_list(ACPI_CAST_PTR(u8, acpi_gbl_db_buffer));
+	}
+
+	/* _CRS */
+
+get_crs:
+	if (crs_node) {
+		acpi_os_printf("Evaluating _CRS\n");
+
+		return_buffer.pointer = acpi_gbl_db_buffer;
+		return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+		status =
+		    acpi_evaluate_object(crs_node, NULL, NULL, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("Could not evaluate _CRS: %s\n",
+				       acpi_format_exception(status));
+			goto get_prs;
+		}
+
+		/* This code exercises the acpi_walk_resources interface */
+
+		status = acpi_walk_resources(node, METHOD_NAME__CRS,
+					     acpi_db_resource_callback, NULL);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("AcpiWalkResources failed: %s\n",
+				       acpi_format_exception(status));
+			goto get_prs;
+		}
+
+		/* Get the _CRS resource list (test ALLOCATE buffer) */
+
+		return_buffer.pointer = NULL;
+		return_buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+
+		status = acpi_get_current_resources(node, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("AcpiGetCurrentResources failed: %s\n",
+				       acpi_format_exception(status));
+			goto get_prs;
+		}
+
+		/* This code exercises the acpi_walk_resource_buffer interface */
+
+		status = acpi_walk_resource_buffer(&return_buffer,
+						   acpi_db_resource_callback,
+						   NULL);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("AcpiWalkResourceBuffer failed: %s\n",
+				       acpi_format_exception(status));
+			goto end_crs;
+		}
+
+		/* Dump the _CRS resource list */
+
+		acpi_rs_dump_resource_list(ACPI_CAST_PTR(struct acpi_resource,
+							 return_buffer.
+							 pointer));
+
+		/*
+		 * Perform comparison of original AML to newly created AML. This
+		 * tests both the AML->Resource conversion and the Resource->AML
+		 * conversion.
+		 */
+		(void)acpi_dm_test_resource_conversion(node, METHOD_NAME__CRS);
+
+		/* Execute _SRS with the resource list */
+
+		acpi_os_printf("Evaluating _SRS\n");
+
+		status = acpi_set_current_resources(node, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("AcpiSetCurrentResources failed: %s\n",
+				       acpi_format_exception(status));
+			goto end_crs;
+		}
+
+end_crs:
+		ACPI_FREE(return_buffer.pointer);
+	}
+
+	/* _PRS */
+
+get_prs:
+	if (prs_node) {
+		acpi_os_printf("Evaluating _PRS\n");
+
+		return_buffer.pointer = acpi_gbl_db_buffer;
+		return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+		status =
+		    acpi_evaluate_object(prs_node, NULL, NULL, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("Could not evaluate _PRS: %s\n",
+				       acpi_format_exception(status));
+			goto get_aei;
+		}
+
+		return_buffer.pointer = acpi_gbl_db_buffer;
+		return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+		status = acpi_get_possible_resources(node, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("AcpiGetPossibleResources failed: %s\n",
+				       acpi_format_exception(status));
+			goto get_aei;
+		}
+
+		acpi_rs_dump_resource_list(ACPI_CAST_PTR
+					   (struct acpi_resource,
+					    acpi_gbl_db_buffer));
+	}
+
+	/* _AEI */
+
+get_aei:
+	if (aei_node) {
+		acpi_os_printf("Evaluating _AEI\n");
+
+		return_buffer.pointer = acpi_gbl_db_buffer;
+		return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+		status =
+		    acpi_evaluate_object(aei_node, NULL, NULL, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("Could not evaluate _AEI: %s\n",
+				       acpi_format_exception(status));
+			goto cleanup;
+		}
+
+		return_buffer.pointer = acpi_gbl_db_buffer;
+		return_buffer.length = ACPI_DEBUG_BUFFER_SIZE;
+
+		status = acpi_get_event_resources(node, &return_buffer);
+		if (ACPI_FAILURE(status)) {
+			acpi_os_printf("AcpiGetEventResources failed: %s\n",
+				       acpi_format_exception(status));
+			goto cleanup;
+		}
+
+		acpi_rs_dump_resource_list(ACPI_CAST_PTR
+					   (struct acpi_resource,
+					    acpi_gbl_db_buffer));
+	}
+
+cleanup:
+	ACPI_FREE(parent_path);
+	return (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_display_resources
+ *
+ * PARAMETERS:  object_arg          - String object name or object pointer.
+ *                                    NULL or "*" means "display resources for
+ *                                    all devices"
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display the resource objects associated with a device.
+ *
+ ******************************************************************************/
+
+void acpi_db_display_resources(char *object_arg)
+{
+	struct acpi_namespace_node *node;
+
+	acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT);
+	acpi_dbg_level |= ACPI_LV_RESOURCES;
+
+	/* Asterisk means "display resources for all devices" */
+
+	if (!object_arg || (!strcmp(object_arg, "*"))) {
+		(void)acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+					  ACPI_UINT32_MAX,
+					  acpi_db_device_resources, NULL, NULL,
+					  NULL);
+	} else {
+		/* Convert string to object pointer */
+
+		node = acpi_db_convert_to_node(object_arg);
+		if (node) {
+			if (node->type != ACPI_TYPE_DEVICE) {
+				acpi_os_printf
+				    ("%4.4s: Name is not a device object (%s)\n",
+				     node->name.ascii,
+				     acpi_ut_get_type_name(node->type));
+			} else {
+				(void)acpi_db_device_resources(node, 0, NULL,
+							       NULL);
+			}
+		}
+	}
+
+	acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT);
+}
+
+#if (!ACPI_REDUCED_HARDWARE)
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_generate_gpe
+ *
+ * PARAMETERS:  gpe_arg             - Raw GPE number, ascii string
+ *              block_arg           - GPE block number, ascii string
+ *                                    0 or 1 for FADT GPE blocks
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Simulate firing of a GPE
+ *
+ ******************************************************************************/
+
+void acpi_db_generate_gpe(char *gpe_arg, char *block_arg)
+{
+	u32 block_number = 0;
+	u32 gpe_number;
+	struct acpi_gpe_event_info *gpe_event_info;
+
+	gpe_number = strtoul(gpe_arg, NULL, 0);
+
+	/*
+	 * If no block arg, or block arg == 0 or 1, use the FADT-defined
+	 * GPE blocks.
+	 */
+	if (block_arg) {
+		block_number = strtoul(block_arg, NULL, 0);
+		if (block_number == 1) {
+			block_number = 0;
+		}
+	}
+
+	gpe_event_info =
+	    acpi_ev_get_gpe_event_info(ACPI_TO_POINTER(block_number),
+				       gpe_number);
+	if (!gpe_event_info) {
+		acpi_os_printf("Invalid GPE\n");
+		return;
+	}
+
+	(void)acpi_ev_gpe_dispatch(NULL, gpe_event_info, gpe_number);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_generate_sci
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Simulate an SCI -- just call the SCI dispatch.
+ *
+ ******************************************************************************/
+
+void acpi_db_generate_sci(void)
+{
+	acpi_ev_sci_dispatch();
+}
+
+#endif				/* !ACPI_REDUCED_HARDWARE */
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_trace
+ *
+ * PARAMETERS:  enable_arg          - ENABLE/AML to enable tracer
+ *                                    DISABLE to disable tracer
+ *              method_arg          - Method to trace
+ *              once_arg            - Whether trace once
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Control method tracing facility
+ *
+ ******************************************************************************/
+
+void acpi_db_trace(char *enable_arg, char *method_arg, char *once_arg)
+{
+	u32 debug_level = 0;
+	u32 debug_layer = 0;
+	u32 flags = 0;
+
+	if (enable_arg) {
+		acpi_ut_strupr(enable_arg);
+	}
+
+	if (once_arg) {
+		acpi_ut_strupr(once_arg);
+	}
+
+	if (method_arg) {
+		if (acpi_db_trace_method_name) {
+			ACPI_FREE(acpi_db_trace_method_name);
+			acpi_db_trace_method_name = NULL;
+		}
+
+		acpi_db_trace_method_name =
+		    ACPI_ALLOCATE(strlen(method_arg) + 1);
+		if (!acpi_db_trace_method_name) {
+			acpi_os_printf("Failed to allocate method name (%s)\n",
+				       method_arg);
+			return;
+		}
+
+		strcpy(acpi_db_trace_method_name, method_arg);
+	}
+
+	if (!strcmp(enable_arg, "ENABLE") ||
+	    !strcmp(enable_arg, "METHOD") || !strcmp(enable_arg, "OPCODE")) {
+		if (!strcmp(enable_arg, "ENABLE")) {
+
+			/* Inherit current console settings */
+
+			debug_level = acpi_gbl_db_console_debug_level;
+			debug_layer = acpi_dbg_layer;
+		} else {
+			/* Restrict console output to trace points only */
+
+			debug_level = ACPI_LV_TRACE_POINT;
+			debug_layer = ACPI_EXECUTER;
+		}
+
+		flags = ACPI_TRACE_ENABLED;
+
+		if (!strcmp(enable_arg, "OPCODE")) {
+			flags |= ACPI_TRACE_OPCODE;
+		}
+
+		if (once_arg && !strcmp(once_arg, "ONCE")) {
+			flags |= ACPI_TRACE_ONESHOT;
+		}
+	}
+
+	(void)acpi_debug_trace(acpi_db_trace_method_name,
+			       debug_level, debug_layer, flags);
+}
drivers/acpi/acpica/dbconvert.c new file +484 -0

484 lines not on this page · raw message

drivers/acpi/acpica/dbdisply.c new file +1108 -0

1,108 lines not on this page · raw message

drivers/acpi/acpica/dbexec.c new file +753 -0

221 lines not on this page · raw message

drivers/acpi/acpica/dbfileio.c new file +256 -0

256 lines not on this page · raw message

drivers/acpi/acpica/dbhistry.c new file +239 -0

239 lines not on this page · raw message

drivers/acpi/acpica/dbinput.c new file +1274 -0

1,274 lines not on this page · raw message

drivers/acpi/acpica/dbmethod.c new file +369 -0

369 lines not on this page · raw message

drivers/acpi/acpica/dbnames.c new file +947 -0

947 lines not on this page · raw message

drivers/acpi/acpica/dbobject.c new file +533 -0

533 lines not on this page · raw message

drivers/acpi/acpica/dbstats.c new file +546 -0

546 lines not on this page · raw message

drivers/acpi/acpica/dbtest.c new file +1057 -0

1,057 lines not on this page · raw message

drivers/acpi/acpica/dbutils.c new file +457 -0

457 lines not on this page · raw message

drivers/acpi/acpica/dbxface.c new file +467 -0

467 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.10

Part of the diff is not shown here. View the raw message.

author
#13 lore raw

PATCH 9/13 ACPICA: Debugger: Fix "quit/exit" command by cleaning up user commands termination logic

In reply to Lv Zheng

ACPICA commit 0dd68e16274cd38224aa4781eddc57dc2cbaa108

The quit/exit commands shouldn't invoke acpi_terminate_debugger() and acpi_terminate() right in the user command loop, because when the debugger exits, the kernel ACPI subsystem shouldn't be terminated (acpi_terminate()) and the debugger should only be terminated by its users (acpi_terminate_debugger()) rather than being terminated itself. Leaving such invocations causes kernel panic when the debugger is shipped in the Linux kernel.

This patch fixes this issue. Lv Zheng.

---
 drivers/acpi/acpica/acglobal.h |    3 ++-
 drivers/acpi/acpica/dbinput.c  |   16 ++++------------
 drivers/acpi/acpica/dbxface.c  |   20 ++++++++++++++++++++
 drivers/acpi/acpica/utinit.c   |    2 --
 drivers/acpi/acpica/utxface.c  |    4 ----
 5 files changed, 26 insertions(+), 19 deletions(-)
drivers/acpi/acpica/acglobal.h +2 -1
index 593de41..d82249c 100644
@@ -324,7 +324,6 @@ ACPI_GLOBAL(struct acpi_external_file *, acpi_gbl_external_file_list);
 
 #ifdef ACPI_DEBUGGER
 
-ACPI_INIT_GLOBAL(u8, acpi_gbl_db_terminate_threads, FALSE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
 
@@ -336,6 +335,8 @@ ACPI_GLOBAL(char *, acpi_gbl_db_filename);
 ACPI_GLOBAL(u32, acpi_gbl_db_debug_level);
 ACPI_GLOBAL(u32, acpi_gbl_db_console_debug_level);
 ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_db_scope_node);
+ACPI_GLOBAL(u8, acpi_gbl_db_terminate_loop);
+ACPI_GLOBAL(u8, acpi_gbl_db_threads_terminated);
 
 ACPI_GLOBAL(char *, acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]);
 ACPI_GLOBAL(acpi_object_type, acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS]);
drivers/acpi/acpica/dbinput.c +4 -12
index 7f1b6ec..f8cddd6 100644
@@ -694,7 +694,7 @@ acpi_db_command_dispatch(char *input_buffer,
 
 	/* If acpi_terminate has been called, terminate this thread */
 
-	if (acpi_gbl_db_terminate_threads) {
+	if (acpi_gbl_db_terminate_loop) {
 		return (AE_CTRL_TERMINATE);
 	}
 
@@ -1116,7 +1116,7 @@ acpi_db_command_dispatch(char *input_buffer,
 #ifdef ACPI_APPLICATION
 		acpi_db_close_debug_file();
 #endif
-		acpi_gbl_db_terminate_threads = TRUE;
+		acpi_gbl_db_terminate_loop = TRUE;
 		return (AE_CTRL_TERMINATE);
 
 	case CMD_NOT_FOUND:
@@ -1166,6 +1166,7 @@ void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context)
 
 		acpi_os_release_mutex(acpi_gbl_db_command_complete);
 	}
+	acpi_gbl_db_threads_terminated = TRUE;
 }
 
 /*******************************************************************************
@@ -1212,7 +1213,7 @@ acpi_status acpi_db_user_commands(char prompt, union acpi_parse_object *op)
 
 	/* TBD: [Restructure] Need a separate command line buffer for step mode */
 
-	while (!acpi_gbl_db_terminate_threads) {
+	while (!acpi_gbl_db_terminate_loop) {
 
 		/* Force output to console until a command is entered */
 
@@ -1261,14 +1262,5 @@ acpi_status acpi_db_user_commands(char prompt, union acpi_parse_object *op)
 		}
 	}
 
-	/* Shut down the debugger */
-
-	acpi_terminate_debugger();
-
-	/*
-	 * Only this thread (the original thread) should actually terminate the
-	 * subsystem, because all the semaphores are deleted during termination
-	 */
-	status = acpi_terminate();
 	return (status);
 }
drivers/acpi/acpica/dbxface.c +20 -0
index 26023bd..bef5f4e 100644
@@ -401,6 +401,10 @@ acpi_status acpi_initialize_debugger(void)
 	acpi_gbl_db_scope_buf[1] = 0;
 	acpi_gbl_db_scope_node = acpi_gbl_root_node;
 
+	/* Initialize user commands loop */
+
+	acpi_gbl_db_terminate_loop = FALSE;
+
 	/*
 	 * If configured for multi-thread support, the debug executor runs in
 	 * a separate thread so that the front end can be in another address
@@ -426,11 +430,13 @@ acpi_status acpi_initialize_debugger(void)
 
 		/* Create the debug execution thread to execute commands */
 
+		acpi_gbl_db_threads_terminated = FALSE;
 		status = acpi_os_execute(OSL_DEBUGGER_THREAD,
 					 acpi_db_execute_thread, NULL);
 		if (ACPI_FAILURE(status)) {
 			ACPI_EXCEPTION((AE_INFO, status,
 					"Could not start debugger thread"));
+			acpi_gbl_db_threads_terminated = TRUE;
 			return_ACPI_STATUS(status);
 		}
 	}
@@ -454,6 +460,20 @@ ACPI_EXPORT_SYMBOL(acpi_initialize_debugger)
 void acpi_terminate_debugger(void)
 {
 
+	/* Terminate the AML Debugger */
+
+	acpi_gbl_db_terminate_loop = TRUE;
+
+	if (acpi_gbl_debugger_configuration & DEBUGGER_MULTI_THREADED) {
+		acpi_os_release_mutex(acpi_gbl_db_command_ready);
+
+		/* Wait the AML Debugger threads */
+
+		while (!acpi_gbl_db_threads_terminated) {
+			acpi_os_sleep(100);
+		}
+	}
+
 	if (acpi_gbl_db_buffer) {
 		acpi_os_free(acpi_gbl_db_buffer);
 		acpi_gbl_db_buffer = NULL;
drivers/acpi/acpica/utinit.c +0 -2
index 28ab3a1..d8699df 100644
@@ -241,8 +241,6 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_gbl_disable_mem_tracking = FALSE;
 #endif
 
-	ACPI_DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = FALSE);
-
 	return_ACPI_STATUS(AE_OK);
 }
 
drivers/acpi/acpica/utxface.c +0 -4
index 4f33281..f183daf 100644
@@ -80,10 +80,6 @@ acpi_status __init acpi_terminate(void)
 	acpi_gbl_startup_flags = 0;
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
 
-	/* Terminate the AML Debugger if present */
-
-	ACPI_DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE);
-
 	/* Shutdown and free all resources */
 
 	acpi_ut_subsystem_shutdown();
Signature · 1 line
1.7.10
author
#14 lore raw

PATCH 10/13 ACPICA: Debugger: Fix "terminate" command by cleaning up subsystem shutdown logic

In reply to Lv Zheng

ACPICA commit 7e823714911480be47e310fb1b3590d289b9fd99

Segmentation fault can be seen for executing the "terminate" command. This is because acpi_ut_subsystem_shutdown() is errnously called multiple times.

This patch cleans up acpi_ut_subsystem_shutdown() logics to fix this issue. Lv Zheng.

---
 drivers/acpi/acpica/dbinput.c |    3 ++-
 drivers/acpi/acpica/utinit.c  |   13 +++++++++++++
 drivers/acpi/acpica/utxface.c |   13 -------------
 3 files changed, 15 insertions(+), 14 deletions(-)
drivers/acpi/acpica/dbinput.c +2 -1
index f8cddd6..0480254 100644
@@ -1074,6 +1074,7 @@ acpi_db_command_dispatch(char *input_buffer,
 		 * re-creating the semaphores!
 		 */
 
+		acpi_gbl_db_terminate_loop = TRUE;
 		/*  acpi_initialize (NULL); */
 		break;
 
@@ -1151,7 +1152,7 @@ void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context)
 	acpi_status status = AE_OK;
 	acpi_status Mstatus;
 
-	while (status != AE_CTRL_TERMINATE) {
+	while (status != AE_CTRL_TERMINATE && !acpi_gbl_db_terminate_loop) {
 		acpi_gbl_method_executing = FALSE;
 		acpi_gbl_step_to_next_call = FALSE;
 
drivers/acpi/acpica/utinit.c +13 -0
index d8699df..ccd0745 100644
@@ -282,6 +282,19 @@ void acpi_ut_subsystem_shutdown(void)
 {
 	ACPI_FUNCTION_TRACE(ut_subsystem_shutdown);
 
+	/* Just exit if subsystem is already shutdown */
+
+	if (acpi_gbl_shutdown) {
+		ACPI_ERROR((AE_INFO, "ACPI Subsystem is already terminated"));
+		return_VOID;
+	}
+
+	/* Subsystem appears active, go ahead and shut it down */
+
+	acpi_gbl_shutdown = TRUE;
+	acpi_gbl_startup_flags = 0;
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
+
 #ifndef ACPI_ASL_COMPILER
 
 	/* Close the acpi_event Handling */
drivers/acpi/acpica/utxface.c +0 -13
index f183daf..a6b0eb0 100644
@@ -67,19 +67,6 @@ acpi_status __init acpi_terminate(void)
 
 	ACPI_FUNCTION_TRACE(acpi_terminate);
 
-	/* Just exit if subsystem is already shutdown */
-
-	if (acpi_gbl_shutdown) {
-		ACPI_ERROR((AE_INFO, "ACPI Subsystem is already terminated"));
-		return_ACPI_STATUS(AE_OK);
-	}
-
-	/* Subsystem appears active, go ahead and shut it down */
-
-	acpi_gbl_shutdown = TRUE;
-	acpi_gbl_startup_flags = 0;
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
-
 	/* Shutdown and free all resources */
 
 	acpi_ut_subsystem_shutdown();
Signature · 1 line
1.7.10
author
#15 lore raw

PATCH 11/13 ACPI: Enable build of AML interpreter debugger

In reply to Lv Zheng

This patch enables ACPICA debugger files using a configurable CONFIG_ACPI_DEBUGGER configuration item. Those debugger related code that was originally masked as ACPI_FUTURE_USAGE now gets unmasked.

Necessary OSL stubs are also added in this patch:
1. acpi_os_readable(): This should be arch specific in Linux, while this patch doesn't introduce real implementation and a complex mechanism to allow architecture specific acpi_os_readable() to be implemented to validate the address. It may be done by future commits.
2. acpi_os_get_line(): This is used to obtain debugger command input. This patch only introduces a simple KDB concept example in it and the example should be co-working with the code implemented in acpi_os_printf(). Since this KDB example won't be compiled unless ENABLE_DEBUGGER is defined and it seems Linux has already stopped to use ENABLE_DEBUGGER, thus do not expect it can work properly.

This patch also cleans up all other ACPI_FUTURE_USAGE surroundings accordingly.
1. Since linkage error can be automatically detected, declaration in the headers needn't be surrounded by ACPI_FUTURE_USAGE.
So only the following separate exported fuction bodies are masked by this macro (other exported fucntions may have already been masked at entire module level via drivers/acpi/acpica/Makefile):
acpi_install_exception_handler()
acpi_subsystem_status()
acpi_get_system_info()
acpi_get_statistics() acpi_install_initialization_handler()
2. Since strip can automatically zap the no-user functions, functions that are not marked with ACPI_EXPORT_SYMBOL() needn't get surrounded by ACPI_FUTURE_USAGE.
So the following function which is not used by Linux kernel now won't get surrounded by this macro:

     acpi_ps_get_name()
---
 drivers/acpi/Kconfig              |    9 +++++++++
 drivers/acpi/acpica/Makefile      |   16 ++++++++++++++++
 drivers/acpi/acpica/acinterp.h    |    2 --
 drivers/acpi/acpica/acnamesp.h    |    4 ----
 drivers/acpi/acpica/acparser.h    |    4 ----
 drivers/acpi/acpica/acutils.h     |    2 --
 drivers/acpi/acpica/evxface.c     |    2 +-
 drivers/acpi/acpica/nsdump.c      |    6 ------
 drivers/acpi/acpica/pstree.c      |    2 --
 drivers/acpi/acpica/psutils.c     |    2 --
 drivers/acpi/acpica/rsutils.c     |    2 --
 drivers/acpi/acpica/rsxface.c     |    4 ++--
 drivers/acpi/acpica/utxface.c     |    2 +-
 drivers/acpi/osl.c                |   11 +++--------
 include/acpi/acpixf.h             |   10 ----------
 include/acpi/platform/aclinux.h   |    7 +++++--
 include/acpi/platform/aclinuxex.h |    5 +++++
 17 files changed, 42 insertions(+), 48 deletions(-)
drivers/acpi/Kconfig +9 -0
index 5d1015c..706c2e9 100644
@@ -57,6 +57,15 @@ config ACPI_SYSTEM_POWER_STATES_SUPPORT
 config ACPI_CCA_REQUIRED
 	bool
 
+config ACPI_DEBUGGER
+	bool "In-kernel debugger (EXPERIMENTAL)"
+	select ACPI_DEBUG
+	help
+	  Enable in-kernel debugging facilities: statistics, internal
+	  object dump, single step control method execution.
+	  This is still under development, currently enabling this only
+	  results in the compilation of the ACPICA debugger files.
+
 config ACPI_SLEEP
 	bool
 	depends on SUSPEND || HIBERNATION
drivers/acpi/acpica/Makefile +16 -0
index fedcc16..a57f019 100644
@@ -178,7 +178,23 @@ acpi-y +=		\
 	utxferror.o	\
 	utxfmutex.o
 
+acpi-$(CONFIG_ACPI_DEBUGGER) +=	\
+	dbcmds.o		\
+	dbconvert.o		\
+	dbdisply.o		\
+	dbexec.o		\
+	dbhistry.o		\
+	dbinput.o		\
+	dbmethod.o		\
+	dbnames.o		\
+	dbobject.o		\
+	dbstats.o		\
+	dbutils.o		\
+	dbxface.o
+
 acpi-$(ACPI_FUTURE_USAGE) +=	\
+	dbfileio.o		\
+	dbtest.o		\
 	utcache.o		\
 	utfileio.o		\
 	utprint.o		\
drivers/acpi/acpica/acinterp.h +0 -2
index e820ed8..e9e936e 100644
@@ -397,12 +397,10 @@ void
 acpi_ex_dump_operands(union acpi_operand_object **operands,
 		      const char *opcode_name, u32 num_opcodes);
 
-#ifdef	ACPI_FUTURE_USAGE
 void
 acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags);
 
 void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags);
-#endif				/* ACPI_FUTURE_USAGE */
 
 /*
  * exnames - AML namestring support
drivers/acpi/acpica/acnamesp.h +0 -4
index ea0d907..5d261c9 100644
@@ -193,9 +193,7 @@ acpi_ns_convert_to_resource(union acpi_operand_object *original_object,
 /*
  * nsdump - Namespace dump/print utilities
  */
-#ifdef	ACPI_FUTURE_USAGE
 void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
-#endif				/* ACPI_FUTURE_USAGE */
 
 void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
 
@@ -208,7 +206,6 @@ acpi_status
 acpi_ns_dump_one_object(acpi_handle obj_handle,
 			u32 level, void *context, void **return_value);
 
-#ifdef	ACPI_FUTURE_USAGE
 void
 acpi_ns_dump_objects(acpi_object_type type,
 		     u8 display_type,
@@ -220,7 +217,6 @@ acpi_ns_dump_object_paths(acpi_object_type type,
 			  u8 display_type,
 			  u32 max_depth,
 			  acpi_owner_id owner_id, acpi_handle start_handle);
-#endif				/* ACPI_FUTURE_USAGE */
 
 /*
  * nseval - Namespace evaluation functions
drivers/acpi/acpica/acparser.h +0 -4
index 6021ccf..8fc8c7c 100644
@@ -194,10 +194,8 @@ union acpi_parse_object *acpi_ps_find(union acpi_parse_object *scope,
 
 union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn);
 
-#ifdef	ACPI_FUTURE_USAGE
 union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
 						union acpi_parse_object *op);
-#endif				/* ACPI_FUTURE_USAGE */
 
 /*
  * pswalk - parse tree walk routines
@@ -235,9 +233,7 @@ void acpi_ps_free_op(union acpi_parse_object *op);
 
 u8 acpi_ps_is_leading_char(u32 c);
 
-#ifdef	ACPI_FUTURE_USAGE
 u32 acpi_ps_get_name(union acpi_parse_object *op);
-#endif				/* ACPI_FUTURE_USAGE */
 
 void acpi_ps_set_name(union acpi_parse_object *op, u32 name);
 
drivers/acpi/acpica/acutils.h +0 -2
index fb2aa50..8b8fef6 100644
@@ -635,9 +635,7 @@ void
 acpi_ut_free_and_track(void *address,
 		       u32 component, const char *module, u32 line);
 
-#ifdef	ACPI_FUTURE_USAGE
 void acpi_ut_dump_allocation_info(void);
-#endif				/* ACPI_FUTURE_USAGE */
 
 void acpi_ut_dump_allocations(u32 component, const char *module);
 
drivers/acpi/acpica/evxface.c +1 -1
index 81f2d9e..07d22bf 100644
@@ -405,7 +405,7 @@ cleanup:
 }
 
 ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
-#endif				/*  ACPI_FUTURE_USAGE  */
+#endif
 
 #if (!ACPI_REDUCED_HARDWARE)
 /*******************************************************************************
drivers/acpi/acpica/nsdump.c +0 -6
index 0f1daba..37aa5c4 100644
@@ -60,7 +60,6 @@ acpi_ns_dump_one_device(acpi_handle obj_handle,
 
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 
-#ifdef	ACPI_FUTURE_USAGE
 static acpi_status
 acpi_ns_dump_one_object_path(acpi_handle obj_handle,
 			     u32 level, void *context, void **return_value);
@@ -68,7 +67,6 @@ acpi_ns_dump_one_object_path(acpi_handle obj_handle,
 static acpi_status
 acpi_ns_get_max_depth(acpi_handle obj_handle,
 		      u32 level, void *context, void **return_value);
-#endif				/* ACPI_FUTURE_USAGE */
 
 /*******************************************************************************
  *
@@ -625,7 +623,6 @@ cleanup:
 	return (AE_OK);
 }
 
-#ifdef ACPI_FUTURE_USAGE
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_dump_objects
@@ -680,9 +677,7 @@ acpi_ns_dump_objects(acpi_object_type type,
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 }
-#endif				/* ACPI_FUTURE_USAGE */
 
-#ifdef	ACPI_FUTURE_USAGE
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_dump_one_object_path, acpi_ns_get_max_depth
@@ -810,7 +805,6 @@ acpi_ns_dump_object_paths(acpi_object_type type,
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 }
-#endif				/* ACPI_FUTURE_USAGE */
 
 /*******************************************************************************
  *
drivers/acpi/acpica/pstree.c +0 -2
index 89984f3..cf2f2fa 100644
@@ -183,7 +183,6 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
 	}
 }
 
-#ifdef ACPI_FUTURE_USAGE
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ps_get_depth_next
@@ -317,4 +316,3 @@ union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op)
 	return (child);
 }
 #endif
-#endif				/*  ACPI_FUTURE_USAGE  */
drivers/acpi/acpica/psutils.c +0 -2
index 183cc1e..71d2877 100644
@@ -205,7 +205,6 @@ u8 acpi_ps_is_leading_char(u32 c)
 /*
  * Get op's name (4-byte name segment) or 0 if unnamed
  */
-#ifdef ACPI_FUTURE_USAGE
 u32 acpi_ps_get_name(union acpi_parse_object * op)
 {
 
@@ -219,7 +218,6 @@ u32 acpi_ps_get_name(union acpi_parse_object * op)
 
 	return (op->named.name);
 }
-#endif				/*  ACPI_FUTURE_USAGE  */
 
 /*
  * Set op's name
drivers/acpi/acpica/rsutils.c +0 -2
index 52b024d..9486992 100644
@@ -564,7 +564,6 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node,
  *
  ******************************************************************************/
 
-#ifdef ACPI_FUTURE_USAGE
 acpi_status
 acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
 			    struct acpi_buffer *ret_buffer)
@@ -596,7 +595,6 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
 	acpi_ut_remove_reference(obj_desc);
 	return_ACPI_STATUS(status);
 }
-#endif				/*  ACPI_FUTURE_USAGE  */
 
 /*******************************************************************************
  *
drivers/acpi/acpica/rsxface.c +2 -2
index de51f83..1e8cd57 100644
@@ -220,7 +220,7 @@ acpi_get_current_resources(acpi_handle device_handle,
 }
 
 ACPI_EXPORT_SYMBOL(acpi_get_current_resources)
-#ifdef ACPI_FUTURE_USAGE
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_get_possible_resources
@@ -262,7 +262,7 @@ acpi_get_possible_resources(acpi_handle device_handle,
 }
 
 ACPI_EXPORT_SYMBOL(acpi_get_possible_resources)
-#endif				/*  ACPI_FUTURE_USAGE  */
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_set_current_resources
drivers/acpi/acpica/utxface.c +1 -1
index a6b0eb0..f9c8f9c 100644
@@ -253,7 +253,7 @@ acpi_install_initialization_handler(acpi_init_handler handler, u32 function)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_install_initialization_handler)
-#endif				/*  ACPI_FUTURE_USAGE  */
+#endif
 
 /*****************************************************************************
  *
drivers/acpi/osl.c +3 -8
index 739a4a6..3272915 100644
@@ -66,8 +66,6 @@ struct acpi_os_dpc {
 /* stuff for debugger support */
 int acpi_in_debugger;
 EXPORT_SYMBOL(acpi_in_debugger);
-
-extern char line_buf[80];
 #endif				/*ENABLE_DEBUGGER */
 
 static int (*__acpi_os_prepare_sleep)(u8 sleep_state, u32 pm1a_ctrl,
@@ -1345,15 +1343,13 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
 	return AE_OK;
 }
 
-#ifdef ACPI_FUTURE_USAGE
-u32 acpi_os_get_line(char *buffer)
+acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read)
 {
-
 #ifdef ENABLE_DEBUGGER
 	if (acpi_in_debugger) {
 		u32 chars;
 
-		kdb_read(buffer, sizeof(line_buf));
+		kdb_read(buffer, buffer_length);
 
 		/* remove the CR kdb includes */
 		chars = strlen(buffer) - 1;
@@ -1361,9 +1357,8 @@ u32 acpi_os_get_line(char *buffer)
 	}
 #endif
 
-	return 0;
+	return AE_OK;
 }
-#endif				/*  ACPI_FUTURE_USAGE  */
 
 acpi_status acpi_os_signal(u32 function, void *info)
 {
include/acpi/acpixf.h +0 -10
index c33eeab..89a4018 100644
@@ -393,15 +393,11 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void))
  */
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
-#ifdef ACPI_FUTURE_USAGE
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
-#endif
 
-#ifdef ACPI_FUTURE_USAGE
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			    acpi_get_system_info(struct acpi_buffer
 						 *ret_buffer))
-#endif
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_get_statistics(struct acpi_statistics *stats))
 ACPI_EXTERNAL_RETURN_PTR(const char
@@ -625,11 +621,9 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 							       space_id,
 							       acpi_adr_space_handler
 							       handler))
-#ifdef ACPI_FUTURE_USAGE
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_install_exception_handler
 			     (acpi_exception_handler handler))
-#endif
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_install_interface_handler
 			     (acpi_interface_handler handler))
@@ -750,12 +744,10 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_get_current_resources(acpi_handle device,
 							struct acpi_buffer
 							*ret_buffer))
-#ifdef ACPI_FUTURE_USAGE
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_get_possible_resources(acpi_handle device,
 							 struct acpi_buffer
 							 *ret_buffer))
-#endif
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_get_event_resources(acpi_handle device_handle,
 						      struct acpi_buffer
@@ -844,7 +836,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 /*
  * ACPI Timer interfaces
  */
-#ifdef ACPI_FUTURE_USAGE
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_get_timer_resolution(u32 *resolution))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
@@ -853,7 +844,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_get_timer_duration(u32 start_ticks,
 							u32 end_ticks,
 							u32 *time_elapsed))
-#endif				/* ACPI_FUTURE_USAGE */
 
 /*
  * Error/Warning output
include/acpi/platform/aclinux.h +5 -2
index 74ba46c..323e5da 100644
@@ -63,12 +63,16 @@
 
 #define ACPI_USE_SYSTEM_INTTYPES
 
-/* Compile for reduced hardware mode only with this kernel config */
+/* Kernel specific ACPICA configuration */
 
 #ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY
 #define ACPI_REDUCED_HARDWARE 1
 #endif
 
+#ifdef CONFIG_ACPI_DEBUGGER
+#define ACPI_DEBUGGER
+#endif
+
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/ctype.h>
@@ -151,7 +155,6 @@
  * OSL interfaces used by utilities
  */
 #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
-#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
 #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
 #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
 #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
include/acpi/platform/aclinuxex.h +5 -0
index acedc3f..fd6d70f 100644
@@ -124,6 +124,11 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
 		lock ? AE_OK : AE_NO_MEMORY; \
 	})
 
+static inline u8 acpi_os_readable(void *pointer, acpi_size length)
+{
+	return TRUE;
+}
+
 /*
  * OSL interfaces added by Linux
  */
Signature · 1 line
1.7.10
author
#16 lore raw

PATCH 12/13 ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode

In reply to Lv Zheng

ACPICA commit 35273add90da19cd8790fdb5735f52e3c9861684

When single step execution is not ended, executing another control methods leads to dead locks around interpreter lock/namespace lock/method serialization lock. So we should only allow one execution from the debugger at same time. Lv Zheng.

---
 drivers/acpi/acpica/dbexec.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/acpi/acpica/dbexec.c +10 -0
index 8eef298..9da2daa 100644
@@ -370,7 +370,17 @@ acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags)
 #ifdef ACPI_DEBUG_OUTPUT
 	u32 previous_allocations;
 	u32 allocations;
+#endif
 
+	/*
+	 * Allow one execution to be performed by debugger or single step
+	 * execution will be dead locked by the interpreter mutexes.
+	 */
+	if (acpi_gbl_method_executing) {
+		acpi_os_printf("Only one debugger execution is allowed.\n");
+		return;
+	}
+#ifdef ACPI_DEBUG_OUTPUT
 	/* Memory allocation tracking */
 
 	previous_allocations = acpi_db_get_outstanding_allocations();
Signature · 1 line
1.7.10
author
#17 lore raw

PATCH 13/13 ACPICA: Update version to 20150930

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit e9c75ca267262326e80d49a290e8387a5963e2d2

Version 20150930.

---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 89a4018..b9ee2fb 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20150818
+#define ACPI_CA_VERSION                 0x20150930
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
1.7.10
#2 lore raw

Re: [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation.

In reply to Lv Zheng
reproduce:

Hi Bob,

[auto build test ERROR on pm/linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Lv-Zheng/ACPICA-20150930-Release/20151015-101636
config: x86_64-lkp (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_resource_list':

>> drivers/acpi/acpica/rsdump.c:136:7: error: 'acpi_gbl_dump_serial_bus_dispatch' undeclared (first use in this function)
          acpi_gbl_dump_serial_bus_dispatch
          ^
   drivers/acpi/acpica/rsdump.c:136:7: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/acpi/acpica/rsdump.c:141:7: error: 'acpi_gbl_dump_resource_dispatch' undeclared (first use in this function)
          acpi_gbl_dump_resource_dispatch
          ^
   drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_irq_list':
>> drivers/acpi/acpica/rsdump.c:186:40: error: 'acpi_rs_dump_prt' undeclared (first use in this function)
      acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
                                           ^
   drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_address_common':
>> drivers/acpi/acpica/rsdump.c:445:37: error: 'acpi_rs_dump_memory_flags' undeclared (first use in this function)
      acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
                                        ^
>> drivers/acpi/acpica/rsdump.c:450:37: error: 'acpi_rs_dump_io_flags' undeclared (first use in this function)
      acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
                                        ^
>> drivers/acpi/acpica/rsdump.c:467:36: error: 'acpi_rs_dump_general_flags' undeclared (first use in this function)
     acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
                                       ^

vim +/acpi_gbl_dump_serial_bus_dispatch +136 drivers/acpi/acpica/rsdump.c

39239fed Bob Moore 2015-04-13  130  		}
39239fed Bob Moore 2015-04-13  131  
39239fed Bob Moore 2015-04-13  132  		/* Dump the resource descriptor */
39239fed Bob Moore 2015-04-13  133  
39239fed Bob Moore 2015-04-13  134  		if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
39239fed Bob Moore 2015-04-13  135  			acpi_rs_dump_descriptor(&resource_list->data,
39239fed Bob Moore 2015-04-13 @136  						acpi_gbl_dump_serial_bus_dispatch
39239fed Bob Moore 2015-04-13  137  						[resource_list->data.
39239fed Bob Moore 2015-04-13  138  						 common_serial_bus.type]);
39239fed Bob Moore 2015-04-13  139  		} else {
39239fed Bob Moore 2015-04-13  140  			acpi_rs_dump_descriptor(&resource_list->data,
39239fed Bob Moore 2015-04-13 @141  						acpi_gbl_dump_resource_dispatch
39239fed Bob Moore 2015-04-13  142  						[type]);
39239fed Bob Moore 2015-04-13  143  		}
39239fed Bob Moore 2015-04-13  144  
39239fed Bob Moore 2015-04-13  145  		/* Point to the next resource structure */
39239fed Bob Moore 2015-04-13  146  
39239fed Bob Moore 2015-04-13  147  		resource_list = ACPI_NEXT_RESOURCE(resource_list);
39239fed Bob Moore 2015-04-13  148  
39239fed Bob Moore 2015-04-13  149  		/* Exit when END_TAG descriptor is reached */
39239fed Bob Moore 2015-04-13  150  
39239fed Bob Moore 2015-04-13  151  	} while (type != ACPI_RESOURCE_TYPE_END_TAG);
39239fed Bob Moore 2015-04-13  152  }
39239fed Bob Moore 2015-04-13  153  
39239fed Bob Moore 2015-04-13  154  /*******************************************************************************
39239fed Bob Moore 2015-04-13  155   *
39239fed Bob Moore 2015-04-13  156   * FUNCTION:    acpi_rs_dump_irq_list
39239fed Bob Moore 2015-04-13  157   *
39239fed Bob Moore 2015-04-13  158   * PARAMETERS:  route_table     - Pointer to the routing table to dump.
39239fed Bob Moore 2015-04-13  159   *
39239fed Bob Moore 2015-04-13  160   * RETURN:      None
39239fed Bob Moore 2015-04-13  161   *
39239fed Bob Moore 2015-04-13  162   * DESCRIPTION: Print IRQ routing table
39239fed Bob Moore 2015-04-13  163   *
39239fed Bob Moore 2015-04-13  164   ******************************************************************************/
39239fed Bob Moore 2015-04-13  165  
39239fed Bob Moore 2015-04-13  166  void acpi_rs_dump_irq_list(u8 *route_table)
39239fed Bob Moore 2015-04-13  167  {
39239fed Bob Moore 2015-04-13  168  	struct acpi_pci_routing_table *prt_element;
39239fed Bob Moore 2015-04-13  169  	u8 count;
39239fed Bob Moore 2015-04-13  170  
39239fed Bob Moore 2015-04-13  171  	ACPI_FUNCTION_ENTRY();
39239fed Bob Moore 2015-04-13  172  
39239fed Bob Moore 2015-04-13  173  	/* Check if debug output enabled */
39239fed Bob Moore 2015-04-13  174  
39239fed Bob Moore 2015-04-13  175  	if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
39239fed Bob Moore 2015-04-13  176  		return;
39239fed Bob Moore 2015-04-13  177  	}
39239fed Bob Moore 2015-04-13  178  
39239fed Bob Moore 2015-04-13  179  	prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
39239fed Bob Moore 2015-04-13  180  
39239fed Bob Moore 2015-04-13  181  	/* Dump all table elements, Exit on zero length element */
39239fed Bob Moore 2015-04-13  182  
39239fed Bob Moore 2015-04-13  183  	for (count = 0; prt_element->length; count++) {
39239fed Bob Moore 2015-04-13  184  		acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
39239fed Bob Moore 2015-04-13  185  			       count);
39239fed Bob Moore 2015-04-13 @186  		acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
39239fed Bob Moore 2015-04-13  187  
39239fed Bob Moore 2015-04-13  188  		prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
39239fed Bob Moore 2015-04-13  189  					   prt_element, prt_element->length);

:::::: The code at line 136 was first introduced by commit
:::::: 39239fedbfb5493d5804d6cefb806fd208a006c5 ACPICA: Update Resource descriptor dump module.

:::::: TO: Bob Moore <[email protected]> :::::: CC: Rafael J. Wysocki <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

RE: [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation.

This appears as though it is related to this conditional:

#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) /*
* rsinfo
*/
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];

So, I'm going to let Lv take a look at this.
Bob

Quoted 160 lines

-----Original Message-----
From: lkp
Sent: Thursday, October 15, 2015 8:51 AM
To: Zheng, Lv
Cc: [email protected]; Wysocki, Rafael J; Brown, Len; Zheng, Lv; Lv Zheng; [email protected]; [email protected]; Moore, Robert
Subject: Re: [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation.

Hi Bob,

[auto build test ERROR on pm/linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url: https://github.com/0day-ci/linux/commits/Lv-Zheng/ACPICA-20150930-
Release/20151015-101636
config: x86_64-lkp (attached as .config)
reproduce:

        # save the attached .config to linux build tree
        make ARCH=x86_64

All errors (new ones prefixed by >>):

drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_resource_list':

Quoted 3 lines
Quoted 3 lines

drivers/acpi/acpica/rsdump.c:136:7: error:
'acpi_gbl_dump_serial_bus_dispatch' undeclared (first use in this function)

          acpi_gbl_dump_serial_bus_dispatch
          ^

drivers/acpi/acpica/rsdump.c:136:7: note: each undeclared identifier is
reported only once for each function it appears in

Quoted 3 lines
Quoted 3 lines

drivers/acpi/acpica/rsdump.c:141:7: error:
'acpi_gbl_dump_resource_dispatch' undeclared (first use in this function)

          acpi_gbl_dump_resource_dispatch
          ^

drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_irq_list':

Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:186:40: error: 'acpi_rs_dump_prt' undeclared (first use in this function)

      acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
                                           ^

drivers/acpi/acpica/rsdump.c: In function
'acpi_rs_dump_address_common':

Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:445:37: error:
'acpi_rs_dump_memory_flags' undeclared (first use in this function)

      acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
                                        ^
Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:450:37: error: 'acpi_rs_dump_io_flags' undeclared (first use in this function)

      acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
                                        ^
Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:467:36: error:
'acpi_rs_dump_general_flags' undeclared (first use in this function)

     acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
                                       ^

vim +/acpi_gbl_dump_serial_bus_dispatch +136 drivers/acpi/acpica/rsdump.c

39239fed Bob Moore 2015-04-13  130  		}
39239fed Bob Moore 2015-04-13  131
39239fed Bob Moore 2015-04-13  132  		/* Dump the resource

descriptor */
39239fed Bob Moore 2015-04-13 133
39239fed Bob Moore 2015-04-13 134 if (type ==
ACPI_RESOURCE_TYPE_SERIAL_BUS) {
39239fed Bob Moore 2015-04-13 135

	acpi_rs_dump_descriptor(&resource_list->data,
39239fed Bob Moore 2015-04-13 @136
	acpi_gbl_dump_serial_bus_dispatch
39239fed Bob Moore 2015-04-13  137
	[resource_list->data.

39239fed Bob Moore 2015-04-13 138
common_serial_bus.type]);
39239fed Bob Moore 2015-04-13 139 } else {
39239fed Bob Moore 2015-04-13 140

	acpi_rs_dump_descriptor(&resource_list->data,
39239fed Bob Moore 2015-04-13 @141
	acpi_gbl_dump_resource_dispatch
39239fed Bob Moore 2015-04-13  142
	[type]);
39239fed Bob Moore 2015-04-13  143  		}
39239fed Bob Moore 2015-04-13  144
39239fed Bob Moore 2015-04-13  145  		/* Point to the next

resource structure */
39239fed Bob Moore 2015-04-13 146
39239fed Bob Moore 2015-04-13 147 resource_list =
ACPI_NEXT_RESOURCE(resource_list);
39239fed Bob Moore 2015-04-13 148
39239fed Bob Moore 2015-04-13 149 /* Exit when END_TAG
descriptor is reached */
39239fed Bob Moore 2015-04-13 150
39239fed Bob Moore 2015-04-13 151 } while (type !=
ACPI_RESOURCE_TYPE_END_TAG);

39239fed Bob Moore 2015-04-13  152  }
39239fed Bob Moore 2015-04-13  153
39239fed Bob Moore 2015-04-13  154
/*************************************************************************
******
39239fed Bob Moore 2015-04-13  155   *
39239fed Bob Moore 2015-04-13  156   * FUNCTION:    acpi_rs_dump_irq_list
39239fed Bob Moore 2015-04-13  157   *
39239fed Bob Moore 2015-04-13  158   * PARAMETERS:  route_table     -
Pointer to the routing table to dump.
39239fed Bob Moore 2015-04-13  159   *
39239fed Bob Moore 2015-04-13  160   * RETURN:      None
39239fed Bob Moore 2015-04-13  161   *
39239fed Bob Moore 2015-04-13  162   * DESCRIPTION: Print IRQ routing

table
39239fed Bob Moore 2015-04-13 163 *
39239fed Bob Moore 2015-04-13 164
**************************************************************************
****/
39239fed Bob Moore 2015-04-13 165
39239fed Bob Moore 2015-04-13 166 void acpi_rs_dump_irq_list(u8 *route_table) 39239fed Bob Moore 2015-04-13 167 {
39239fed Bob Moore 2015-04-13 168 struct acpi_pci_routing_table
*prt_element;

39239fed Bob Moore 2015-04-13  169  	u8 count;
39239fed Bob Moore 2015-04-13  170
39239fed Bob Moore 2015-04-13  171  	ACPI_FUNCTION_ENTRY();
39239fed Bob Moore 2015-04-13  172
39239fed Bob Moore 2015-04-13  173  	/* Check if debug output enabled

*/
39239fed Bob Moore 2015-04-13 174
39239fed Bob Moore 2015-04-13 175 if
(!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {

39239fed Bob Moore 2015-04-13  176  		return;
39239fed Bob Moore 2015-04-13  177  	}
39239fed Bob Moore 2015-04-13  178
39239fed Bob Moore 2015-04-13  179  	prt_element =

ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table); 39239fed Bob Moore 2015-04-13 180
39239fed Bob Moore 2015-04-13 181 /* Dump all table elements, Exit
on zero length element */
39239fed Bob Moore 2015-04-13 182
39239fed Bob Moore 2015-04-13 183 for (count = 0; prt_element-

Quoted 1 line

length; count++) {

39239fed Bob Moore 2015-04-13 184 acpi_os_printf("\n[%02X]
PCI IRQ Routing Table Package\n",
39239fed Bob Moore 2015-04-13 185 count);
39239fed Bob Moore 2015-04-13 @186

	acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);

39239fed Bob Moore 2015-04-13 187
39239fed Bob Moore 2015-04-13 188 prt_element =
ACPI_ADD_PTR(struct acpi_pci_routing_table,
39239fed Bob Moore 2015-04-13 189
prt_element, prt_element->length);

:::::: The code at line 136 was first introduced by commit :::::: 39239fedbfb5493d5804d6cefb806fd208a006c5 ACPICA: Update Resource descriptor dump module.

:::::: TO: Bob Moore <[email protected]> :::::: CC: Rafael J. Wysocki <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology
Center
https://lists.01.org/pipermail/kbuild-all Intel
Corporation

author
#4 lore raw

RE: [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation.

OK. I'll check it.
There is no issue detected in my local test. I'll re-send the series after fixing the build issue. So Rafael please ignore this series for now.

Thanks and best regards
-Lv

Quoted 178 lines

From: Moore, Robert
Sent: Friday, October 16, 2015 2:33 AM

This appears as though it is related to this conditional:

#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) /*
* rsinfo
*/
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];

So, I'm going to let Lv take a look at this.
Bob

Quoted 160 lines

-----Original Message-----
From: lkp
Sent: Thursday, October 15, 2015 8:51 AM
To: Zheng, Lv
Cc: [email protected]; Wysocki, Rafael J; Brown, Len; Zheng, Lv; Lv Zheng; [email protected]; [email protected]; Moore, Robert
Subject: Re: [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation.

Hi Bob,

[auto build test ERROR on pm/linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url: https://github.com/0day-ci/linux/commits/Lv-Zheng/ACPICA-20150930-
Release/20151015-101636
config: x86_64-lkp (attached as .config)
reproduce:

        # save the attached .config to linux build tree
        make ARCH=x86_64

All errors (new ones prefixed by >>):

drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_resource_list':

Quoted 3 lines
Quoted 3 lines

drivers/acpi/acpica/rsdump.c:136:7: error:
'acpi_gbl_dump_serial_bus_dispatch' undeclared (first use in this function)

          acpi_gbl_dump_serial_bus_dispatch
          ^

drivers/acpi/acpica/rsdump.c:136:7: note: each undeclared identifier is
reported only once for each function it appears in

Quoted 3 lines
Quoted 3 lines

drivers/acpi/acpica/rsdump.c:141:7: error:
'acpi_gbl_dump_resource_dispatch' undeclared (first use in this function)

          acpi_gbl_dump_resource_dispatch
          ^

drivers/acpi/acpica/rsdump.c: In function 'acpi_rs_dump_irq_list':

Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:186:40: error: 'acpi_rs_dump_prt' undeclared (first use in this function)

      acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
                                           ^

drivers/acpi/acpica/rsdump.c: In function
'acpi_rs_dump_address_common':

Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:445:37: error:
'acpi_rs_dump_memory_flags' undeclared (first use in this function)

      acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
                                        ^
Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:450:37: error: 'acpi_rs_dump_io_flags' undeclared (first use in this function)

      acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
                                        ^
Quoted 2 lines
Quoted 2 lines

drivers/acpi/acpica/rsdump.c:467:36: error:
'acpi_rs_dump_general_flags' undeclared (first use in this function)

     acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
                                       ^

vim +/acpi_gbl_dump_serial_bus_dispatch +136 drivers/acpi/acpica/rsdump.c

39239fed Bob Moore 2015-04-13  130  		}
39239fed Bob Moore 2015-04-13  131
39239fed Bob Moore 2015-04-13  132  		/* Dump the resource

descriptor */
39239fed Bob Moore 2015-04-13 133
39239fed Bob Moore 2015-04-13 134 if (type ==
ACPI_RESOURCE_TYPE_SERIAL_BUS) {
39239fed Bob Moore 2015-04-13 135

	acpi_rs_dump_descriptor(&resource_list->data,
39239fed Bob Moore 2015-04-13 @136
	acpi_gbl_dump_serial_bus_dispatch
39239fed Bob Moore 2015-04-13  137
	[resource_list->data.

39239fed Bob Moore 2015-04-13 138
common_serial_bus.type]);
39239fed Bob Moore 2015-04-13 139 } else {
39239fed Bob Moore 2015-04-13 140

	acpi_rs_dump_descriptor(&resource_list->data,
39239fed Bob Moore 2015-04-13 @141
	acpi_gbl_dump_resource_dispatch
39239fed Bob Moore 2015-04-13  142
	[type]);
39239fed Bob Moore 2015-04-13  143  		}
39239fed Bob Moore 2015-04-13  144
39239fed Bob Moore 2015-04-13  145  		/* Point to the next

resource structure */
39239fed Bob Moore 2015-04-13 146
39239fed Bob Moore 2015-04-13 147 resource_list =
ACPI_NEXT_RESOURCE(resource_list);
39239fed Bob Moore 2015-04-13 148
39239fed Bob Moore 2015-04-13 149 /* Exit when END_TAG
descriptor is reached */
39239fed Bob Moore 2015-04-13 150
39239fed Bob Moore 2015-04-13 151 } while (type !=
ACPI_RESOURCE_TYPE_END_TAG);

39239fed Bob Moore 2015-04-13  152  }
39239fed Bob Moore 2015-04-13  153
39239fed Bob Moore 2015-04-13  154
/*************************************************************************
******
39239fed Bob Moore 2015-04-13  155   *
39239fed Bob Moore 2015-04-13  156   * FUNCTION:    acpi_rs_dump_irq_list
39239fed Bob Moore 2015-04-13  157   *
39239fed Bob Moore 2015-04-13  158   * PARAMETERS:  route_table     -
Pointer to the routing table to dump.
39239fed Bob Moore 2015-04-13  159   *
39239fed Bob Moore 2015-04-13  160   * RETURN:      None
39239fed Bob Moore 2015-04-13  161   *
39239fed Bob Moore 2015-04-13  162   * DESCRIPTION: Print IRQ routing

table
39239fed Bob Moore 2015-04-13 163 *
39239fed Bob Moore 2015-04-13 164
**************************************************************************
****/
39239fed Bob Moore 2015-04-13 165
39239fed Bob Moore 2015-04-13 166 void acpi_rs_dump_irq_list(u8 *route_table) 39239fed Bob Moore 2015-04-13 167 {
39239fed Bob Moore 2015-04-13 168 struct acpi_pci_routing_table
*prt_element;

39239fed Bob Moore 2015-04-13  169  	u8 count;
39239fed Bob Moore 2015-04-13  170
39239fed Bob Moore 2015-04-13  171  	ACPI_FUNCTION_ENTRY();
39239fed Bob Moore 2015-04-13  172
39239fed Bob Moore 2015-04-13  173  	/* Check if debug output enabled

*/
39239fed Bob Moore 2015-04-13 174
39239fed Bob Moore 2015-04-13 175 if
(!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {

39239fed Bob Moore 2015-04-13  176  		return;
39239fed Bob Moore 2015-04-13  177  	}
39239fed Bob Moore 2015-04-13  178
39239fed Bob Moore 2015-04-13  179  	prt_element =

ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table); 39239fed Bob Moore 2015-04-13 180
39239fed Bob Moore 2015-04-13 181 /* Dump all table elements, Exit
on zero length element */
39239fed Bob Moore 2015-04-13 182
39239fed Bob Moore 2015-04-13 183 for (count = 0; prt_element-

Quoted 1 line

length; count++) {

39239fed Bob Moore 2015-04-13 184 acpi_os_printf("\n[%02X]
PCI IRQ Routing Table Package\n",
39239fed Bob Moore 2015-04-13 185 count);
39239fed Bob Moore 2015-04-13 @186

	acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);

39239fed Bob Moore 2015-04-13 187
39239fed Bob Moore 2015-04-13 188 prt_element =
ACPI_ADD_PTR(struct acpi_pci_routing_table,
39239fed Bob Moore 2015-04-13 189
prt_element, prt_element->length);

:::::: The code at line 136 was first introduced by commit :::::: 39239fedbfb5493d5804d6cefb806fd208a006c5 ACPICA: Update Resource descriptor dump module.

:::::: TO: Bob Moore <[email protected]> :::::: CC: Rafael J. Wysocki <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology
Center
https://lists.01.org/pipermail/kbuild-all Intel
Corporation

#5 lore raw

Re: [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation.

Quoted 4 lines · Lv

OK. I'll check it.
There is no issue detected in my local test. I'll re-send the series after fixing the build issue. So Rafael please ignore this series for now.

OK

Thanks,
Rafael