From patchwork Thu Nov 28 21:33:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Tobler X-Patchwork-Id: 295019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65AA02C0089 for ; Fri, 29 Nov 2013 08:34:19 +1100 (EST) Received: from localhost ([::1]:44201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm9Dz-0001rI-T2 for incoming@patchwork.ozlabs.org; Thu, 28 Nov 2013 16:34:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm9DU-0001SZ-HQ for qemu-devel@nongnu.org; Thu, 28 Nov 2013 16:33:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vm9DN-0006eX-5s for qemu-devel@nongnu.org; Thu, 28 Nov 2013 16:33:44 -0500 Received: from mail.fgznet.ch ([81.92.96.47]:50727 helo=smtp.fgznet.ch) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm9DM-0006YB-T2; Thu, 28 Nov 2013 16:33:37 -0500 Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rASLXOn7049466; Thu, 28 Nov 2013 22:33:33 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <5297B6A4.1020300@FreeBSD.org> Date: Thu, 28 Nov 2013 22:33:24 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org References: <527D70A5.7010905@FreeBSD.org> In-Reply-To: <527D70A5.7010905@FreeBSD.org> X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 X-detected-operating-system: by eggs.gnu.org: Mac OS X 10.x X-Received-From: 81.92.96.47 Subject: Re: [Qemu-devel] [PATCH] fix compilation on FreeBSD for mac_*world.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 > 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;