From patchwork Wed Jul 31 16:06:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 170153 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4221397ile; Wed, 31 Jul 2019 09:15:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyl+C2JGrIIks9Mp28verdwLkLrw0k9DGtdCUmGg416SWMGkGV/BYf3h61taH2ngbIIktVE X-Received: by 2002:ac8:43c5:: with SMTP id w5mr85689801qtn.280.1564589728776; Wed, 31 Jul 2019 09:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564589728; cv=none; d=google.com; s=arc-20160816; b=m5sCh3tVfRJH+/tt7JqkTc7CBVXXmgGjNQX3fuRIrfLJ2VJA54yA4Gg5wMvTL/LMqD +Mv1mifJ/fGvS/DTGqpM+uNC1zMb7lbk/GldvEvoCI+wRFecxNLY2VnJa5B9VZV19wqv nojPDce6/3pN6FuLiEM1LJH2UtyRmel4M2SFJXLfgwxF+xWQbbrv1SY3e5OgU9Ppe/bz uiGuKXzrNPyoK4IgR1fVFN3Ks3UZHymmkqlc+BNEIxC5VK87k+2mxlK8vAgBKevQEDlX qzgpRzIULidlWSHK6makzfAl1bUxjj543KwIOZ8Wt6sECIYjWMMo/VTHN8tdKSZtPOgo tQ8w== 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; bh=GmxoVYqSi+9b817kRDEMuLT6apMjPTB3tafVvwHS5rQ=; b=rlmjQbcA7M3HZlYvFYmDspNpilStN25Aq8DfFr/TOBnfFnhEoIwnf/A2FV7wiC5c+E iPtv1dDSLz+p2U8VVgeFqpYN1oXjTUiIosJ1I76zjX5j/uO3X/JzPQkjENVJeg6g2E87 +LBcDjAEVL8goqklqBadylJSxxHx7Ge+5+azuE18QzFK+cxWQ1FiQyMWQA1r4EUW7SgJ 4fcuYpe+A/jaPVr/IDB/rPVvroIA+WXv9Z6o0BwRmV2wXeWREJagfHss7iwBDR5JNtAJ dvJfUQL7ZHeztpv/pUXJNEHfWS1f57hAtkYHB+9RiIPe9sqTT9rN+KYDRdDd0lRqjymr GPYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sM5s12xn; 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 d20si37736379qkk.292.2019.07.31.09.15.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2019 09:15:28 -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=sM5s12xn; 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 ([::1]:42408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsrGC-0004eW-C5 for patch@linaro.org; Wed, 31 Jul 2019 12:15:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40375) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsr8h-00027w-GZ for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsr8f-0000lE-5T for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:43 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:33613) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsr8e-0000hn-Cz for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:40 -0400 Received: by mail-wr1-x441.google.com with SMTP id n9so70407051wru.0 for ; Wed, 31 Jul 2019 09:07:33 -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=GmxoVYqSi+9b817kRDEMuLT6apMjPTB3tafVvwHS5rQ=; b=sM5s12xnGTDAcJgriEAPd069+NsIoDM75HbkFazGQOGkmgQqIwCwYuOK6xz7Mx0Bc+ tnduWy/ebK0pTGdAUfXJI7Af8UmnpPh7XWo31loVDo7GHj2e5psthcg0ImmtlQc0bHBM OgprmpnjWiYaXLzgE1c6qNoyEzbQDZy97uRU32bPK4Iz3My1YgT0UZxqUDGvXNW85sZx frZI5pCnO5cfNWUsfWymNM+HpC4RWS9PUvRPpX3VjBLcNfowFNmwHcxElcprI+g92vqE yY5rwUX9R3Ns0ItyvdCoPAH8uQkwzJ9v/LeIIWTG380fCGP2aqU8D7NhuVHHjwWjCk8X rAIA== 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=GmxoVYqSi+9b817kRDEMuLT6apMjPTB3tafVvwHS5rQ=; b=MtN8gTxikcS7PtDQdtx/z5UdyT3SNxBQZNe/WC+0hA9/J/el48w2CgPWesjRZC3aED R6Zdoq4pch4GvFD7C4RwdCKjWRkxv3X8dkeYlN1NiiFKZn89wIKu5ZMpRBbxonufwVyQ Gj3J4GaKgRgesXKqbY/QxLanOUly6cyGSfwPerwGIGf4+6rNC7MkAfe/KdFixvQHiDKH e+B0akv3ilSvGvyGXwMX1A9CBvu2idUZZdaMeMlqJIgEiBJqsPDW8EfaYEcYowWyV8DS eRjQOClNVSHmwva1SCCJ7hm1WuspnDv74A/tAZ7req+yfagcX1FXYQnua1n+iW8GW/+/ pi7A== X-Gm-Message-State: APjAAAXyXoTCD73M56OqzUl97Hf2cJpg+btyGOrtFqtpY7AzbvnQyTAw EvAsLDa0v/GohBUpy+qfYwyaPQ== X-Received: by 2002:adf:f646:: with SMTP id x6mr143350740wrp.18.1564589252615; Wed, 31 Jul 2019 09:07:32 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z1sm72144165wrp.51.2019.07.31.09.07.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 09:07:31 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 419831FFB3; Wed, 31 Jul 2019 17:07:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 31 Jul 2019 17:06:54 +0100 Message-Id: <20190731160719.11396-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731160719.11396-1-alex.bennee@linaro.org> References: <20190731160719.11396-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v4 29/54] plugin-gen: add plugin_insn_append 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: bobby.prani@gmail.com, cota@braap.org, =?utf-8?q?Alex_Benn=C3=A9e?= , aaron@os.amperecomputing.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" By adding it to plugin-gen's header file, we can export is as an inline, since tcg.h is included in the header (we need tcg_ctx). Signed-off-by: Emilio G. Cota [AJB: use g_byte_array] Signed-off-by: Alex Bennée --- v3 - use g_byte_array --- include/exec/plugin-gen.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h index de519883b16..4834a9e2f40 100644 --- a/include/exec/plugin-gen.h +++ b/include/exec/plugin-gen.h @@ -27,6 +27,17 @@ void plugin_gen_insn_end(void); void plugin_gen_disable_mem_helpers(void); void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info); +static inline void plugin_insn_append(const void *from, size_t size) +{ + struct qemu_plugin_insn *insn = tcg_ctx->plugin_insn; + + if (insn == NULL) { + return; + } + + insn->data = g_byte_array_append(insn->data, from, size); +} + #else /* !CONFIG_PLUGIN */ static inline @@ -51,6 +62,9 @@ static inline void plugin_gen_disable_mem_helpers(void) static inline void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info) { } +static inline void plugin_insn_append(const void *from, size_t size) +{ } + #endif /* CONFIG_PLUGIN */ #endif /* QEMU_PLUGIN_GEN_H */