@@ -335,6 +335,33 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
return fdt_totalsize(fdt);
}
+const char *boot_fdt_cmdline(const void *fdt)
+{
+ int node;
+ const struct fdt_property *prop;
+
+ node = fdt_path_offset(fdt, "/chosen");
+ if ( node < 0 )
+ return NULL;
+
+ prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
+ if ( prop == NULL )
+ {
+ struct bootmodule *dom0_mod = NULL;
+
+ if ( bootinfo.modules.nr_mods >= MOD_KERNEL )
+ dom0_mod = &bootinfo.modules.module[MOD_KERNEL];
+
+ if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
+ ( dom0_mod && dom0_mod->cmdline[0] ) )
+ prop = fdt_get_property(fdt, node, "bootargs", NULL);
+ }
+ if ( prop == NULL )
+ return NULL;
+
+ return prop->data;
+}
+
/*
* Local variables:
* mode: C
@@ -686,7 +686,7 @@ void __init start_xen(unsigned long boot_phys_offset,
+ (fdt_paddr & ((1 << SECOND_SHIFT) - 1));
fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);
- cmdline = device_tree_bootargs(device_tree_flattened);
+ cmdline = boot_fdt_cmdline(device_tree_flattened);
printk("Command line: %s\n", cmdline);
cmdline_parse(cmdline);
@@ -115,37 +115,6 @@ void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
dt_set_cell(cellp, dt_n_size_cells(np), size);
}
-/**
- * device_tree_bootargs - return the bootargs (the Xen command line)
- * @fdt flat device tree.
- */
-const char *device_tree_bootargs(const void *fdt)
-{
- int node;
- const struct fdt_property *prop;
-
- node = fdt_path_offset(fdt, "/chosen");
- if ( node < 0 )
- return NULL;
-
- prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
- if ( prop == NULL )
- {
- struct bootmodule *dom0_mod = NULL;
-
- if ( bootinfo.modules.nr_mods >= MOD_KERNEL )
- dom0_mod = &bootinfo.modules.module[MOD_KERNEL];
-
- if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
- ( dom0_mod && dom0_mod->cmdline[0] ) )
- prop = fdt_get_property(fdt, node, "bootargs", NULL);
- }
- if ( prop == NULL )
- return NULL;
-
- return prop->data;
-}
-
static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
unsigned long align)
{
@@ -54,6 +54,7 @@ int construct_dom0(struct domain *d);
void discard_initial_modules(void);
size_t __init boot_fdt_info(const void *fdt, paddr_t paddr);
+const char __init *boot_fdt_cmdline(const void *fdt);
#endif
/*
@@ -159,8 +159,6 @@ typedef int (*device_tree_node_func)(const void *fdt,
extern const void *device_tree_flattened;
-const char __init *device_tree_bootargs(const void *fdt);
-
/**
* dt_unflatten_host_device_tree - Unflatten the host device tree
*