qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 5/9] hw/ppc: Include missing 'exec/tswap.h' header


From: Richard Henderson
Subject: Re: [PATCH v2 5/9] hw/ppc: Include missing 'exec/tswap.h' header
Date: Wed, 11 Dec 2024 18:00:59 -0600
User-agent: Mozilla Thunderbird

On 12/11/24 17:03, Philippe Mathieu-Daudé wrote:
Some files indirectly get "exec/tswap.h" declarations via
"exec/cpu-all.h". Include it directly to be able to remove
the former from the latter, otherwise we get:

   hw/ppc/virtex_ml507.c:123:19: error: call to undeclared function 'tswap32'; 
ISO C99 and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
     123 |     env->gpr[6] = tswap32(EPAPR_MAGIC);
         |                   ^
   hw/ppc/sam460ex.c:238:23: error: call to undeclared function 'tswap32'; ISO 
C99 and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
     238 |         env->gpr[6] = tswap32(EPAPR_MAGIC);
         |                       ^
   hw/ppc/spapr.c:1617:13: error: call to undeclared function 'tswap64'; ISO 
C99 and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
    1617 |             DIRTY_HPTE(HPTE(spapr->htab, i));
         |             ^
   hw/ppc/spapr.c:1406:55: note: expanded from macro 'DIRTY_HPTE'
    1406 | #define DIRTY_HPTE(_hpte)  ((*(uint64_t *)(_hpte)) |= 
tswap64(HPTE64_V_HPTE_DIRTY))
         |                                                       ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

I suspect that, like Arm, all of these could be big-endian.
AFAIK all ppc reset into BE; the OS has to flip the bit to get into LE mode.
But I am less sure of this than I was for Arm.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]