# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1301756302 -3600
# Node ID f9c85ce4795593b4f4599325181da78fa11ec5d3
# Parent 5f3b7050a203acc861c90efefb76adbb6c0b4058
x86/ACPI: __init-annotate
xen/arch/x86/acpi/boot.c consists of almost only code/data in .init.*,
so move the few bits that aren't into a new file and then use the
recently introduced .init.o mechanism to move all the literal strings
into .init.rodata.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
diff -r 5f3b7050a203 -r f9c85ce47955 xen/arch/x86/acpi/Makefile
--- a/xen/arch/x86/acpi/Makefile Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/arch/x86/acpi/Makefile Sat Apr 02 15:58:22 2011 +0100
@@ -1,4 +1,4 @@
subdir-y += cpufreq
-obj-y += boot.o power.o suspend.o cpu_idle.o cpuidle_menu.o
-obj-bin-y += wakeup_prot.o
+obj-y += lib.o power.o suspend.o cpu_idle.o cpuidle_menu.o
+obj-bin-y += boot.init.o wakeup_prot.o
diff -r 5f3b7050a203 -r f9c85ce47955 xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/arch/x86/acpi/boot.c Sat Apr 02 15:58:22 2011 +0100
@@ -69,58 +69,10 @@
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
#endif
-u32 __read_mostly acpi_smi_cmd;
-u8 __read_mostly acpi_enable_value;
-u8 __read_mostly acpi_disable_value;
-
-u32 __read_mostly x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
- {[0 ... MAX_MADT_ENTRIES - 1] = BAD_APICID };
-
/* --------------------------------------------------------------------------
Boot-time Configuration
--------------------------------------------------------------------------
*/
-/*
- * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
- * to map the target physical address. The problem is that set_fixmap()
- * provides a single page, and it is possible that the page is not
- * sufficient.
- * By using this area, we can map up to MAX_IO_APICS pages temporarily,
- * i.e. until the next __va_range() call.
- *
- * Important Safety Note: The fixed I/O APIC page numbers are *subtracted*
- * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and
- * count idx down while incrementing the phys address.
- */
-char *__acpi_map_table(unsigned long phys, unsigned long size)
-{
- unsigned long base, offset, mapped_size;
- int idx;
-
- /* XEN: RAM holes above 1MB are not permanently mapped. */
- if ((phys + size) <= (1 * 1024 * 1024))
- return __va(phys);
-
- offset = phys & (PAGE_SIZE - 1);
- mapped_size = PAGE_SIZE - offset;
- set_fixmap(FIX_ACPI_END, phys);
- base = fix_to_virt(FIX_ACPI_END);
-
- /*
- * Most cases can be covered by the below.
- */
- idx = FIX_ACPI_END;
- while (mapped_size < size) {
- if (--idx < FIX_ACPI_BEGIN)
- return NULL; /* cannot handle this */
- phys += PAGE_SIZE;
- set_fixmap(idx, phys);
- mapped_size += PAGE_SIZE;
- }
-
- return ((char *) base + offset);
-}
-
#ifdef CONFIG_X86_LOCAL_APIC
static int __init acpi_parse_madt(struct acpi_table_header *table)
{
@@ -927,17 +879,3 @@
return 0;
}
-
-unsigned int acpi_get_processor_id(unsigned int cpu)
-{
- unsigned int acpiid, apicid;
-
- if ((apicid = x86_cpu_to_apicid[cpu]) == BAD_APICID)
- return INVALID_ACPIID;
-
- for (acpiid = 0; acpiid < ARRAY_SIZE(x86_acpiid_to_apicid); acpiid++)
- if (x86_acpiid_to_apicid[acpiid] == apicid)
- return acpiid;
-
- return INVALID_ACPIID;
-}
diff -r 5f3b7050a203 -r f9c85ce47955 xen/arch/x86/acpi/lib.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/acpi/lib.c Sat Apr 02 15:58:22 2011 +0100
@@ -0,0 +1,83 @@
+/*
+ * lib.c - Architecture-Specific Low-Level ACPI Support
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <xen/config.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/acpi.h>
+#include <asm/apic.h>
+#include <asm/fixmap.h>
+
+u32 __read_mostly acpi_smi_cmd;
+u8 __read_mostly acpi_enable_value;
+u8 __read_mostly acpi_disable_value;
+
+u32 __read_mostly x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
+ {[0 ... MAX_MADT_ENTRIES - 1] = BAD_APICID };
+
+/*
+ * Important Safety Note: The fixed ACPI page numbers are *subtracted*
+ * from the fixed base. That's why we start at FIX_ACPI_END and
+ * count idx down while incrementing the phys address.
+ */
+char *__acpi_map_table(unsigned long phys, unsigned long size)
+{
+ unsigned long base, offset, mapped_size;
+ int idx;
+
+ /* XEN: RAM holes above 1MB are not permanently mapped. */
+ if ((phys + size) <= (1 * 1024 * 1024))
+ return __va(phys);
+
+ offset = phys & (PAGE_SIZE - 1);
+ mapped_size = PAGE_SIZE - offset;
+ set_fixmap(FIX_ACPI_END, phys);
+ base = fix_to_virt(FIX_ACPI_END);
+
+ /*
+ * Most cases can be covered by the below.
+ */
+ idx = FIX_ACPI_END;
+ while (mapped_size < size) {
+ if (--idx < FIX_ACPI_BEGIN)
+ return NULL; /* cannot handle this */
+ phys += PAGE_SIZE;
+ set_fixmap(idx, phys);
+ mapped_size += PAGE_SIZE;
+ }
+
+ return ((char *) base + offset);
+}
+
+unsigned int acpi_get_processor_id(unsigned int cpu)
+{
+ unsigned int acpiid, apicid;
+
+ if ((apicid = x86_cpu_to_apicid[cpu]) == BAD_APICID)
+ return INVALID_ACPIID;
+
+ for (acpiid = 0; acpiid < ARRAY_SIZE(x86_acpiid_to_apicid); acpiid++)
+ if (x86_acpiid_to_apicid[acpiid] == apicid)
+ return acpiid;
+
+ return INVALID_ACPIID;
+}
diff -r 5f3b7050a203 -r f9c85ce47955 xen/drivers/acpi/tables/Makefile
--- a/xen/drivers/acpi/tables/Makefile Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/drivers/acpi/tables/Makefile Sat Apr 02 15:58:22 2011 +0100
@@ -1,5 +1,5 @@
-obj-y += tbfadt.o
-obj-y += tbinstal.o
+obj-bin-y += tbfadt.init.o
+obj-bin-y += tbinstal.init.o
obj-y += tbutils.o
-obj-y += tbxface.o
-obj-y += tbxfroot.o
+obj-bin-y += tbxface.init.o
+obj-bin-y += tbxfroot.init.o
diff -r 5f3b7050a203 -r f9c85ce47955 xen/drivers/acpi/tables/tbxface.c
--- a/xen/drivers/acpi/tables/tbxface.c Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/drivers/acpi/tables/tbxface.c Sat Apr 02 15:58:22 2011 +0100
@@ -67,7 +67,8 @@
acpi_status __init acpi_allocate_root_table(u32 initial_table_count)
{
- acpi_gbl_root_table_list.size = initial_table_count;
+ acpi_gbl_root_table_list.size = initial_table_count -
+ ACPI_ROOT_TABLE_SIZE_INCREMENT;
acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE;
return (acpi_tb_resize_root_table_list());
diff -r 5f3b7050a203 -r f9c85ce47955 xen/drivers/acpi/utilities/Makefile
--- a/xen/drivers/acpi/utilities/Makefile Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/drivers/acpi/utilities/Makefile Sat Apr 02 15:58:22 2011 +0100
@@ -1,2 +1,2 @@
obj-y += utglobal.o
-obj-y += utmisc.o
+obj-bin-y += utmisc.init.o
diff -r 5f3b7050a203 -r f9c85ce47955 xen/drivers/acpi/utilities/utmisc.c
--- a/xen/drivers/acpi/utilities/utmisc.c Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/drivers/acpi/utilities/utmisc.c Sat Apr 02 15:58:22 2011 +0100
@@ -135,7 +135,7 @@
******************************************************************************/
void ACPI_INTERNAL_VAR_XFACE __init
-acpi_ut_error(char *module_name, u32 line_number, char *format, ...)
+acpi_ut_error(const char *module_name, u32 line_number, char *format, ...)
{
va_list args;
@@ -148,7 +148,7 @@
}
void ACPI_INTERNAL_VAR_XFACE __init
-acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
+acpi_ut_warning(const char *module_name, u32 line_number, char *format, ...)
{
va_list args;
@@ -162,7 +162,7 @@
}
void ACPI_INTERNAL_VAR_XFACE __init
-acpi_ut_info(char *module_name, u32 line_number, char *format, ...)
+acpi_ut_info(const char *module_name, u32 line_number, char *format, ...)
{
va_list args;
diff -r 5f3b7050a203 -r f9c85ce47955 xen/include/acpi/acmacros.h
--- a/xen/include/acpi/acmacros.h Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/include/acpi/acmacros.h Sat Apr 02 15:58:22 2011 +0100
@@ -413,7 +413,7 @@
* error messages. The __FILE__ macro is not very useful for this, because it
* often includes the entire pathname to the module
*/
-#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR
*_acpi_module_name = name;
+#define ACPI_MODULE_NAME(name) static const char ACPI_UNUSED_VAR
_acpi_module_name[] = name;
#else
#define ACPI_MODULE_NAME(name)
#endif
diff -r 5f3b7050a203 -r f9c85ce47955 xen/include/acpi/acutils.h
--- a/xen/include/acpi/acutils.h Sat Apr 02 15:57:35 2011 +0100
+++ b/xen/include/acpi/acutils.h Sat Apr 02 15:58:22 2011 +0100
@@ -121,41 +121,41 @@
void
acpi_ut_trace(u32 line_number,
- const char *function_name, char *module_name, u32 component_id);
+ const char *function_name, const char *module_name, u32
component_id);
void
acpi_ut_trace_ptr(u32 line_number,
const char *function_name,
- char *module_name, u32 component_id, void *pointer);
+ const char *module_name, u32 component_id, void *pointer);
void
acpi_ut_trace_u32(u32 line_number,
const char *function_name,
- char *module_name, u32 component_id, u32 integer);
+ const char *module_name, u32 component_id, u32 integer);
void
acpi_ut_trace_str(u32 line_number,
const char *function_name,
- char *module_name, u32 component_id, char *string);
+ const char *module_name, u32 component_id, char *string);
void
acpi_ut_exit(u32 line_number,
- const char *function_name, char *module_name, u32 component_id);
+ const char *function_name, const char *module_name, u32
component_id);
void
acpi_ut_status_exit(u32 line_number,
const char *function_name,
- char *module_name, u32 component_id, acpi_status status);
+ const char *module_name, u32 component_id, acpi_status
status);
void
acpi_ut_value_exit(u32 line_number,
const char *function_name,
- char *module_name, u32 component_id, acpi_integer value);
+ const char *module_name, u32 component_id, acpi_integer
value);
void
acpi_ut_ptr_exit(u32 line_number,
const char *function_name,
- char *module_name, u32 component_id, u8 * ptr);
+ const char *module_name, u32 component_id, u8 * ptr);
/* Error and message reporting interfaces */
@@ -163,32 +163,32 @@
acpi_ut_debug_print(u32 requested_debug_level,
u32 line_number,
const char *function_name,
- char *module_name,
+ const char *module_name,
u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6);
void ACPI_INTERNAL_VAR_XFACE
acpi_ut_debug_print_raw(u32 requested_debug_level,
u32 line_number,
const char *function_name,
- char *module_name,
+ const char *module_name,
u32 component_id,
char *format, ...) ACPI_PRINTF_LIKE(6);
void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_error(char *module_name,
+acpi_ut_error(const char *module_name,
u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_exception(char *module_name,
+acpi_ut_exception(const char *module_name,
u32 line_number,
acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4);
void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_warning(char *module_name,
+acpi_ut_warning(const char *module_name,
u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_info(char *module_name,
+acpi_ut_info(const char *module_name,
u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
/*
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|