From patchwork Tue Jun 4 20:33:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 165844 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp6350197ili; Tue, 4 Jun 2019 13:59:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6vHPOKBY0pkSG6efbPocXaxOl796uKihThkW/6bvk7Av7HjloaJnRfYiqfDj9v3RUMQEz X-Received: by 2002:a0c:e8cf:: with SMTP id m15mr24640505qvo.81.1559681961372; Tue, 04 Jun 2019 13:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559681961; cv=none; d=google.com; s=arc-20160816; b=VWZd3lZwUOJAxzBf3FqbDXZYYpkzlBmgSaDMZPcX6MOZNMlyuXL5ezGYZZ8hPkessZ DH347JWIgZQfqjPUAhnxC6j9PdqgDutuQFVYPDkmX0Xyza3AIgF+zuellcmRasCahsP5 VzFvsbEQt4FiWPQiY4/RxEH5x832WvaSe9sFVaKGiTzwnkVuosUbT3r9qLATJo+yfjXR 6FfzxS82+ZUSPGgCOLy+Hv01l6FwS4JVW3ZWA+tmFSs4nZzkcrGOBRqKxjDaVVKMSStc qHynf0JfCAGlcBB0JUoAjikm1rnk0+v9lGm5xlfP7YcRCiFBHM1tmADh8KtLKUzb2DHS eFMA== 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=ZuP9P/y2awmw4izu8Ta8VFFIgoiKI0vJso4eBOFOhZo=; b=hTp8xr7Ju51C0u+m1J2E1AAGL11YE1lZbJTGkxnxPrZy9tD2pvkhl8hrC2w9TFLqcb eAGEts/NZ4QDJn91fMDiz0Wo4Ld27iRXNqIiwzQdeRV0Xll+Pp8aA9oXLm55+D4L0hjm glyT8ORFrdtj8L6Uui5UT2rtv45yD0HAfj6pGO6or+4e0yaOKXWJ/7zAuGqUZls7Jrz9 hhQn7quGvNelmbltrSAgdiP+43qn7lqh0A79tkGUuxnKBkFM1fVSrvIwD59Z7kicq2mN 4S5B3Gfxu6xO1RA+00vJlTSglE9rA5GFf9zZAFD4HGLKvPeNZLPm+n98M/Abg0P62C5U lzzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="FP/D1Y1i"; 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 h17si3878855qkj.77.2019.06.04.13.59.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 04 Jun 2019 13:59:21 -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="FP/D1Y1i"; 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]:57950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYGWe-0005h8-Ug for patch@linaro.org; Tue, 04 Jun 2019 16:59:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYG8m-0001Rm-6I for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYG8l-0004c8-36 for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:40 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:40414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYG8k-0004bE-UQ for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:39 -0400 Received: by mail-oi1-x242.google.com with SMTP id w196so7111883oie.7 for ; Tue, 04 Jun 2019 13:34:38 -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=ZuP9P/y2awmw4izu8Ta8VFFIgoiKI0vJso4eBOFOhZo=; b=FP/D1Y1iqgpLQtySYV9nBgT4e6P62H7u/gFtlA4N3isoDkmlvj52z2xgYOwPw8/RPX IrZPcjYubpbF1F7myI6q36APDhfqehV+liNy56LewCL9CBk7i7Ku74KwCUljFHN7Ym1D LxvrSgZS8Ura8njbR1Oz5lafu4wfxoXFDynpvu5sgjqYBDhjwWLbxie/Kj3HpfmaVtxY 8RZlYkVNHlFDnAiiVOmAyq+mRIiZH4uq3W+Rznm/HdKxpYe/v/C3Bpb1N+Lq44XyTerY rbxhgEO/uKYicL3ZHrE4ng/e4DkOiYUL02X7ikejrsTlxM4PELe9DVwthZntXz7XSPIX adhA== 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=ZuP9P/y2awmw4izu8Ta8VFFIgoiKI0vJso4eBOFOhZo=; b=Ukc+1UlBJkq0pUt3Svvtvmn7NjCeGjbeL0AnZKzn+21clFXcaMuHgAMs8DKexUJ1JY ggFzqfMEXZ6t4FZlo4OCy+ZI5vweX88qaKNvUvcgEse5CuPyFi2MbbhC668TH2a8KNpl XSnTV0uDV6q49U1DRPO+xv9v2zsWTKHGIvAeen9TIVd7Dt6z+UVycM2XOmwRB669yOpc sNd8Yohijt/p6bvi9I48+F3BQslbMpNG06xL81oP2zXdBFc1D6Inf8pP54CmL/uLzyp3 rtVo7t49ZJEGewSvcaoqGiGp/XLhGbnF16GSZGp+O45Mb8LTkaHBjZvN//bjkgSPVG3b UDdQ== X-Gm-Message-State: APjAAAWusvlmZrXIVC45acVIsEVU8QWgxbz25Q9o/APJxlHpWFzQjRYA 7OWIvNn6tLesaNvSgpabpdr4falzdRXz4A== X-Received: by 2002:aca:c786:: with SMTP id x128mr5295534oif.146.1559680477950; Tue, 04 Jun 2019 13:34:37 -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.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 13:34:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 4 Jun 2019 15:33:39 -0500 Message-Id: <20190604203351.27778-28-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::242 Subject: [Qemu-devel] [PATCH v4 27/39] target/tilegx: 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 tilegx_env_get_cpu with env_archcpu. The combination CPU(tilegx_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/tilegx/cpu.h | 5 ----- linux-user/tilegx/cpu_loop.c | 2 +- target/tilegx/helper.c | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/target/tilegx/cpu.h b/target/tilegx/cpu.h index 135df63523..7f8fe7c513 100644 --- a/target/tilegx/cpu.h +++ b/target/tilegx/cpu.h @@ -138,11 +138,6 @@ typedef struct TileGXCPU { CPUTLGState env; } TileGXCPU; -static inline TileGXCPU *tilegx_env_get_cpu(CPUTLGState *env) -{ - return container_of(env, TileGXCPU, env); -} - #define ENV_OFFSET offsetof(TileGXCPU, env) /* TILE-Gx memory attributes */ diff --git a/linux-user/tilegx/cpu_loop.c b/linux-user/tilegx/cpu_loop.c index 4f39eb9ad3..d4abe29dcd 100644 --- a/linux-user/tilegx/cpu_loop.c +++ b/linux-user/tilegx/cpu_loop.c @@ -206,7 +206,7 @@ static void do_fetch(CPUTLGState *env, int trapnr, bool quad) void cpu_loop(CPUTLGState *env) { - CPUState *cs = CPU(tilegx_env_get_cpu(env)); + CPUState *cs = env_cpu(env); int trapnr; while (1) { diff --git a/target/tilegx/helper.c b/target/tilegx/helper.c index 4964bb9111..a57a679825 100644 --- a/target/tilegx/helper.c +++ b/target/tilegx/helper.c @@ -28,7 +28,7 @@ void helper_exception(CPUTLGState *env, uint32_t excp) { - CPUState *cs = CPU(tilegx_env_get_cpu(env)); + CPUState *cs = env_cpu(env); cs->exception_index = excp; cpu_loop_exit(cs);