fix compilation on FreeBSD for mac_*world.c
Hello,
Quoted 13 lines · Andreas Tobler
Hello,
the attached patch fixes compilation on FreeBSD for
hw/ppc/mac_new/oldworld.con FreeBSD.The affected function is present in
machine/param.hon 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.
Quoted 6 lines
Thanks,
Andreas
Signed-off-by Andreas Tobler <address@hidden>
This time qemu-devel list included.
Ping?
TIA,
Andreas
hw/ppc/mac_newworld.c +4 -0
@@ -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 ;
hw/ppc/mac_oldworld.c +4 -0
@@ -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 ;
Quoted 15 lines · Andreas Tobler
Hello,
Quoted 12 lines · Andreas Tobler
Hello,
the attached patch fixes compilation on FreeBSD for
hw/ppc/mac_new/oldworld.con FreeBSD.The affected function is present in
machine/param.hon 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.
Rather than doing this:
+ #if defined(__FreeBSD__)
+ #undef round_page
+ #endif
personally I'd prefer it if we just replaced the uses of round_page() with TARGET_PAGE_ALIGN(), which is the macro we define in the headers for aligning up to the next page size.
Up to the ppc submaintainers though...
thanks
-- PMM
Quoted 22 lines · Peter Maydell
Quoted 15 lines · Andreas Tobler
Hello,
Quoted 12 lines · Andreas Tobler
Hello,
the attached patch fixes compilation on FreeBSD for
hw/ppc/mac_new/oldworld.con FreeBSD.The affected function is present in
machine/param.hon 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.
Rather than doing this:
+ #ifdefined(__FreeBSD__)
+ #undefround_page
+ #endif
Quoted 5 lines
personally I'd prefer it if we just replaced the uses of
round_page()withTARGET_PAGE_ALIGN(), which is the macro we define in the headers for aligning up to the next page size.Up to the ppc submaintainers though...
Whatever you prefer, I'm ready to test....
Thanks for the feedback.
Andreas
Am 28.11.2013 22:33, schrieb Andreas Tobler:
Quoted 18 lines
Hello,
Quoted 15 lines · Andreas Tobler
Hello,
the attached patch fixes compilation on FreeBSD for
hw/ppc/mac_new/oldworld.con FreeBSD.The affected function is present in
machine/param.hon 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,
Quoted 8 lines
Quoted 4 lines
Andreas
Signed-off-by Andreas Tobler <address@hidden>This time qemu-devel list included.
Ping?
I remember writing a patch to fix this or a very similar issue in those files by adding a prefix for the local version. Have you checked the list archives or git log?
Apart from that, the Sob is broken and we prefer patches git-send-email style with a ready-to-apply commit message:
http://wiki.qemu.org/Contribute/SubmitAPatch
Regards,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg