From: Andreas Schwab <schwab@suse.de>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] [PATCH] various eli patches
Date: Tue, 05 Sep 2000 13:32:13 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590678205451@msgid-missing> (raw)
Bill Nottingham <notting@redhat.com> writes:
|> These are against CVS of a couple of weeks ago.
|>
|> - eli-initrd-fix.patch: fixes initrd support, and a couple of compilation
|> tweaks. virt_to_phys() on an already physical address doesn't yeild a
|> working initrd location.
IMHO it is better to change read_file to expect a physical address for the
buffer, since this is all it uses anyway. That way there is no need to
convert from physical address to virtual address and back again.
Here is the patch to implement this:
--- eli.c~ Thu Aug 17 11:18:39 2000
+++ eli.c Thu Aug 17 11:27:08 2000
@@ -370,7 +370,7 @@
}
static EFI_STATUS read_file(EFI_FILE_HANDLE fs, EFI_FILE_HANDLE file,
- UINT64 vbuffer, UINT64 total_size)
+ EFI_PHYSICAL_ADDRESS buffer, UINT64 total_size)
{
EFI_STATUS status;
@@ -383,10 +383,8 @@
* needed.
*/
{
- EFI_PHYSICAL_ADDRESS buffer;
UINTN j = 0;
- buffer = virt_to_phys(vbuffer);
while (total_size > 0) {
CHAR8 helicopter[4] = { '|' , '/' , '-' , '\\' };
UINT64 size;
@@ -411,7 +409,7 @@
}
#else
size = total_size;
- status = fs->Read(file, &size, (VOID *) virt_to_phys(start_addr));
+ status = fs->Read(file, &size, (VOID *) buffer);
if (EFI_ERROR(status))
return EFI_LOAD_ERROR;
@@ -422,7 +420,7 @@
}
static INTN load_ramdisk(EFI_FILE_HANDLE fs, CHAR16 *filename,
- UINT64 start_addr, struct allocated_memory *memory)
+ EFI_PHYSICAL_ADDRESS start_addr, struct allocated_memory *memory)
{
EFI_FILE_HANDLE file;
EFI_STATUS status;
@@ -613,7 +611,7 @@
return EFI_LOAD_ERROR;
}
- status = read_file(fs, file, phdr.p_vaddr, phdr.p_filesz);
+ status = read_file(fs, file, virt_to_phys(phdr.p_vaddr), phdr.p_filesz);
if (EFI_ERROR(status)) {
Print(W2U(L"%s: read failed: %r\n"), filename, status);
BS->FreePages(min_addr, pages);
@@ -1263,6 +1261,9 @@
case EFI_LOAD_ERROR:
goto free_kernel_image;
}
+ } else {
+ initrd.start_addr = 0;
+ initrd.pages = 0;
}
/* Must free the ACPI before creating the boot params so the */
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
next reply other threads:[~2000-09-05 13:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-05 13:32 Andreas Schwab [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-08-29 20:19 [Linux-ia64] [PATCH] various eli patches Bill Nottingham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590678205451@msgid-missing \
--to=schwab@suse.de \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox