Hello, On 09.11.13 00:15, Andreas Tobler wrote: > Hello, > > the attached patch fixes compilation on FreeBSD for > hw/ppc/mac_new/oldworld.c on FreeBSD. > > The affected function is present in machine/param.h on FreeBSD: > > #define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) > > To make it compile on FreeBSD I'd like to propose the below patch which > is in use since a longer time on the ports tree (FreeBSD) and in my > personal git tree. > > Thanks, > > Andreas > > Signed-off-by: Andreas Tobler <address@hidden> >
This time qemu-devel list included. Ping? TIA, Andreas
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 5e79575..cce2dec 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -125,6 +125,10 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR; } +#if defined(__FreeBSD__) +#undef round_page +#endif + static hwaddr round_page(hwaddr addr) { return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK; diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 2f27754..b8c6678 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -59,6 +59,10 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR; } +#if defined(__FreeBSD__) +#undef round_page +#endif + static hwaddr round_page(hwaddr addr) { return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;