From nobody Thu Dec 18 13:24:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1633533814; cv=none; d=zohomail.com; s=zohoarc; b=CK0ZcfQML0F6GCjJKWN3A9d8+zY/lUvWVdR62bEL1xUmBqEJIsZm469/cPE2vJO09YL9qE1m5SGXKZmDUCnOO7vX4MHvHmKRnuff81Fj2w+efL9hISBBm/nyBAYC2oFYY/Cn6N2P2sphiUoXETAMccnEmWXWv5EYhqolnHPGY+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633533814; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FpNwQ0HRi56DgwyroVMnJICST8kXE9rLr7CLkanbYEk=; b=jQuaSVAdGq+7i49cbC7vFy7DnxIH3w4TQhe3/0SW6VLj/GNXjaizAN49QRiIucfx0bsQRTBVgAuQILYbUd7VqvgOBmnWMtd+S7s+0gB2808Y+9FUIAsG7STGsiTpGcBF9i+S2esvSmIbDX3z/b6uSl7VAN2cWja1zF3OduVveBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633533814162558.2022571213408; Wed, 6 Oct 2021 08:23:34 -0700 (PDT) Received: from localhost ([::1]:59170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY8lZ-0006d7-0p for importer@patchew.org; Wed, 06 Oct 2021 11:23:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY8ie-0002KF-AV for qemu-devel@nongnu.org; Wed, 06 Oct 2021 11:20:32 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:45852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mY8iU-0007h3-Db for qemu-devel@nongnu.org; Wed, 06 Oct 2021 11:20:28 -0400 Received: by mail-pj1-x1030.google.com with SMTP id ls14-20020a17090b350e00b001a00e2251c8so2559861pjb.4 for ; Wed, 06 Oct 2021 08:20:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id 130sm22239256pfz.77.2021.10.06.08.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 08:20:20 -0700 (PDT) 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=FpNwQ0HRi56DgwyroVMnJICST8kXE9rLr7CLkanbYEk=; b=jMQ/hU+fDRh2uBRKhvv+fwPyszev5K2YYHwmFmZ6TJ7Od7BnCRaoyykJ3n5IOVZVYs ZD9e7oH5H4EPGNfgLBUCfpc5g6W6v/JvADDkI/lWzK6asPHnl+3tm5AP1QvfxcEpCYTI LQ76LbGhUXL59M7bbNgsbVuafYQ/nwCdE5BBPL0Tl07bd9WZce9wQZ5o/CuKt3Fp9Z+u tCxLJ2gF8iH0u2Oy9nefX79ZyDZZasAkdoK1vHbDRATNS50IMRSlGx/Wu4kIx1Nx72C7 WUwUIXOv4UoMdxHurde/Rm8dczfoKGS9pBcP3bdc8leToWqQR+RFdtaMsTo+MRpGm96Y EYiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FpNwQ0HRi56DgwyroVMnJICST8kXE9rLr7CLkanbYEk=; b=jztxGJVssxZOlR/aKpaH42mWm2ABksCKJd57yuct59wc9Ck31HzCVuLPZr16qGEd80 ncq7J6gAN8WYKWXSJC8erXmOLGzjFyASybk8w7bpNydl8p+afZGKeAC9J4ynj9l1VhFO j3DQpZj+Jr5vI73oPojk+V1B+ZZjUw7A+Bk+zsRmZTn6+FuG90E411/PiP/Og4f85LK8 LPVTpWmTxauO1tU2dcaXPJoyeznTG372GoTPO0Wkyvy0gnL0Px3Lr91+HFgrdXjZNWwk q07cXk8t1/TBOFpqM18FkGQDhBb5Oshzd8gtKQODnxuoe+J8oD2BRofbw0Fl1/Ni4BuD Artg== X-Gm-Message-State: AOAM5331cy5Afce63yBaOBA8vDYpAhyNpZzr9dZ3P5r+Kvz6BijVgS4B PWOTFFWohmKrmyF3lNDsd25S8mEM1Df8hw== X-Google-Smtp-Source: ABdhPJyQFoZv+mKhfBBlB6wjOaX2aoZO6iKAw0Q67olZv1a7Fq2Olg98CFQqGMx8yT/RT3C6Yux/Tg== X-Received: by 2002:a17:902:9b88:b0:13e:55b1:2939 with SMTP id y8-20020a1709029b8800b0013e55b12939mr11424229plp.80.1633533620669; Wed, 06 Oct 2021 08:20:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/28] tcg: Split out MemOpIdx to exec/memopidx.h Date: Wed, 6 Oct 2021 08:19:53 -0700 Message-Id: <20211006152014.741026-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211006152014.741026-1-richard.henderson@linaro.org> References: <20211006152014.741026-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1633533814814100001 Move this code from tcg/tcg.h to its own header. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- include/exec/memopidx.h | 55 +++++++++++++++++++++++++++++++++++++++++ include/tcg/tcg.h | 39 +---------------------------- 2 files changed, 56 insertions(+), 38 deletions(-) create mode 100644 include/exec/memopidx.h diff --git a/include/exec/memopidx.h b/include/exec/memopidx.h new file mode 100644 index 0000000000..83bce97874 --- /dev/null +++ b/include/exec/memopidx.h @@ -0,0 +1,55 @@ +/* + * Combine the MemOp and mmu_idx parameters into a single value. + * + * Authors: + * Richard Henderson + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#ifndef EXEC_MEMOPIDX_H +#define EXEC_MEMOPIDX_H 1 + +#include "exec/memop.h" + +typedef uint32_t MemOpIdx; + +/** + * make_memop_idx + * @op: memory operation + * @idx: mmu index + * + * Encode these values into a single parameter. + */ +static inline MemOpIdx make_memop_idx(MemOp op, unsigned idx) +{ +#ifdef CONFIG_DEBUG_TCG + assert(idx <=3D 15); +#endif + return (op << 4) | idx; +} + +/** + * get_memop + * @oi: combined op/idx parameter + * + * Extract the memory operation from the combined value. + */ +static inline MemOp get_memop(MemOpIdx oi) +{ + return oi >> 4; +} + +/** + * get_mmuidx + * @oi: combined op/idx parameter + * + * Extract the mmu index from the combined value. + */ +static inline unsigned get_mmuidx(MemOpIdx oi) +{ + return oi & 15; +} + +#endif diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 1a0da58f92..ba13ab1151 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -27,6 +27,7 @@ =20 #include "cpu.h" #include "exec/memop.h" +#include "exec/memopidx.h" #include "qemu/bitops.h" #include "qemu/plugin.h" #include "qemu/queue.h" @@ -1147,44 +1148,6 @@ static inline size_t tcg_current_code_size(TCGContex= t *s) return tcg_ptr_byte_diff(s->code_ptr, s->code_buf); } =20 -/* Combine the MemOp and mmu_idx parameters into a single value. */ -typedef uint32_t MemOpIdx; - -/** - * make_memop_idx - * @op: memory operation - * @idx: mmu index - * - * Encode these values into a single parameter. - */ -static inline MemOpIdx make_memop_idx(MemOp op, unsigned idx) -{ - tcg_debug_assert(idx <=3D 15); - return (op << 4) | idx; -} - -/** - * get_memop - * @oi: combined op/idx parameter - * - * Extract the memory operation from the combined value. - */ -static inline MemOp get_memop(MemOpIdx oi) -{ - return oi >> 4; -} - -/** - * get_mmuidx - * @oi: combined op/idx parameter - * - * Extract the mmu index from the combined value. - */ -static inline unsigned get_mmuidx(MemOpIdx oi) -{ - return oi & 15; -} - /** * tcg_qemu_tb_exec: * @env: pointer to CPUArchState for the CPU --=20 2.25.1