[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XenPPC] [xenppc-unstable] [POWERPC][TOOLS] add the ability to replace an entry in the ft rsvmap
# HG changeset patch # User Jimi Xenidis <jimix@xxxxxxxxxxxxxx> # Node ID d0faa25f5d3af8d4b0c97f3482d95dad2db1dec1 # Parent 4490f6744b286d62fec3d0792ba5a44db114153b [POWERPC][TOOLS] add the ability to replace an entry in the ft rsvmap Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx> --- tools/libxc/powerpc64/flatdevtree.c | 23 +++++++++++++++++++++++ tools/libxc/powerpc64/flatdevtree.h | 1 + 2 files changed, 24 insertions(+) diff -r 4490f6744b28 -r d0faa25f5d3a tools/libxc/powerpc64/flatdevtree.c --- a/tools/libxc/powerpc64/flatdevtree.c Thu Sep 14 22:06:15 2006 -0400 +++ b/tools/libxc/powerpc64/flatdevtree.c Fri Sep 15 12:55:14 2006 -0400 @@ -220,6 +220,29 @@ void ft_add_rsvmap(struct ft_cxt *cxt, u cxt->p_anchor = cxt->pres + 16; /* over the terminator */ } +int ft_set_rsvmap(void *bphp, int m, u64 physaddr, u64 size) +{ + const struct boot_param_header *bph = bphp; + u64 *p_rsvmap = (u64 *) + ((char *)bph + be32_to_cpu(bph->off_mem_rsvmap)); + u32 i; + + for (i = 0;; i++) { + u64 addr, sz; + + addr = be64_to_cpu(p_rsvmap[i * 2]); + sz = be64_to_cpu(p_rsvmap[i * 2 + 1]); + if (addr == 0 && size == 0) + break; + if (m == i) { + p_rsvmap[i * 2] = cpu_to_be64(physaddr); + p_rsvmap[i * 2 + 1] = cpu_to_be64(size); + return 0; + } + } + return -1; +} + void ft_begin_tree(struct ft_cxt *cxt) { cxt->p_begin = cxt->p_anchor; diff -r 4490f6744b28 -r d0faa25f5d3a tools/libxc/powerpc64/flatdevtree.h --- a/tools/libxc/powerpc64/flatdevtree.h Thu Sep 14 22:06:15 2006 -0400 +++ b/tools/libxc/powerpc64/flatdevtree.h Fri Sep 15 12:55:14 2006 -0400 @@ -66,6 +66,7 @@ void ft_prop_int(struct ft_cxt *cxt, con void ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val); void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size); void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size); +int ft_set_rsvmap(void *bphp, int m, u64 physaddr, u64 size); void ft_dump_blob(const void *bphp); void ft_merge_blob(struct ft_cxt *cxt, void *blob); _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ppc-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |