All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Juan Quintela <quintela@trasno.org>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/4] rom loader: make vga+rom loading target specific
Date: Mon, 19 Oct 2009 09:58:18 +0200	[thread overview]
Message-ID: <4ADC1C1A.8060208@redhat.com> (raw)
In-Reply-To: <m3pr8mz85d.fsf@neno.mitica>

On 10/17/09 11:23, Juan Quintela wrote:
>> +ifdef TARGET_I386
>> +obj-y += loader-i386.o
>> +else
>> +obj-y += loader-dummy.o
>> +endif
>> +
>
> This is wrong (tm).
> a- TARGET_I386 on Makefiles is only defined for 32bits, not for 64bits
>     (don't blame me, I just did a direct conversion of what was there).

Oh.  Joy of inconsistency ...

> b- TARGET_* is only defined in {i386,x86_64,...}-{softmmu,linux-user,...}
>     i.e. not a chance to be read at hw/Makefile.
>
> </me does patch>
>
> More complex that I thought:
> - if you only want to compile it once, you need to compile it on
>    Makefile, not Makefile.hw: no cookie, loader.h uses target_phys_addr.

Exactly.  Due to target_phys_addr it must go to Makefile.hw, so I get it 
compiled once for 32bit targphys and once for 64bit targphys.

> - ok, move it to Makefile.hw ->  your option didn't work (it compiles)
>    because you allways compile loader-dummy.o, TARGET_I386 is not defined
>    in Makefile.hw (it is hardware independent drivers after all :)

Oops.

> - More imagination: Use only loader-i386.c, and #ifdef TARGET_I386
>    to an empty macro/real thing ->  no cookie either, TARGET_I386 is
>    poisoned in Makefile.hw (*)

Thats why I don't want #ifdef.

> - define CONFIG_LOADER_I386 for I386 and X86_64.

No.  This avoids the TARGET_I386 poisoned error, but does *not* fix the 
underlying problem.

> I preffer very much to add the "dummy" cases in one ifdef in a header
> file.

No.  Any user of rom_add_option() must be compiled per target then.

Guess easierst way is the v1 patch then:  Have target-specific code in 
loader-target.c and use #ifdefs there ...

cheers,
   Gerd

  reply	other threads:[~2009-10-19  7:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16 14:04 [Qemu-devel] [PATCH v2 0/4] more rom loader patches Gerd Hoffmann
2009-10-16 14:04 ` [Qemu-devel] [PATCH 1/4] rom loader: use qemu_strdup Gerd Hoffmann
2009-10-16 14:04 ` [Qemu-devel] [PATCH 2/4] rom loader: make vga+rom loading target specific Gerd Hoffmann
2009-10-17  9:23   ` [Qemu-devel] " Juan Quintela
2009-10-19  7:58     ` Gerd Hoffmann [this message]
2009-10-16 14:04 ` [Qemu-devel] [PATCH 3/4] vga roms: move loading from pc.c to vga drivers Gerd Hoffmann
2009-10-16 14:04 ` [Qemu-devel] [PATCH 4/4] use rom loader for pc bios Gerd Hoffmann

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=4ADC1C1A.8060208@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@trasno.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.