Skip to contentSkip to conversation

ACPI: large cleanup

PATCH In review Jan Beulich 1 participant 1 message Mar 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 5/11 ACPI: large cleanup

In some cases, entire files turned out unnecessary. Of what remains, move whatever possible into .init.*, and some data items into .data.read_mostly.

xen/arch/ia64/linux-xen/acpi.c +0 -2
@@ -165,8 +165,6 @@ int platform_intr_list[ACPI_MAX_PLATFORM
 	[0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1
 };
 
-enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
-
 /*
  * Interrupt routing API for device drivers.  Provides interrupt vector for
  * a generic platform event.  Currently only CPEI is implemented.
xen/arch/ia64/linux-xen/acpi_numa.c +0 -1
@@ -28,7 +28,6 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/acpi.h>
-#include <acpi/acpi_bus.h>
 #include <acpi/acmacros.h>
 
 #ifndef XEN
xen/arch/x86/acpi/boot.c +8 -75

164 lines not on this page · raw message

xen/drivers/acpi/hwregs.c +3 -17
@@ -64,7 +64,8 @@ ACPI_MODULE_NAME("hwregs")
  * DESCRIPTION: Map register_id into a register bitmask.
  *
  ******************************************************************************/
-struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
+static struct acpi_bit_register_info *
+acpi_hw_get_bit_register_info(u32 register_id)
 {
 	ACPI_FUNCTION_ENTRY();
 
@@ -91,7 +92,7 @@ struct acpi_bit_register_info *acpi_hw_g
  *
  ******************************************************************************/
 
-acpi_status acpi_get_register_unlocked(u32 register_id, u32 * return_value)
+acpi_status acpi_get_register(u32 register_id, u32 * return_value)
 {
 	u32 register_value = 0;
 	struct acpi_bit_register_info *bit_reg_info;
@@ -129,16 +130,6 @@ acpi_status acpi_get_register_unlocked(u
 	return_ACPI_STATUS(status);
 }
 
-acpi_status acpi_get_register(u32 register_id, u32 * return_value)
-{
-	acpi_status status;
-	//acpi_cpu_flags flags;
-	//flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
-	status = acpi_get_register_unlocked(register_id, return_value);
-	//acpi_os_release_lock(acpi_gbl_hardware_lock, flags);
-	return status;
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_set_register
@@ -157,7 +148,6 @@ acpi_status acpi_set_register(u32 regist
 	u32 register_value = 0;
 	struct acpi_bit_register_info *bit_reg_info;
 	acpi_status status;
-	//acpi_cpu_flags lock_flags;
 
 	ACPI_FUNCTION_TRACE_U32(acpi_set_register, register_id);
 
@@ -170,8 +160,6 @@ acpi_status acpi_set_register(u32 regist
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
-	//lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
-
 	/* Always do a register read first so we can insert the new bits  */
 
 	status = acpi_hw_register_read(bit_reg_info->parent_register,
@@ -276,8 +264,6 @@ acpi_status acpi_set_register(u32 regist
 
       unlock_and_exit:
 
-	//acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
-
 	/* Normalize the value that was read */
 
 	ACPI_DEBUG_EXEC(register_value =
xen/drivers/acpi/numa.c +0 -1
@@ -28,7 +28,6 @@
 #include <xen/errno.h>
 #include <xen/acpi.h>
 #include <xen/numa.h>
-#include <acpi/acpi_bus.h>
 #include <acpi/acmacros.h>
 
 #define ACPI_NUMA	0x80000000
xen/drivers/acpi/osl.c +4 -49

104 lines not on this page · raw message

xen/drivers/acpi/tables.c +1 -2
@@ -269,7 +269,7 @@ acpi_table_parse_madt(enum acpi_madt_typ
  * Scan the ACPI System Descriptor Table (STD) for a table matching @id,
  * run @handler on it.  Return 0 if table found, return on if not.
  */
-int acpi_table_parse(char *id, acpi_table_handler handler)
+int __init acpi_table_parse(char *id, acpi_table_handler handler)
 {
 	struct acpi_table_header *table = NULL;
 
@@ -324,7 +324,6 @@ static void __init check_multiple_madt(v
 
 int __init acpi_table_init(void)
 {
-	acpi_ut_init_globals();
 	acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
 	check_multiple_madt();
 	return 0;
xen/drivers/acpi/tables/tbinstal.c +1 -2
@@ -43,7 +43,6 @@
 
 #include <xen/init.h>
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
 #include <acpi/actables.h>
 
 #define _COMPONENT          ACPI_TABLES
@@ -60,7 +59,7 @@ ACPI_MODULE_NAME("tbinstal")
  * DESCRIPTION: this function is called to verify and map table
  *
  *****************************************************************************/
-acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
+acpi_status __init acpi_tb_verify_table(struct acpi_table_desc *table_desc)
 {
 	acpi_status status = AE_OK;
 
xen/drivers/acpi/tables/tbutils.c +4 -37

77 lines not on this page · raw message

xen/drivers/acpi/tables/tbxface.c +2 -7
@@ -45,7 +45,6 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
 #include <acpi/actables.h>
 
 #define _COMPONENT          ACPI_TABLES
@@ -164,7 +163,7 @@ acpi_initialize_tables(struct acpi_table
  * DESCRIPTION: Finds and verifies an ACPI table.
  *
  *****************************************************************************/
-acpi_status
+acpi_status __init
 acpi_get_table(char *signature,
 	       acpi_native_uint instance, struct acpi_table_header **out_table)
 {
@@ -198,14 +197,10 @@ acpi_get_table(char *signature,
 			*out_table = acpi_gbl_root_table_list.tables[i].pointer;
 		}
 
-		/*if (!acpi_gbl_permanent_mmap)*/ {
-			acpi_gbl_root_table_list.tables[i].pointer = NULL;
-		}
+		acpi_gbl_root_table_list.tables[i].pointer = NULL;
 
 		return (status);
 	}
 
 	return (AE_NOT_FOUND);
 }
-
-ACPI_EXPORT_SYMBOL(acpi_get_table)
xen/drivers/acpi/tables/tbxfroot.c +1 -3
@@ -52,8 +52,6 @@ ACPI_MODULE_NAME("tbxfroot")
 /* Local prototypes */
 static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length);
 
-static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_tb_validate_rsdp
@@ -66,7 +64,7 @@ static acpi_status acpi_tb_validate_rsdp
  *
  ******************************************************************************/
 
-static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
+static acpi_status __init acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
 {
 	ACPI_FUNCTION_ENTRY();
 
xen/drivers/acpi/utilities/utglobal.c +5 -538

592 lines not on this page · raw message

xen/drivers/acpi/utilities/utmisc.c +4 -54

88 lines not on this page · raw message

xen/drivers/passthrough/vtd/dmar.c +2 -15
@@ -46,6 +46,7 @@ LIST_HEAD_READ_MOSTLY(acpi_rmrr_units);
 static LIST_HEAD_READ_MOSTLY(acpi_atsr_units);
 static LIST_HEAD_READ_MOSTLY(acpi_rhsa_units);
 
+static struct acpi_table_header *__read_mostly dmar_table;
 static u64 __read_mostly igd_drhd_address;
 
 void dmar_scope_add_buses(struct dmar_scope *scope, u16 sec_bus, u16 sub_bus)
@@ -681,6 +682,7 @@ static int __init acpi_parse_dmar(struct
     u8 dmar_host_address_width;
     int ret = 0;
 
+    dmar_table = table;
     dmar = (struct acpi_table_dmar *)table;
 
     if ( !iommu_enabled )
@@ -772,22 +774,8 @@ int __init acpi_dmar_init(void)
     return parse_dmar_table(acpi_parse_dmar);
 }
 
-static struct acpi_table_header *get_dmar(void)
-{
-    struct acpi_table_header *dmar_table = NULL;
-    unsigned long flags;
-
-    /* Disabling IRQs avoids cross-CPU TLB flush in map_pages_to_xen(). */
-    local_irq_save(flags);
-    acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table);
-    local_irq_restore(flags);
-
-    return dmar_table;
-}
-
 void acpi_dmar_reinstate(void)
 {
-    struct acpi_table_header *dmar_table = get_dmar();
     if ( dmar_table == NULL )
         return;
     dmar_table->signature[0] = 'D';
@@ -796,7 +784,6 @@ void acpi_dmar_reinstate(void)
 
 void acpi_dmar_zap(void)
 {
-    struct acpi_table_header *dmar_table = get_dmar();
     if ( dmar_table == NULL )
         return;
     dmar_table->signature[0] = 'X';
xen/include/acpi/acexcep.h +5 -5
@@ -189,7 +189,7 @@
  * String versions of the exception codes above
  * These strings must match the corresponding defines exactly
  */
-char const *acpi_gbl_exception_names_env[] = {
+char const *__initdata acpi_gbl_exception_names_env[] = {
 	"AE_OK",
 	"AE_ERROR",
 	"AE_NO_ACPI_TABLES",
@@ -224,7 +224,7 @@ char const *acpi_gbl_exception_names_env
 	"AE_OWNER_ID_LIMIT"
 };
 
-char const *acpi_gbl_exception_names_pgm[] = {
+char const *__initdata acpi_gbl_exception_names_pgm[] = {
 	"AE_BAD_PARAMETER",
 	"AE_BAD_CHARACTER",
 	"AE_BAD_PATHNAME",
@@ -236,7 +236,7 @@ char const *acpi_gbl_exception_names_pgm
 	"AE_BAD_DECIMAL_CONSTANT"
 };
 
-char const *acpi_gbl_exception_names_tbl[] = {
+char const *__initdata acpi_gbl_exception_names_tbl[] = {
 	"AE_BAD_SIGNATURE",
 	"AE_BAD_HEADER",
 	"AE_BAD_CHECKSUM",
@@ -245,7 +245,7 @@ char const *acpi_gbl_exception_names_tbl
 	"AE_INVALID_TABLE_LENGTH"
 };
 
-char const *acpi_gbl_exception_names_aml[] = {
+char const *__initdata acpi_gbl_exception_names_aml[] = {
 	"AE_AML_ERROR",
 	"AE_AML_PARSE",
 	"AE_AML_BAD_OPCODE",
@@ -282,7 +282,7 @@ char const *acpi_gbl_exception_names_aml
 	"AE_AML_ILLEGAL_ADDRESS"
 };
 
-char const *acpi_gbl_exception_names_ctrl[] = {
+char const *__initdata acpi_gbl_exception_names_ctrl[] = {
 	"AE_CTRL_RETURN_VALUE",
 	"AE_CTRL_PENDING",
 	"AE_CTRL_TERMINATE",
xen/include/acpi/acglobal.h +0 -275

310 lines not on this page · raw message

xen/include/acpi/achware.h +0 -69

82 lines not on this page · raw message

xen/include/acpi/aclocal.h +0 -760

800 lines not on this page · raw message

xen/include/acpi/acmacros.h +0 -71

99 lines not on this page · raw message

xen/include/acpi/acnamesp.h deleted +0 -305

305 lines not on this page · raw message

xen/include/acpi/acobject.h deleted +0 -422

142 lines not on this page · raw message

xen/include/acpi/acpi.h +2 -2

Lines of this file are not shown. View the raw message.

xen/include/acpi/acpi_bus.h deleted +0 -389

389 lines not on this page · raw message

xen/include/acpi/acpi_drivers.h deleted +0 -111

111 lines not on this page · raw message

xen/include/acpi/acpiosxf.h +1 -195

196 lines not on this page · raw message

xen/include/acpi/acpixf.h +0 -217

217 lines not on this page · raw message

xen/include/acpi/acstruct.h deleted +0 -231

231 lines not on this page · raw message

xen/include/acpi/actables.h +0 -11

Lines of this file are not shown. View the raw message.

xen/include/acpi/actypes.h +0 -509

509 lines not on this page · raw message

xen/include/acpi/acutils.h +1 -373

374 lines not on this page · raw message

xen/include/asm-x86/acpi.h +0 -2

Lines of this file are not shown. View the raw message.

xen/include/asm-x86/system.h +0 -2

Lines of this file are not shown. View the raw message.

xen/include/xen/acpi.h +0 -74

74 lines not on this page · raw message

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

In some cases, entire files turned out unnecessary. Of what remains, move whatever possible into .init.*, and some data items into .data.read_mostly.

xen/arch/ia64/linux-xen/acpi.c +0 -2

Lines of this file are not shown. View the raw message.

xen/arch/ia64/linux-xen/acpi_numa.c +0 -1

Lines of this file are not shown. View the raw message.

xen/arch/x86/acpi/boot.c +8 -75

83 lines not on this page · raw message

xen/drivers/acpi/hwregs.c +3 -17

Lines of this file are not shown. View the raw message.

xen/drivers/acpi/numa.c +0 -1

Lines of this file are not shown. View the raw message.

xen/drivers/acpi/osl.c +4 -49

53 lines not on this page · raw message

xen/drivers/acpi/tables.c +1 -2

Lines of this file are not shown. View the raw message.

xen/drivers/acpi/tables/tbinstal.c +1 -2

Lines of this file are not shown. View the raw message.

xen/drivers/acpi/tables/tbutils.c +4 -37

41 lines not on this page · raw message

xen/drivers/acpi/tables/tbxface.c +2 -7

Lines of this file are not shown. View the raw message.

xen/drivers/acpi/tables/tbxfroot.c +1 -3

Lines of this file are not shown. View the raw message.

xen/drivers/acpi/utilities/utglobal.c +5 -538

543 lines not on this page · raw message

xen/drivers/acpi/utilities/utmisc.c +4 -54

58 lines not on this page · raw message

xen/drivers/passthrough/vtd/dmar.c +2 -15

Lines of this file are not shown. View the raw message.

xen/include/acpi/acexcep.h +5 -5

Lines of this file are not shown. View the raw message.

xen/include/acpi/acglobal.h +0 -275

275 lines not on this page · raw message

xen/include/acpi/achware.h +0 -69

69 lines not on this page · raw message

xen/include/acpi/aclocal.h +0 -760

760 lines not on this page · raw message

xen/include/acpi/acmacros.h +0 -71

71 lines not on this page · raw message

xen/include/acpi/acnamesp.h deleted +0 -305

305 lines not on this page · raw message

xen/include/acpi/acobject.h deleted +0 -422

422 lines not on this page · raw message

xen/include/acpi/acpi.h +2 -2

Lines of this file are not shown. View the raw message.

xen/include/acpi/acpi_bus.h deleted +0 -389

389 lines not on this page · raw message

xen/include/acpi/acpi_drivers.h deleted +0 -111

111 lines not on this page · raw message

xen/include/acpi/acpiosxf.h +1 -195

196 lines not on this page · raw message

xen/include/acpi/acpixf.h +0 -217

217 lines not on this page · raw message

xen/include/acpi/acstruct.h deleted +0 -231

231 lines not on this page · raw message

xen/include/acpi/actables.h +0 -11

Lines of this file are not shown. View the raw message.

xen/include/acpi/actypes.h +0 -509

509 lines not on this page · raw message

xen/include/acpi/acutils.h +1 -373

374 lines not on this page · raw message

xen/include/asm-x86/acpi.h +0 -2

Lines of this file are not shown. View the raw message.

xen/include/asm-x86/system.h +0 -2

Lines of this file are not shown. View the raw message.

xen/include/xen/acpi.h +0 -74

74 lines not on this page · raw message

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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

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