Just use boot_param->efi_memdesc_size directly instead, it seems
at least as clean, and possibly easier to follow.
Signed-Off-By: Simon Horman <[EMAIL PROTECTED]>
Index: kexec-tools-patch-boot-params/purgatory/arch/ia64/purgatory-ia64.c
===================================================================
--- kexec-tools-patch-boot-params.orig/purgatory/arch/ia64/purgatory-ia64.c
2006-09-20 15:54:37.000000000 +0900
+++ kexec-tools-patch-boot-params/purgatory/arch/ia64/purgatory-ia64.c
2006-09-20 15:55:16.000000000 +0900
@@ -152,12 +152,12 @@
{
void *dest = (void *)params->efi_memmap_base;
void *src = (void *)boot_param->efi_memmap;
- unsigned long memdesc_size = boot_param->efi_memdesc_size;
uint64_t orig_type;
efi_memory_desc_t *src_md, *dst_md;
void *src_end = src + boot_param->efi_memmap_size;
int i;
- for (; src < src_end; src += memdesc_size, dest += memdesc_size) {
+ for (; src < src_end; src += boot_param->efi_memdesc_size,
+ dest += boot_param->efi_memdesc_size) {
unsigned long mstart, mend;
src_md = src;
dst_md = dest;
@@ -180,7 +180,7 @@
continue;
while (seg->end > mend && src < src_end) {
- src += memdesc_size;
+ src += boot_param->efi_memdesc_size;
src_md = src;
/* TODO check contig and attribute here */
mend = src_md->phys_addr +
@@ -191,7 +191,7 @@
end_pages = (mend - seg->end) >> EFI_PAGE_SHIFT;
if (start_pages) {
dst_md->num_pages = start_pages;
- dest += memdesc_size;
+ dest += boot_param->efi_memdesc_size;
dst_md = dest;
memcpy(dst_md, src_md,
sizeof(efi_memory_desc_t));
@@ -201,7 +201,7 @@
dst_md->type = seg->reserved ?
EFI_UNUSABLE_MEMORY:EFI_LOADER_DATA;
if (end_pages) {
- dest += memdesc_size;
+ dest += boot_param->efi_memdesc_size;
dst_md = dest;
memcpy(dst_md, src_md,
sizeof(efi_memory_desc_t));
--
--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot