[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 02/40] elf: Add notes implementation
From: |
Alexander Graf |
Subject: |
[Qemu-devel] Re: [PATCH 02/40] elf: Add notes implementation |
Date: |
Mon, 1 Nov 2010 15:48:46 -0400 |
On 01.11.2010, at 15:43, Paolo Bonzini wrote:
> On 11/01/2010 07:52 PM, Alexander Graf wrote:
>>>> @@ -237,6 +242,8 @@ static uint64_t elf_default_translate(void *opaque,
>>>> uint64_t addr)
>>>> ElfHandlers elf_default_handlers = {
>>>> .translate_fn = elf_default_translate,
>>>> .translate_opaque = NULL,
>>>> + .note_fn = elf_default_note,
>>>> + .note_opaque = NULL,
>>>
>>> Don't you have to add the definition to every user of translate_fn?
>>>
>>> Maybe it's better to guard calls through the pointers with an if.
>>
>> All users either pass NULL as translate (which means they default to
>> elf_default_translate) or initialize their structure with the values in
>> elf_default_translate :)
>
> But do the MIPS users initialize note_fn?
They should:
@@ -106,8 +106,10 @@ static int64_t load_kernel (CPUState *env)
ram_addr_t initrd_offset;
uint32_t *prom_buf;
long prom_size;
+ ElfHandlers handlers = elf_default_handlers;
- if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
+ handlers.translate_fn = cpu_mips_kseg0_to_phys;
+ if (load_elf(loaderparams.kernel_filename, &handlers,
(uint64_t *)&kernel_entry, (uint64_t *)&kernel_low,
(uint64_t *)&kernel_high, 0, ELF_MACHINE, 1) < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
Unless my C foo is really bad, this means that handlers is initialized with the
contents of elf_default_handlers :). And that's how every caller works.
Alex
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, (continued)
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, Stefan Weil, 2010/11/01
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, Alexander Graf, 2010/11/01
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, Stefan Weil, 2010/11/01
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, Alexander Graf, 2010/11/01
- [Qemu-devel] Re: [PATCH 02/40] elf: Add notes implementation, Paolo Bonzini, 2010/11/01
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, Stefan Weil, 2010/11/01
- Re: [Qemu-devel] [PATCH 02/40] elf: Add notes implementation, Michael Matz, 2010/11/02
[Qemu-devel] Re: [PATCH 02/40] elf: Add notes implementation, Paolo Bonzini, 2010/11/01
[Qemu-devel] [PATCH 05/40] xen-disk: disable aio, Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 31/40] xenner: libxc emu: xenstore, Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 04/40] elf: add section analyzer, Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 10/40] xenner: kernel: Hypercall handler (i386), Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 11/40] xenner: kernel: Hypercall handler (x86_64), Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 07/40] xenner: kernel: 32 bit files, Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 26/40] xenner: kernel: xen-names, Alexander Graf, 2010/11/01
[Qemu-devel] [PATCH 16/40] xenner: kernel: Main (i386), Alexander Graf, 2010/11/01