[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/core/generic-loader: Compile only once, not
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] hw/core/generic-loader: Compile only once, not for each target |
Date: |
Fri, 5 Oct 2018 11:48:19 +0100 |
On 5 October 2018 at 11:15, Thomas Huth <address@hidden> wrote:
> The generic-loader is currently compiled target specific due to one
> single "#ifdef TARGET_WORDS_BIGENDIAN" in the file. We've already
> got a function called target_words_bigendian() for this instead, so
> we can put the generic-loader into common-obj to save some compilation
> time.
>
> Signed-off-by: Thomas Huth <address@hidden>
> ---
> exec.c | 1 -
> hw/core/Makefile.objs | 2 +-
> hw/core/generic-loader.c | 6 +-----
> hw/virtio/virtio.c | 1 -
> include/qom/cpu.h | 2 ++
> qom/cpu.c | 1 -
> 6 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index d0821e6..3ae0e54 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3910,7 +3910,6 @@ int qemu_target_page_bits_min(void)
> * A helper function for the _utterly broken_ virtio device model to find
> out if
> * it's running on a big endian machine. Don't do this at home kids!
> */
> -bool target_words_bigendian(void);
> bool target_words_bigendian(void)
> {
> #if defined(TARGET_WORDS_BIGENDIAN)
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -1085,6 +1085,8 @@ void cpu_exec_initfn(CPUState *cpu);
> void cpu_exec_realizefn(CPUState *cpu, Error **errp);
> void cpu_exec_unrealizefn(CPUState *cpu);
>
> +bool target_words_bigendian(void);
> +
Can we have a doc comment for a new global function in a header
file, please? In particular this one needs a big health warning
that using it is almost always the wrong thing (compare the
comment in the .c file).
thanks
-- PMM