orphan
[debian/elilo] / initrd.c
index 09ed0f0eb8d2930fe552e8edf1935cc9f717b7be..7a68bb37e9852d67cccb2ab4749590a0ed8ae334 100644 (file)
--- a/initrd.c
+++ b/initrd.c
@@ -41,6 +41,10 @@ INTN
 load_file(CHAR16 *filename, memdesc_t *image)
 {
        EFI_STATUS status;
+       /*
+        * Actually using the value from sysdeps_initrd_get_addr()
+        * instead of NULL is no change for ia64!
+        */
        VOID *start_addr = image->start_addr;
        UINTN pgcnt;
        UINT64 size = 0;
@@ -71,15 +75,19 @@ load_file(CHAR16 *filename, memdesc_t *image)
        /* round up to get required number of pages (4KB) */
        image->pgcnt = pgcnt = EFI_SIZE_TO_PAGES(image->size);
 
-       start_addr = alloc_pages(pgcnt, EfiLoaderData, start_addr ? AllocateAddress : AllocateAnyPages, start_addr);
+       start_addr = alloc_pages(pgcnt, EfiLoaderData,
+               start_addr ? AllocateAddress : AllocateAnyPages, start_addr);
+
+       start_addr = sysdeps_checkfix_initrd(start_addr, image);
+
        if (start_addr == NULL) {
                ERR_PRT((L"Failed to allocate %d pages for %s image", pgcnt,
                         filename));
                goto error;
        }
-       VERB_PRT(2, Print(L"%s image: total_size: %ld bytes base: 0x%lx "
+       VERB_PRT(2, Print(L"%s image: total_size: %d bytes base: " PTR_FMT " "
                          "pages %d\n", filename, image->size,
-                         (UINTN)start_addr, pgcnt));
+                         start_addr, pgcnt));
 
        Print(L"Loading file %s...", filename);