From patchwork Mon Jul 2 15:10:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 10501851 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 6355C6028F for ; Mon, 2 Jul 2018 15:23:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54AED28BA3 for ; Mon, 2 Jul 2018 15:23:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47B7328BA8; Mon, 2 Jul 2018 15:23:15 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D1EB928BA3 for ; Mon, 2 Jul 2018 15:23:14 +0000 (UTC) Received: from localhost ([::1]:33510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0fZ-0005J5-Ts for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Jul 2018 11:23:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0Tx-0004FF-FL for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:11:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0Tw-00083T-91 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:11:13 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:38333) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa0Tw-00082k-32 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:11:12 -0400 Received: by mail-pl0-x244.google.com with SMTP id d10-v6so8094179plo.5 for ; Mon, 02 Jul 2018 08:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MjW6dn4TOEFg6KjmG/SOXMb8i7HIhfULuWj/uo0zFYU=; b=VZVKf5UIgmQ9pycl07y5QsWkQDPsibcVrKUglpl6iLEXyYoLej5JPZbZaE5VjX8dEo 0AUuKYjo6I5jaF6lu1VbnOMJkHyMKC1NFNq37d1RRdODozcx8Q/vIChcoNWordY+kLUt rtTroHfat9fIo/DGA2c1/5sTyKN/KM3N//baoi4oAGdJOGAey2lyjziBS86tmwTHcxu6 xHPm2WlZa55bmRFJxq7KRwCvtTtW3Kqyy5RwIHvCAUwJxQEvKhwFy9w4+g53//NROhfS e+QegHk3rGBuGz7QS1HHc6SfUMjpu3KKjuXb5gQrmVfC3YtGWhC/AJgpgoGqI/IZEb8d SR8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MjW6dn4TOEFg6KjmG/SOXMb8i7HIhfULuWj/uo0zFYU=; b=Y7Vge5Wql2u0CT3EezIMobRRYil/hXu8ZkhOc4rCVZPtKL3Ga6swG9HuoiS4FGlUWf kWziNDZQCz7inCqw+HGMJexjNbNtmSxWZYT96l2zoRdhxjfoUVBQ399zmtEdP8oWqbNY thI7A6laJCm4a+Jio1vBTu2fjh6BUeKLIzpfUXB3NDRyYDJ281Bm8rsSXgmAcDpgFRug PSARvQTZSOt2C+KvXUXxpw3AKCrzJSpwB2FS6qaqB+tYXfdA4p/DYosJvP113ALFszFz Y1tz4AdmhiQW6K8lVbK1Zlq42UEMjH+3cwk5vc2reDr7w2QxTx0RWTDy+GkstxuGhddV cRfw== X-Gm-Message-State: APt69E3p+zRgrqjv9g2Ztajh4voSeKtU6t1MqxWxl2+DmGFPZO+CbDLr iRQRwMI9F7K7OMVbCBLSQhI= X-Google-Smtp-Source: ADUXVKKZybYvsrNPRxMtTdSIUhLO2o5nALnUS/vzsLU0z6a+XgU0Fo7/e5HzCFo/0Xp7LjbRjdVsGA== X-Received: by 2002:a17:902:6802:: with SMTP id h2-v6mr25920355plk.113.1530544271267; Mon, 02 Jul 2018 08:11:11 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id n5-v6sm32664439pgd.7.2018.07.02.08.11.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 08:11:10 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Tue, 3 Jul 2018 00:10:11 +0900 Message-Id: <20180702151023.24532-14-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702151023.24532-1-shorne@gmail.com> References: <20180702151023.24532-1-shorne@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PULL v2 13/25] target/openrisc: Merge mmu_helper.c into mmu.c 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: Stafford Horne , Richard Henderson , QEMU Development Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson With tlb_fill in mmu.c, we can simplify things further. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Signed-off-by: Stafford Horne --- target/openrisc/Makefile.objs | 2 +- target/openrisc/mmu.c | 11 ++++++++++ target/openrisc/mmu_helper.c | 40 ----------------------------------- 3 files changed, 12 insertions(+), 41 deletions(-) delete mode 100644 target/openrisc/mmu_helper.c diff --git a/target/openrisc/Makefile.objs b/target/openrisc/Makefile.objs index 8b8a890c59..b5432f4684 100644 --- a/target/openrisc/Makefile.objs +++ b/target/openrisc/Makefile.objs @@ -1,7 +1,7 @@ obj-$(CONFIG_SOFTMMU) += machine.o obj-y += cpu.o exception.o interrupt.o mmu.o translate.o disas.o obj-y += exception_helper.o fpu_helper.o \ - interrupt_helper.o mmu_helper.o sys_helper.o + interrupt_helper.o sys_helper.o obj-y += gdbstub.o DECODETREE = $(SRC_PATH)/scripts/decodetree.py diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c index b2effaa6d7..9b4b5cf04f 100644 --- a/target/openrisc/mmu.c +++ b/target/openrisc/mmu.c @@ -240,4 +240,15 @@ hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) return phys_addr; } } + +void tlb_fill(CPUState *cs, target_ulong addr, int size, + MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) +{ + int ret = openrisc_cpu_handle_mmu_fault(cs, addr, size, + access_type, mmu_idx); + if (ret) { + /* Raise Exception. */ + cpu_loop_exit_restore(cs, retaddr); + } +} #endif diff --git a/target/openrisc/mmu_helper.c b/target/openrisc/mmu_helper.c deleted file mode 100644 index 97e1d17b5a..0000000000 --- a/target/openrisc/mmu_helper.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenRISC MMU helper routines - * - * Copyright (c) 2011-2012 Jia Liu - * Zhizhou Zhang - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ - -#include "qemu/osdep.h" -#include "cpu.h" -#include "exec/exec-all.h" -#include "exec/cpu_ldst.h" - -#ifndef CONFIG_USER_ONLY - -void tlb_fill(CPUState *cs, target_ulong addr, int size, - MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) -{ - int ret; - - ret = openrisc_cpu_handle_mmu_fault(cs, addr, size, access_type, mmu_idx); - - if (ret) { - /* Raise Exception. */ - cpu_loop_exit_restore(cs, retaddr); - } -} -#endif