From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, pbonzini@redhat.com, crobinso@redhat.com
Subject: [PATCH v2 10/11] trace: Fold mem-internal.h into mem.h
Date: Fri, 16 Jul 2021 18:41:20 -0700 [thread overview]
Message-ID: <20210717014121.1784956-11-richard.henderson@linaro.org> (raw)
In-Reply-To: <20210717014121.1784956-1-richard.henderson@linaro.org>
Since the last thing that mem.h does is include mem-internal.h,
the symbols are not actually private.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
trace/mem-internal.h | 50 --------------------------------------------
trace/mem.h | 50 ++++++++++++++++++++++++++++++++++----------
2 files changed, 39 insertions(+), 61 deletions(-)
delete mode 100644 trace/mem-internal.h
diff --git a/trace/mem-internal.h b/trace/mem-internal.h
deleted file mode 100644
index 8b72b678fa..0000000000
--- a/trace/mem-internal.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Helper functions for guest memory tracing
- *
- * Copyright (C) 2016 Lluís Vilanova <vilanova@ac.upc.edu>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- */
-
-#ifndef TRACE__MEM_INTERNAL_H
-#define TRACE__MEM_INTERNAL_H
-
-#define TRACE_MEM_SZ_SHIFT_MASK 0xf /* size shift mask */
-#define TRACE_MEM_SE (1ULL << 4) /* sign extended (y/n) */
-#define TRACE_MEM_BE (1ULL << 5) /* big endian (y/n) */
-#define TRACE_MEM_ST (1ULL << 6) /* store (y/n) */
-#define TRACE_MEM_MMU_SHIFT 8 /* mmu idx */
-
-static inline uint16_t trace_mem_build_info(
- int size_shift, bool sign_extend, MemOp endianness,
- bool store, unsigned int mmu_idx)
-{
- uint16_t res;
-
- res = size_shift & TRACE_MEM_SZ_SHIFT_MASK;
- if (sign_extend) {
- res |= TRACE_MEM_SE;
- }
- if (endianness == MO_BE) {
- res |= TRACE_MEM_BE;
- }
- if (store) {
- res |= TRACE_MEM_ST;
- }
-#ifdef CONFIG_SOFTMMU
- res |= mmu_idx << TRACE_MEM_MMU_SHIFT;
-#endif
- return res;
-}
-
-static inline uint16_t trace_mem_get_info(MemOp op,
- unsigned int mmu_idx,
- bool store)
-{
- return trace_mem_build_info(op & MO_SIZE, !!(op & MO_SIGN),
- op & MO_BSWAP, store,
- mmu_idx);
-}
-
-#endif /* TRACE__MEM_INTERNAL_H */
diff --git a/trace/mem.h b/trace/mem.h
index 9644f592b4..2f27e7bdf0 100644
--- a/trace/mem.h
+++ b/trace/mem.h
@@ -12,24 +12,52 @@
#include "tcg/tcg.h"
-
-/**
- * trace_mem_get_info:
- *
- * Return a value for the 'info' argument in guest memory access traces.
- */
-static uint16_t trace_mem_get_info(MemOp op, unsigned int mmu_idx, bool store);
+#define TRACE_MEM_SZ_SHIFT_MASK 0xf /* size shift mask */
+#define TRACE_MEM_SE (1ULL << 4) /* sign extended (y/n) */
+#define TRACE_MEM_BE (1ULL << 5) /* big endian (y/n) */
+#define TRACE_MEM_ST (1ULL << 6) /* store (y/n) */
+#define TRACE_MEM_MMU_SHIFT 8 /* mmu idx */
/**
* trace_mem_build_info:
*
* Return a value for the 'info' argument in guest memory access traces.
*/
-static uint16_t trace_mem_build_info(int size_shift, bool sign_extend,
- MemOp endianness, bool store,
- unsigned int mmuidx);
+static inline uint16_t trace_mem_build_info(int size_shift, bool sign_extend,
+ MemOp endianness, bool store,
+ unsigned int mmu_idx)
+{
+ uint16_t res;
+
+ res = size_shift & TRACE_MEM_SZ_SHIFT_MASK;
+ if (sign_extend) {
+ res |= TRACE_MEM_SE;
+ }
+ if (endianness == MO_BE) {
+ res |= TRACE_MEM_BE;
+ }
+ if (store) {
+ res |= TRACE_MEM_ST;
+ }
+#ifdef CONFIG_SOFTMMU
+ res |= mmu_idx << TRACE_MEM_MMU_SHIFT;
+#endif
+ return res;
+}
-#include "trace/mem-internal.h"
+/**
+ * trace_mem_get_info:
+ *
+ * Return a value for the 'info' argument in guest memory access traces.
+ */
+static inline uint16_t trace_mem_get_info(MemOp op,
+ unsigned int mmu_idx,
+ bool store)
+{
+ return trace_mem_build_info(op & MO_SIZE, !!(op & MO_SIGN),
+ op & MO_BSWAP, store,
+ mmu_idx);
+}
#endif /* TRACE__MEM_H */
--
2.25.1
next prev parent reply other threads:[~2021-07-17 1:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-17 1:41 [PATCH v2 00/11] Atomic cleanup + clang-12 build fix Richard Henderson
2021-07-17 1:41 ` [PATCH v2 01/11] qemu/atomic: Use macros for CONFIG_ATOMIC64 Richard Henderson
2021-07-17 10:04 ` Philippe Mathieu-Daudé
2021-07-17 1:41 ` [PATCH v2 02/11] qemu/atomic: Simplify typeof_strip_qual Richard Henderson
2021-07-17 1:41 ` [PATCH v2 03/11] qemu/atomic: Remove pre-C11 atomic fallbacks Richard Henderson
2021-07-17 1:41 ` [PATCH v2 04/11] qemu/atomic: Add aligned_{int64,uint64}_t types Richard Henderson
2021-07-17 10:07 ` Philippe Mathieu-Daudé
2021-07-17 1:41 ` [PATCH v2 05/11] tcg: Rename helper_atomic_*_mmu and provide for user-only Richard Henderson
2021-07-17 1:41 ` [PATCH v2 06/11] accel/tcg: Standardize atomic helpers on softmmu api Richard Henderson
2021-07-17 1:41 ` [PATCH v2 07/11] accel/tcg: Fold EXTRA_ARGS into atomic_template.h Richard Henderson
2021-07-17 10:10 ` Philippe Mathieu-Daudé
2021-07-17 1:41 ` [PATCH v2 08/11] accel/tcg: Remove ATOMIC_MMU_DECLS Richard Henderson
2021-07-17 10:10 ` Philippe Mathieu-Daudé
2021-07-17 1:41 ` [PATCH v2 09/11] accel/tcg: Expand ATOMIC_MMU_LOOKUP_* Richard Henderson
2021-07-17 1:41 ` Richard Henderson [this message]
2021-07-17 10:14 ` [PATCH v2 10/11] trace: Fold mem-internal.h into mem.h Philippe Mathieu-Daudé
2021-07-17 1:41 ` [PATCH v2 11/11] accel/tcg: Push trace info building into atomic_common.c.inc Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210717014121.1784956-11-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=crobinso@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).