From patchwork Mon Sep 11 20:16:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Rytarowski X-Patchwork-Id: 9948109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0714A6024A for ; Mon, 11 Sep 2017 20:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF08128D4E for ; Mon, 11 Sep 2017 20:29:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E39D828D50; Mon, 11 Sep 2017 20:29:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4B88928D4E for ; Mon, 11 Sep 2017 20:29:29 +0000 (UTC) Received: from localhost ([::1]:60408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drVKi-0007HC-Ub for patchwork-qemu-devel@patchwork.kernel.org; Mon, 11 Sep 2017 16:29:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drVK2-0007Fm-6U for qemu-devel@nongnu.org; Mon, 11 Sep 2017 16:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drVK1-0002IK-AE for qemu-devel@nongnu.org; Mon, 11 Sep 2017 16:28:46 -0400 Received: from mout.gmx.net ([212.227.17.22]:63793) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drVJw-0002DM-Jc; Mon, 11 Sep 2017 16:28:40 -0400 Received: from localhost.localdomain ([185.58.161.191]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MZ8fw-1eA9AQ05HQ-00KuEm; Mon, 11 Sep 2017 22:28:38 +0200 From: Kamil Rytarowski To: qemu-trivial@nongnu.org Date: Mon, 11 Sep 2017 22:16:10 +0200 Message-Id: <20170911201610.15204-1-n54@gmx.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170911200002.4511-1-n54@gmx.com> References: <20170911200002.4511-1-n54@gmx.com> X-Provags-ID: V03:K0:a6Qg0LDi187GCVUA6u73ZCFV0C5cO5fiXXz/vj8+Ior6N/K4LHl Kq7D/U/XD+UH5I0Z2xSRc7RVGkuyvpfxy7pF5FEN7SCAkrLYrSg/mxZV/+G7Qc81eNDJsFV 7LHmjWg5mZBAcB3k6nOWBZfb/jKiGsU9h7XQdmC4PnUy5TV/F28DA5jaKDlcG+tzgPoUxZw Bc3YROo7SlzbjsOyUMhJw== X-UI-Out-Filterresults: notjunk:1; V01:K0:tVX5TN5zyCk=:3JELP5n7CVgeSY7FZRXzxN Fk26EpJiXFjVnIzv0+43Kn43yr0WdgAH4PbOXQFq+oo7YypQahUy8DIVMNLC9i7Th0hstTkoG pZrF/BRI7Sy+0w/D9LBvhhI4g9O03D2X+rhHPwUmTretD0vFoUYU2rvnrv5ML6u3eF8qaanlW UE1/jDzNDbm+RyN8Bcn0pFudBW4Vg6FKiq8JggD5VBn/cD7gy89HUCiVa0qEKVvKKmPwHCDLF IHu2Pva7Rs0SS1029545HboMo7uj9d502i+49kduEWQauQb/Tabv/2fnCPW8gdastvaQ7z7LR yWDeciFTVcScRdBbj9yIzNgSfrQkIFzh0tro7LjbeGroFjU0E7BJixymeVqkEeVafwtYgbpRf x4gN9UDY2AdKfGw97wG+Cy/DuM/Mn6IJtry741wZFAiewytSgoZ0KmYZopSQi+YOvZnRV674I TYGMO4vyxXI67ECVeLfQZsEb2cKkFuwvcKqCGUexpMl0jy5G8qOhg1VM5zgFl4clwmL70SZK9 CUPBPIugSObkLuvrMhuEv7/G6mF73K6iMOXdS+olE1FyErhtGZMI0aeln47kYXFmxhT3KW+8o lV1yycx58Aq7vypZaZq3B5YR9Ant90gGoe7hniCdEmGOr41bpQtRDx9AHfZXkngA/AOJZAi7O /tXWSFAakiJwOwPMbELQwNG465POduiz8uXhj5TuVwdqo/ipEfX7y/b2jGYetR1froIJQOvRW QoBRAgLYmTngL4EZEvSr5JSXuH4T1qVnE8j/H0v325A/wdhTJV7JlrAbrm8BkRaLl0ao1RkCT FPlB/MPEdg6vUiNE25KsK4qFQZiqA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.22 Subject: [Qemu-devel] [PATCH v2] Replace round_page() with TARGET_PAGE_ALIGN() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Kamil Rytarowski , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This change fixes conflict with the DragonFly BSD headers. Signed-off-by: Kamil Rytarowski Reviewed-by: Thomas Huth --- hw/ppc/mac_newworld.c | 11 +++-------- hw/ppc/mac_oldworld.c | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index d466634997..51bf83019b 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -124,11 +124,6 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR; } -static hwaddr round_page(hwaddr addr) -{ - return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK; -} - static void ppc_core99_reset(void *opaque) { PowerPCCPU *cpu = opaque; @@ -256,7 +251,7 @@ static void ppc_core99_init(MachineState *machine) } /* load initrd */ if (initrd_filename) { - initrd_base = round_page(kernel_base + kernel_size + KERNEL_GAP); + initrd_base = TARGET_PAGE_ALIGN(kernel_base + kernel_size + KERNEL_GAP); initrd_size = load_image_targphys(initrd_filename, initrd_base, ram_size - initrd_base); if (initrd_size < 0) { @@ -264,11 +259,11 @@ static void ppc_core99_init(MachineState *machine) initrd_filename); exit(1); } - cmdline_base = round_page(initrd_base + initrd_size); + cmdline_base = TARGET_PAGE_ALIGN(initrd_base + initrd_size); } else { initrd_base = 0; initrd_size = 0; - cmdline_base = round_page(kernel_base + kernel_size + KERNEL_GAP); + cmdline_base = TARGET_PAGE_ALIGN(kernel_base + kernel_size + KERNEL_GAP); } ppc_boot_device = 'm'; } else { diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index fcac399562..feb31911ca 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -66,11 +66,6 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR; } -static hwaddr round_page(hwaddr addr) -{ - return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK; -} - static void ppc_heathrow_reset(void *opaque) { PowerPCCPU *cpu = opaque; @@ -191,7 +186,7 @@ static void ppc_heathrow_init(MachineState *machine) } /* load initrd */ if (initrd_filename) { - initrd_base = round_page(kernel_base + kernel_size + KERNEL_GAP); + initrd_base = TARGET_PAGE_ALIGN(kernel_base + kernel_size + KERNEL_GAP); initrd_size = load_image_targphys(initrd_filename, initrd_base, ram_size - initrd_base); if (initrd_size < 0) { @@ -199,11 +194,11 @@ static void ppc_heathrow_init(MachineState *machine) initrd_filename); exit(1); } - cmdline_base = round_page(initrd_base + initrd_size); + cmdline_base = TARGET_PAGE_ALIGN(initrd_base + initrd_size); } else { initrd_base = 0; initrd_size = 0; - cmdline_base = round_page(kernel_base + kernel_size + KERNEL_GAP); + cmdline_base = TARGET_PAGE_ALIGN(kernel_base + kernel_size + KERNEL_GAP); } ppc_boot_device = 'm'; } else {