From: Lv Zheng <lv.zheng@intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <len.brown@intel.com>
Cc: Lv Zheng <lv.zheng@intel.com>, Lv Zheng <zetalog@gmail.com>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
Bob Moore <robert.moore@intel.com>
Subject: [PATCH 10/27] ACPICA: OSL: Move external globals from utglobal.c to acpixf.h using ACPI_INIT_GLOBAL/ACPI_GLOBAL.
Date: Wed, 30 Apr 2014 10:04:35 +0800 [thread overview]
Message-ID: <f459c57b5961d1f96ce42be70c8339c69e90ad90.1398817612.git.lv.zheng@intel.com> (raw)
In-Reply-To: <cover.1398817612.git.lv.zheng@intel.com>
OSPMs like Linux trend to include all header files but leave empty stub
macros for a feature that is not configured during build.
This patch cleans up global variables that are defined in utglobal.c using
ACPI_INIT_GLOBAL mechanism. In Linux, such global variables are used by
the subsystems external to ACPICA.
This patch also cleans up global variables that are defined in utglobal.c
using ACPI_GLOBAL mechanism. In Linux, such global variables are not used
or should not be used by the subsystems external to ACPICA.
External global variables can be redefined by OSPMs using
ACPI_INIT_GLOBAL/ACPI_GLOBAL macros. Thus the ACPI_GLOBAL/ACPI_INIT_GLOBAL
mechanisms can be used by OSPM to implement stubs for such external
globals.
This patch doesn't include code for Linux to use this new mechanism, thus
no functional changes. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
drivers/acpi/acpica/utglobal.c | 22 ----------------------
include/acpi/acpixf.h | 35 +++++++++++++++++++++++------------
2 files changed, 23 insertions(+), 34 deletions(-)
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 825b064..d69be3c 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -55,28 +55,7 @@ ACPI_MODULE_NAME("utglobal")
* Static global variable initialization.
*
******************************************************************************/
-/* Debug output control masks */
-u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
-
-u32 acpi_dbg_layer = 0;
-
-/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */
-
-struct acpi_table_fadt acpi_gbl_FADT;
-u32 acpi_gbl_trace_flags;
-acpi_name acpi_gbl_trace_method_name;
-u8 acpi_gbl_system_awake_and_running;
-u32 acpi_current_gpe_count;
-
-/*
- * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
- * that the ACPI hardware is no longer required. A flag in the FADT indicates
- * a reduced HW machine, and that flag is duplicated here for convenience.
- */
-u8 acpi_gbl_reduced_hardware;
-
/* Various state name strings */
-
const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = {
"\\_S0_",
"\\_S1_",
@@ -337,7 +316,6 @@ acpi_status acpi_ut_init_globals(void)
acpi_gbl_acpi_hardware_present = TRUE;
acpi_gbl_last_owner_id_index = 0;
acpi_gbl_next_owner_id_offset = 0;
- acpi_gbl_trace_method_name = 0;
acpi_gbl_trace_dbg_level = 0;
acpi_gbl_trace_dbg_layer = 0;
acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 010816e..8255689 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -185,22 +185,33 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
/*
- * Other miscellaneous public globals
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
*/
-extern u32 acpi_current_gpe_count;
-extern struct acpi_table_fadt acpi_gbl_FADT;
-extern u8 acpi_gbl_system_awake_and_running;
-extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */
+ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
-/* Runtime configuration of debug print levels */
-
-extern u32 acpi_dbg_level;
-extern u32 acpi_dbg_layer;
+/*
+ * This mechanism is used to trace a specified AML method. The method is
+ * traced each time it is executed.
+ */
+ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
+ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0);
-/* ACPICA runtime options */
+/*
+ * Runtime configuration of debug output control masks. We want the debug
+ * switches statically initialized so they are already set when the debugger
+ * is entered.
+ */
+ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
+ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
-extern u32 acpi_gbl_trace_flags;
-extern acpi_name acpi_gbl_trace_method_name;
+/*
+ * Globals that are publically available
+ */
+ACPI_GLOBAL(u32, acpi_current_gpe_count);
+ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
+ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
/*
* Hardware-reduced prototypes. All interfaces that use these macros will
--
1.7.10
next prev parent reply other threads:[~2014-04-30 2:04 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-30 2:03 [PATCH 00/27] ACPICA: 20140424 Release Lv Zheng
2014-04-30 2:03 ` [PATCH 01/27] ACPICA: Utilities: Cleanup obsoleted global variables Lv Zheng
2014-04-30 2:03 ` [PATCH 02/27] ACPICA: Utilities: Deploy ACPI_DEBUGGER_EXEC for ACPI_DEBUGGER enabled code in utglobal.c Lv Zheng
2014-05-06 7:53 ` Pavel Machek
2014-05-06 8:58 ` Zheng, Lv
2014-05-06 11:08 ` Pavel Machek
2014-05-06 13:54 ` Zheng, Lv
2014-04-30 2:03 ` [PATCH 03/27] ACPICA: acpidump: Fix code issue in invoking fread in the loop Lv Zheng
2014-04-30 2:03 ` [PATCH 04/27] ACPICA: Update global variable definitions. No functional change Lv Zheng
2014-04-30 2:03 ` [PATCH 05/27] ACPICA: Update acpi_buffer_to_resource interface Lv Zheng
2014-04-30 2:04 ` [PATCH 06/27] ACPICA: Add support for LPIT table Lv Zheng
2014-04-30 2:04 ` [PATCH 07/27] ACPICA: Add support for _LPD and _PRP methods Lv Zheng
2014-04-30 2:04 ` [PATCH 08/27] ACPICA: Update handling of PCI ID lists Lv Zheng
2014-04-30 2:04 ` [PATCH 09/27] ACPICA: Comment updates - no functional change Lv Zheng
2014-04-30 2:04 ` Lv Zheng [this message]
2014-04-30 2:04 ` [PATCH 11/27] ACPICA: OSL: Add configurability for memory allocation macros Lv Zheng
2014-04-30 2:04 ` [PATCH 12/27] ACPICA: OSL: Add configurability for error message functions Lv Zheng
2014-04-30 2:04 ` [PATCH 13/27] ACPICA: OSL: Add configurability for debug output functions Lv Zheng
2014-04-30 2:05 ` [PATCH 14/27] ACPICA: OSL: Add section to collect the divergence in acpixf.h Lv Zheng
2014-04-30 2:05 ` [PATCH 15/27] ACPICA: OSL: Add configurability for generic external functions Lv Zheng
2014-04-30 2:05 ` [PATCH 16/27] ACPICA: Linux header: Add support for stubbed externals Lv Zheng
2014-04-30 2:05 ` [PATCH 17/27] ACPICA: acpidump: Fix truncated RSDP signature validation Lv Zheng
2014-04-30 2:05 ` [PATCH 18/27] ACPICA: Back port of _PRP update Lv Zheng
2014-04-30 2:05 ` [PATCH 19/27] ACPICA: Back port of improvements on exception code Lv Zheng
2014-04-30 2:05 ` [PATCH 20/27] ACPICA: Tables: Fix invalid pointer accesses in acpi_tb_parse_root_table() Lv Zheng
2014-05-03 12:59 ` Josh Boyer
2014-05-05 0:43 ` Rafael J. Wysocki
2014-05-05 4:23 ` Zheng, Lv
2014-05-05 12:42 ` Josh Boyer
2014-05-06 0:43 ` Rafael J. Wysocki
2014-05-06 1:39 ` Zheng, Lv
2014-04-30 2:05 ` [PATCH 21/27] ACPICA: acpidump: Add support to force using RSDT Lv Zheng
2014-04-30 2:05 ` [PATCH 22/27] ACPICA: Tables: Add new mechanism to skip NULL entries in RSDT and XSDT Lv Zheng
2014-04-30 2:06 ` [PATCH 23/27] ACPICA: Tables: Remove old mechanism to validate if XSDT contains NULL entries Lv Zheng
2014-04-30 2:06 ` [PATCH 24/27] ACPICA: Remove extraneous error message for large number of GPEs Lv Zheng
2014-04-30 2:06 ` [PATCH 25/27] ACPICA: Events: Update GPE handling and initialization code Lv Zheng
2014-04-30 2:06 ` [PATCH 26/27] ACPICA: Comment/format update, no functional change Lv Zheng
2014-04-30 2:06 ` [PATCH 27/27] ACPICA: Update version to 20140424 Lv Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f459c57b5961d1f96ce42be70c8339c69e90ad90.1398817612.git.lv.zheng@intel.com \
--to=lv.zheng@intel.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
--cc=zetalog@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).