From patchwork Tue Jun 4 20:33:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 165845 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp6350487ili; Tue, 4 Jun 2019 13:59:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqykPmszy+OplcS7/MMosVdOUs5mvoZsUJPkbY2ARP92kVN52AZwh+q8fH0qY4wV43K47SOU X-Received: by 2002:ad4:544b:: with SMTP id h11mr16586199qvt.31.1559681982718; Tue, 04 Jun 2019 13:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559681982; cv=none; d=google.com; s=arc-20160816; b=yK+wE9jtWfVhC12Dt6pbU6L+nY2uIOo07P6w2Z3EGVa2utAV2VXGkhBEzpE+qGU0dT IETWAVrsIeY47BiQJSOJjieoIyU+q9a7E7YmeJx+aoBnqq7yhdOeZu5ur86KNoWWCBre a2X/l03hwk/0DreGwH62WmkEEUu5pLXmgFBMgTsbPCjyCgaGTG+spqjlkdGKQFFu2b5w 6lTPJeavi9I8WqbeMZ/K3MuENcfJxy73MJD/5TwY7JqcdMnq8okPQRo8/lp7xWeqFft6 qwqwUWQrqqvU3U6D25KH5M0w1W7s47Rc9u6JRhwOL7+HXbIXN/eVT0ij0l0mTvV07MCJ 3R9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=YQXS0805f11aCOQVinsy2uv+bSnryD5T76PFwhCiklU=; b=pm239r/TP0S9anSiQVk3RlOPrjRg5/sqWw/w1lzfoemuW2ndoWi1b8aHODAZULgqZp 0853Du266ayNESPXpxgI/VK7f7ORjFIum/B/47FWumJTvqBbNql8k/xXmjWslPYqCAI2 GyyO2ixOYNm+CaDYmpJtfwhZtU/Mua+xZt6ywT+slxc+1zjI7NhqEQYgktvio12y4tUY qC4lnM0fKCLsea1+6Ejkf+MjePxiRQu8qbpg44r9qyE7c8InvCMDcDZNofinDUncdYWT dPP7wxmobM3xDy+avYjf7dhVFzJy6Y8y87+BhY7Xd/NKlmlcnU+IMZD7vJae1kGlu+zU 1hEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JArYRBxP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g18si105049qvm.117.2019.06.04.13.59.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 04 Jun 2019 13:59:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JArYRBxP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:57952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYGX0-0005lL-AN for patch@linaro.org; Tue, 04 Jun 2019 16:59:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYG8n-0001T7-Ed for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYG8m-0004eE-IT for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:41 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:34608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYG8m-0004dZ-DT for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:40 -0400 Received: by mail-oi1-x241.google.com with SMTP id u64so16636042oib.1 for ; Tue, 04 Jun 2019 13:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=YQXS0805f11aCOQVinsy2uv+bSnryD5T76PFwhCiklU=; b=JArYRBxPghL/cDE81vV0ce+oU6C7ziwidFxFgG/YURtzBE3XRmsUOh7qO3GcAFHt9D pVNoJgzrlyHR+PrEfMkLZSf3XrZhIH4EAAbsCmaZcAqKXgrhhYUInYMuit8MfxaXFEh4 UPd+Nckq07zMAK4ic8lkNiSGvPJUpS3Vx+vqO8MIM+GMKiKHhVeeClJdgpMTs8ta0wbs gzChzFOmLCtwqiA78Os9zKuh5QWaz3wsWjIC+BWVB09DuJktboHpbG9HDEUMyeTYUFuX nja/ADes7qPZjBP0o6HF7Mm1KuVTjA5CiKJ9XS70FI6Dcy++9+Q14PgtvOpD7ojuWhK/ HF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=YQXS0805f11aCOQVinsy2uv+bSnryD5T76PFwhCiklU=; b=mFLoKnMW6qn4J4sZTI1bmHxrDB3Ce1TsZ5W84D+3HD8e6UySTfTqJajIqLlGeJ1y/V SAJivEXRm4l9ls2BvxD6cyXrzugu7ut9lQP1n6KeHuLM1JTPKkExs72k3fQBp677Xmli TYelKui9ykfJZzO+ciidyLlojbLunoI2dZX4eDJ0tBsGKUzEabMLKpY8If1JGHLTVJR5 PFYF3e5pdgjAvHQTo4XrA+KUaphHEnbTHCVcrW+R+JiEeGVA0sKs61oX6xgtrSamPu1m O7CTbSCe0CfwwE5wl6FGyIrBCdCc8ULfSThuhaisc9Z8yFNSvFML4moI7Sizz1m6J9qs ec3A== X-Gm-Message-State: APjAAAWVmXt+Cd6FhPrgeAgMGXP3trAeH1IURL47bPOGHrLPqD/oIup1 qLzfzY/iKqKlmP6EwtFcdooNAtjBoSrcsg== X-Received: by 2002:aca:ac4d:: with SMTP id v74mr3417597oie.66.1559680479344; Tue, 04 Jun 2019 13:34:39 -0700 (PDT) Received: from localhost.localdomain (200-56-192-86-cable.cybercable.net.mx. [200.56.192.86]) by smtp.gmail.com with ESMTPSA id h1sm5979901otj.78.2019.06.04.13.34.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 13:34:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 4 Jun 2019 15:33:40 -0500 Message-Id: <20190604203351.27778-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604203351.27778-1-richard.henderson@linaro.org> References: <20190604203351.27778-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::241 Subject: [Qemu-devel] [PATCH v4 28/39] target/tricore: Use env_cpu 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cleanup in the boilerplate that each target must define. Replace tricore_env_get_cpu with env_archcpu. The combination CPU(tricore_env_get_cpu) should have used ENV_GET_CPU to begin; use env_cpu now. Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/tricore/cpu.h | 5 ----- target/tricore/op_helper.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) -- 2.17.1 diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 4a2a955cc5..6a40d37362 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -208,11 +208,6 @@ struct TriCoreCPU { CPUTriCoreState env; }; -static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env) -{ - return TRICORE_CPU(container_of(env, TriCoreCPU, env)); -} - #define ENV_OFFSET offsetof(TriCoreCPU, env) hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 601e92f92a..9476d10d00 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -29,7 +29,7 @@ static void QEMU_NORETURN raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin, uintptr_t pc, uint32_t fcd_pc) { - CPUState *cs = CPU(tricore_env_get_cpu(env)); + CPUState *cs = env_cpu(env); /* in case we come from a helper-call we need to restore the PC */ cpu_restore_state(cs, pc, true);