From patchwork Mon Jul 2 13:57:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 140761 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4040681ljj; Mon, 2 Jul 2018 07:07:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcNIF8zmvSOIkiimTMR6uVzQK37WMBS0NBEo7a4SpkVwVpI13UEMnEDQ7Ftb/LYV5qVryIS X-Received: by 2002:ac8:1c5c:: with SMTP id j28-v6mr6937805qtk.365.1530540421933; Mon, 02 Jul 2018 07:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530540421; cv=none; d=google.com; s=arc-20160816; b=wB4suoYT2tWFsuylBddJUc7d7jIQhffaqCMqoLQG+75cHz+4LrORKq2sz3daePOozE ogVYCo9qAuqOzQqzPXCo0I3gIRKY1jw8dNI+8Nmx9weLso69T8A3xi3xJeSvNrZymYxy 6qSw2QOjNQmpQI+MgXAmrxPPqU20UV/Z+yAFnq2sAe4oJkArQkWhDf/6HqXJUpUCMbnx iQCxYklEE8scEJ+unBBRTNIdcvcfFOC4Bw6c2O2t5oOSG+poOncVg1Lo1WuBkB2MgQMo U5D/1RKi7gY6gRUrbbTZOii9mljgYLippz4zPJ2z2oCtiJ6znwhg8cvuSVUx1q2Y68mi KDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=MjW6dn4TOEFg6KjmG/SOXMb8i7HIhfULuWj/uo0zFYU=; b=oMstBYow73ltlVM5aXGJqN5XKqNUKrzghKMyrf/PR6/cFxX7NQtEqbjVu9varaTd0N DaRcsC5oW4/tSuB1/4xbejJPBWUbRi4WgL7DgJoAyP5b/gCIJOutjgWjGO7hxhwGxR3w vT6DDybi23RGRYsdrpipwHCX6ZS5IGxDgVIFfyQkFKuv0GzVQhq6GsMr+efGtnOKqtds ++8z2/MAy1DxY7llvSCNB7v0a5qepGwWHAPUQln9XQQYl8V9f51XsOaQw28GIwHuA6PQ 6DZ8W4d/bypCP9q0sOzn+jIF7jfNmjkcmbnUMJmD5hcvctnQbLRgVHgpRsvCnKcbLp/o 9SNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=QWSjcuJC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n66-v6si5525768qkf.34.2018.07.02.07.07.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 Jul 2018 07:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=QWSjcuJC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1]:32984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzTp-0000Ln-92 for patch@linaro.org; Mon, 02 Jul 2018 10:07:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzLq-0002VT-V4 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzLp-0008Bw-T7 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:47 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:32902) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzLp-0008BW-NX for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:45 -0400 Received: by mail-pl0-x243.google.com with SMTP id 6-v6so8012448plb.0 for ; Mon, 02 Jul 2018 06:58:45 -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=QWSjcuJCadO5sPkVPPGngElhpbQ1ZvOglxh8U1oA/bZDtvClqFXJhaCUn6Jw6vluaM 5MPDkUPi+3gmtZxI6JTeWoefDSHPxmnkQJp7gwrmECAfJjg+2qL+pH8rUpoXUHiW4LNm z7wsKPBhMuNi/o6L95tqYpNqYyeq8QD5ZO9yuTQV7UkaxLiFO2DawaGp8nboJnn8FU+J Ixeo3gV7Yqmt4ImILh5CWIC8+PfzJbRNavJXq2FSHfbXgkxKeh/GWGSc5E4JD9/OAu3e t+Q3CviGm6OaaIYpkz4dhuw5YvV7atwpXWOgy85lES+dOZDmzg+j1srmC4DUVy+bbWuT vtWg== 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=NLl3NbTCi9xGAb91q/UTCrSy+rbt6uS84LmBQ5I5s4vIyqkKQ43Hee/ITj9wTl8jL9 /ZB47ADt9aNCvdsFEfHCcocoZIpwBdjLRdBK7UM3xKThPZetEPJEfR/F6Qo8XnELLxtn ryajNworyXa5RtzCcI8fpsqmBjQJUN2LtXwuYc/xBHPVjYwRmzoq1AQ9d5ljw1kSYKSs RnV/VpSl9aAbkV4jDEb1jzFDn9/Ziqv+mQb+cg5bSEGbvgoSokAuKJOQMhU71HGNWugi Qth6WieIeZA5zdMrWuKoPxcfwoGXSiYQAM9V0wGOKDMfg/6007e+Kx1Pxkvn5dgG47dp F1sA== X-Gm-Message-State: APt69E21lTSjb3ZkVBhWZh9gzLMgldbSgiISP8qqacaj2le/KdQMKoSH XEKkqrNtx0YR/VmghvuGkUVrVxfJ X-Received: by 2002:a17:902:6e09:: with SMTP id u9-v6mr25395794plk.13.1530539924740; Mon, 02 Jul 2018 06:58:44 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id a8-v6sm32546089pfe.72.2018.07.02.06.58.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 06:58:44 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Mon, 2 Jul 2018 22:57:54 +0900 Message-Id: <20180702135806.7087-14-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702135806.7087-1-shorne@gmail.com> References: <20180702135806.7087-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::243 Subject: [Qemu-devel] [PULL 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 -- 2.17.0 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