Commit da3d3f98 authored by Aleksey Makarov's avatar Aleksey Makarov Committed by Rafael J. Wysocki

ACPI / tables: table upgrade: refactor function definitions

Refer initrd_start, initrd_end directly from drivers/acpi/tables.c.
This allows to use the table upgrade feature in architectures
other than x86.  Also this simplifies header files.

The patch renames acpi_table_initrd_init() to acpi_table_upgrade()
(what reflects the purpose of the function) and removes the unneeded
wraps early_acpi_table_init() and early_initrd_acpi_init().
Signed-off-by: default avatarAleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent ce0c1fcc
...@@ -399,10 +399,6 @@ static void __init reserve_initrd(void) ...@@ -399,10 +399,6 @@ static void __init reserve_initrd(void)
memblock_free(ramdisk_image, ramdisk_end - ramdisk_image); memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
} }
static void __init early_initrd_acpi_init(void)
{
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
}
#else #else
static void __init early_reserve_initrd(void) static void __init early_reserve_initrd(void)
{ {
...@@ -410,9 +406,6 @@ static void __init early_reserve_initrd(void) ...@@ -410,9 +406,6 @@ static void __init early_reserve_initrd(void)
static void __init reserve_initrd(void) static void __init reserve_initrd(void)
{ {
} }
static void __init early_initrd_acpi_init(void)
{
}
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
static void __init parse_setup_data(void) static void __init parse_setup_data(void)
...@@ -1146,7 +1139,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -1146,7 +1139,7 @@ void __init setup_arch(char **cmdline_p)
reserve_initrd(); reserve_initrd();
early_initrd_acpi_init(); acpi_table_upgrade();
vsmp_init(); vsmp_init();
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/earlycpio.h> #include <linux/earlycpio.h>
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/initrd.h>
#include "internal.h" #include "internal.h"
#ifdef CONFIG_ACPI_CUSTOM_DSDT #ifdef CONFIG_ACPI_CUSTOM_DSDT
...@@ -481,8 +482,10 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES); ...@@ -481,8 +482,10 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES);
#define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT) #define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT)
static void __init acpi_table_initrd_init(void *data, size_t size) void __init acpi_table_upgrade(void)
{ {
void *data = (void *)initrd_start;
size_t size = initrd_end - initrd_start;
int sig, no, table_nr = 0, total_offset = 0; int sig, no, table_nr = 0, total_offset = 0;
long offset = 0; long offset = 0;
struct acpi_table_header *table; struct acpi_table_header *table;
...@@ -696,10 +699,6 @@ static void __init acpi_table_initrd_scan(void) ...@@ -696,10 +699,6 @@ static void __init acpi_table_initrd_scan(void)
} }
} }
#else #else
static void __init acpi_table_initrd_init(void *data, size_t size)
{
}
static acpi_status static acpi_status
acpi_table_initrd_override(struct acpi_table_header *existing_table, acpi_table_initrd_override(struct acpi_table_header *existing_table,
acpi_physical_address *address, acpi_physical_address *address,
...@@ -742,11 +741,6 @@ acpi_os_table_override(struct acpi_table_header *existing_table, ...@@ -742,11 +741,6 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
return AE_OK; return AE_OK;
} }
void __init early_acpi_table_init(void *data, size_t size)
{
acpi_table_initrd_init(data, size);
}
/* /*
* acpi_table_init() * acpi_table_init()
* *
......
...@@ -208,7 +208,6 @@ void acpi_boot_table_init (void); ...@@ -208,7 +208,6 @@ void acpi_boot_table_init (void);
int acpi_mps_check (void); int acpi_mps_check (void);
int acpi_numa_init (void); int acpi_numa_init (void);
void early_acpi_table_init(void *data, size_t size);
int acpi_table_init (void); int acpi_table_init (void);
int acpi_table_parse(char *id, acpi_tbl_table_handler handler); int acpi_table_parse(char *id, acpi_tbl_table_handler handler);
int __init acpi_parse_entries(char *id, unsigned long table_size, int __init acpi_parse_entries(char *id, unsigned long table_size,
...@@ -588,7 +587,6 @@ static inline const char *acpi_dev_name(struct acpi_device *adev) ...@@ -588,7 +587,6 @@ static inline const char *acpi_dev_name(struct acpi_device *adev)
return NULL; return NULL;
} }
static inline void early_acpi_table_init(void *data, size_t size) { }
static inline void acpi_early_init(void) { } static inline void acpi_early_init(void) { }
static inline void acpi_subsystem_init(void) { } static inline void acpi_subsystem_init(void) { }
...@@ -997,4 +995,10 @@ static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev, ...@@ -997,4 +995,10 @@ static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
#define acpi_probe_device_table(t) ({ int __r = 0; __r;}) #define acpi_probe_device_table(t) ({ int __r = 0; __r;})
#endif #endif
#ifdef CONFIG_ACPI_TABLE_UPGRADE
void acpi_table_upgrade(void);
#else
static inline void acpi_table_upgrade(void) { }
#endif
#endif /*_LINUX_ACPI_H*/ #endif /*_LINUX_ACPI_H*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment