mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/common: Move Arm's bootfdt.c to common
Move Arm's bootfdt.c to xen/common so that it can be used by other device tree architectures like PPC and RISCV. Remove stubs for process_shm_node() and early_print_info_shmem() from $xen/arch/arm/include/asm/static-shmem.h. These stubs are removed to avoid introducing them for architectures that do not support CONFIG_STATIC_SHM. The process_shm_node() stub is now implemented in common code to maintain the current behavior of early_scan_code() on ARM. The early_print_info_shmem() stub is only used in early_print_info(), so it's now guarded with #ifdef CONFIG_STATIC_SHM ... #endif. Suggested-by: Julien Grall <julien@xen.org> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Acked-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
1 parent
d6c57aa085
commit
f06fbfe54d
6 files changed
+34
-28
No files matched your search
@@ -10,7 +10,6 @@ obj-$(CONFIG_TEE) += tee/
|
||||
obj-$(CONFIG_HAS_VPCI) += vpci.o
|
||||
|
||||
obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
|
||||
obj-y += bootfdt.init.o
|
||||
obj-y += cpuerrata.o
|
||||
obj-y += cpufeature.o
|
||||
obj-y += decode.o
|
||||
|
||||
@@ -41,19 +41,6 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
|
||||
void (*cb)(paddr_t ps, paddr_t pe),
|
||||
unsigned int first);
|
||||
|
||||
bool check_reserved_regions_overlap(paddr_t region_start, paddr_t region_size);
|
||||
|
||||
struct bootmodule *add_boot_module(bootmodule_kind kind,
|
||||
paddr_t start, paddr_t size, bool domU);
|
||||
struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind);
|
||||
struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind,
|
||||
paddr_t start);
|
||||
void add_boot_cmdline(const char *name, const char *cmdline,
|
||||
bootmodule_kind kind, paddr_t start, bool domU);
|
||||
struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
|
||||
struct bootcmdline * boot_cmdline_find_by_name(const char *name);
|
||||
const char *boot_module_kind_as_string(bootmodule_kind kind);
|
||||
|
||||
void init_pdx(void);
|
||||
void setup_mm(void);
|
||||
|
||||
|
||||
@@ -80,15 +80,6 @@ static inline int process_shm_chosen(struct domain *d,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int process_shm_node(const void *fdt, int node,
|
||||
uint32_t address_cells, uint32_t size_cells)
|
||||
{
|
||||
printk("CONFIG_STATIC_SHM must be enabled for parsing static shared memory nodes\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void early_print_info_shmem(void) {};
|
||||
|
||||
static inline void init_sharedmem_pages(void) {};
|
||||
|
||||
static inline int remove_shm_from_rangeset(const struct kernel_info *kinfo,
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
obj-y += bootfdt.init.o
|
||||
obj-y += bootinfo.init.o
|
||||
obj-y += device-tree.o
|
||||
@@ -4,18 +4,20 @@
|
||||
*
|
||||
* Copyright (C) 2012-2014 Citrix Systems, Inc.
|
||||
*/
|
||||
#include <xen/types.h>
|
||||
#include <xen/lib.h>
|
||||
#include <xen/kernel.h>
|
||||
#include <xen/init.h>
|
||||
#include <xen/efi.h>
|
||||
|
||||
#include <xen/bootfdt.h>
|
||||
#include <xen/device_tree.h>
|
||||
#include <xen/efi.h>
|
||||
#include <xen/init.h>
|
||||
#include <xen/kernel.h>
|
||||
#include <xen/lib.h>
|
||||
#include <xen/libfdt/libfdt-xen.h>
|
||||
#include <xen/sort.h>
|
||||
#include <xsm/xsm.h>
|
||||
#include <asm/setup.h>
|
||||
#ifdef CONFIG_STATIC_SHM
|
||||
#include <asm/static-shmem.h>
|
||||
#endif
|
||||
|
||||
static void __init __maybe_unused build_assertions(void)
|
||||
{
|
||||
@@ -462,6 +464,16 @@ static int __init process_domain_node(const void *fdt, int node,
|
||||
MEMBANK_STATIC_DOMAIN);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_STATIC_SHM
|
||||
static inline int process_shm_node(const void *fdt, int node,
|
||||
uint32_t address_cells, uint32_t size_cells)
|
||||
{
|
||||
printk("CONFIG_STATIC_SHM must be enabled for parsing static shared"
|
||||
" memory nodes\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __init early_scan_node(const void *fdt,
|
||||
int node, const char *name, int depth,
|
||||
u32 address_cells, u32 size_cells,
|
||||
@@ -521,7 +533,9 @@ static void __init early_print_info(void)
|
||||
mem_resv->bank[i].start,
|
||||
mem_resv->bank[i].start + mem_resv->bank[i].size - 1);
|
||||
}
|
||||
#ifdef CONFIG_STATIC_SHM
|
||||
early_print_info_shmem();
|
||||
#endif
|
||||
printk("\n");
|
||||
for ( i = 0 ; i < cmds->nr_mods; i++ )
|
||||
printk("CMDLINE[%"PRIpaddr"]:%s %s\n", cmds->cmdline[i].start,
|
||||
@@ -157,6 +157,20 @@ struct bootinfo {
|
||||
|
||||
extern struct bootinfo bootinfo;
|
||||
|
||||
bool check_reserved_regions_overlap(paddr_t region_start,
|
||||
paddr_t region_size);
|
||||
|
||||
struct bootmodule *add_boot_module(bootmodule_kind kind,
|
||||
paddr_t start, paddr_t size, bool domU);
|
||||
struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind);
|
||||
struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind,
|
||||
paddr_t start);
|
||||
void add_boot_cmdline(const char *name, const char *cmdline,
|
||||
bootmodule_kind kind, paddr_t start, bool domU);
|
||||
struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
|
||||
struct bootcmdline * boot_cmdline_find_by_name(const char *name);
|
||||
const char *boot_module_kind_as_string(bootmodule_kind kind);
|
||||
|
||||
void populate_boot_allocator(void);
|
||||
|
||||
size_t boot_fdt_info(const void *fdt, paddr_t paddr);
|
||||
|
||||