Fix endian problems with handling of memreserve entries (bug pointed out

by Pantelis Antoniou).  The rule is that the memreserve data in struct
boot_info is always stored big-endian.
This commit is contained in:
David Gibson 2005-08-29 13:36:15 +10:00
parent 230f253e9b
commit 6c0f36769a
2 changed files with 15 additions and 25 deletions

View file

@ -168,8 +168,9 @@ void write_tree_source(FILE *f, struct boot_info *bi)
bi->mem_reserve_data.val) + i;
fprintf(f, "/memreserve/\t%016llx-%016llx;\n",
(unsigned long long)re->address,
(unsigned long long)re->address + re->size - 1);
(unsigned long long)be64_to_cpu(re->address),
(unsigned long long)(be64_to_cpu(re->address)
+ be64_to_cpu(re->size) - 1));
}
write_tree_source_node(f, bi->dt, 0);