From nobody Mon Feb 9 20:31:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486988328736201.83538798704217; Mon, 13 Feb 2017 04:18:48 -0800 (PST) Received: from localhost ([::1]:56204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdFag-0004fa-Ts for importer@patchew.org; Mon, 13 Feb 2017 07:18:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdFSI-0005BI-Ja for qemu-devel@nongnu.org; Mon, 13 Feb 2017 07:10:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdFSH-0002W7-6U for qemu-devel@nongnu.org; Mon, 13 Feb 2017 07:10:06 -0500 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:36742) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdFSG-0002Vy-Tb for qemu-devel@nongnu.org; Mon, 13 Feb 2017 07:10:05 -0500 Received: by mail-wr0-x235.google.com with SMTP id k90so148674421wrc.3 for ; Mon, 13 Feb 2017 04:10:04 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b10sm5091742wmi.34.2017.02.13.04.09.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 04:10:01 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 69FA43E0AD5; Mon, 13 Feb 2017 12:10:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ZSiigSb9cm4SliVXsPrJvsBJvx/GvFAAcflaedYGjg=; b=W51i1+PlWY8qNSsk/8H7HoKFbqnomcb60z3CXf/Tj+ZQnL0SrhnNABO5n+0YnA/kiU CoDWYw6OuTIEkoXI7aapLk5SMIHc5D7Osel2/x54rkGTp/uUCn2Ye+U3VIXQSwDSokgE I+TTMbbfL16koWwkuL2SvWgE9pL8Ccnz9JbGM= 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=5ZSiigSb9cm4SliVXsPrJvsBJvx/GvFAAcflaedYGjg=; b=a+OWIM4Wtr0ElKxRBEiWCqsXIBRgvgHvPK2EVtfKIimyLcqllIqFZhRCSDBURGRMV+ VtSS+rSSBKzitULdV+wv6QKwRSSspDZII4B/6r6W4XZHC5Yo1fzfDZ63+JUsabRtYAWQ Pcld1d7SUFblt7wG3BbokKJV5LALitPytcPbsOUflsBk1bwvp6Gw+vtuzV4nkqhvAEfX zS8PZWNV9hVmyi97cZ0CHjvkRllZDZfTq4WUv8MM20dqYjdL6zTs9VRgwn91nRBtMMaV fCg3FKnae6q7lqW5n1o9p4UxAnbPZtVpBmfg29mFrQQnn0UvvVblFKYUF1PbJTNRqheq eOhw== X-Gm-Message-State: AMke39mNzAf6NGHcYE/KI2STZOkg5U6qKE1k0I/AntMm1mAr4VBB35Ji+wG/Sw5AkIX4oUBD X-Received: by 10.223.164.66 with SMTP id e2mr18652648wra.47.1486987803807; Mon, 13 Feb 2017 04:10:03 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net Date: Mon, 13 Feb 2017 12:09:57 +0000 Message-Id: <20170213121017.12907-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170213121017.12907-1-alex.bennee@linaro.org> References: <20170213121017.12907-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c0c::235 Subject: [Qemu-devel] [PATCH v12 04/24] tcg: move TCG_MO/BAR types into own file 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: mttcg@listserver.greensocs.com, nikunj@linux.vnet.ibm.com, jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, cota@braap.org, serge.fdrv@gmail.com, pbonzini@redhat.com, bobby.prani@gmail.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , bamvor.zhangjian@linaro.org, fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 We'll be using the memory ordering definitions to define values for both the host and guest. To avoid fighting with circular header dependencies just move these types into their own minimal header. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- v8 - add clarifying comment about the form TCG_MO_A_B --- tcg/tcg-mo.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ tcg/tcg.h | 18 +----------------- 2 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 tcg/tcg-mo.h diff --git a/tcg/tcg-mo.h b/tcg/tcg-mo.h new file mode 100644 index 0000000000..c2c55704e1 --- /dev/null +++ b/tcg/tcg-mo.h @@ -0,0 +1,48 @@ +/* + * Tiny Code Generator for QEMU + * + * Copyright (c) 2008 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#ifndef TCG_MO_H +#define TCG_MO_H + +typedef enum { + /* Used to indicate the type of accesses on which ordering + is to be ensured. Modeled after SPARC barriers. + + This is of the form TCG_MO_A_B where A is before B in program order. + */ + TCG_MO_LD_LD =3D 0x01, + TCG_MO_ST_LD =3D 0x02, + TCG_MO_LD_ST =3D 0x04, + TCG_MO_ST_ST =3D 0x08, + TCG_MO_ALL =3D 0x0F, /* OR of the above */ + + /* Used to indicate the kind of ordering which is to be ensured by the + instruction. These types are derived from x86/aarch64 instructions. + It should be noted that these are different from C11 semantics. */ + TCG_BAR_LDAQ =3D 0x10, /* Following ops will not come forward */ + TCG_BAR_STRL =3D 0x20, /* Previous ops will not be delayed */ + TCG_BAR_SC =3D 0x30, /* No ops cross barrier; OR of the above */ +} TCGBar; + +#endif /* TCG_MO_H */ diff --git a/tcg/tcg.h b/tcg/tcg.h index 631c6f69b1..f946452049 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -29,6 +29,7 @@ #include "cpu.h" #include "exec/tb-context.h" #include "qemu/bitops.h" +#include "tcg-mo.h" #include "tcg-target.h" =20 /* XXX: make safe guess about sizes */ @@ -498,23 +499,6 @@ static inline intptr_t QEMU_ARTIFICIAL GET_TCGV_PTR(TC= Gv_ptr t) #define TCG_CALL_DUMMY_TCGV MAKE_TCGV_I32(-1) #define TCG_CALL_DUMMY_ARG ((TCGArg)(-1)) =20 -typedef enum { - /* Used to indicate the type of accesses on which ordering - is to be ensured. Modeled after SPARC barriers. */ - TCG_MO_LD_LD =3D 0x01, - TCG_MO_ST_LD =3D 0x02, - TCG_MO_LD_ST =3D 0x04, - TCG_MO_ST_ST =3D 0x08, - TCG_MO_ALL =3D 0x0F, /* OR of the above */ - - /* Used to indicate the kind of ordering which is to be ensured by the - instruction. These types are derived from x86/aarch64 instructions. - It should be noted that these are different from C11 semantics. */ - TCG_BAR_LDAQ =3D 0x10, /* Following ops will not come forward */ - TCG_BAR_STRL =3D 0x20, /* Previous ops will not be delayed */ - TCG_BAR_SC =3D 0x30, /* No ops cross barrier; OR of the above */ -} TCGBar; - /* Conditions. Note that these are laid out for easy manipulation by the functions below: bit 0 is used for inverting; --=20 2.11.0