aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-06-28 16:09:38 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-06-28 16:09:38 -0700
commit3665dd6bb9043bef181c91e2dce9e1efff47ed51 (patch)
tree766c8fda9206131cf2a500a281598aed34fd70e9 /include
parent28b8a57ad63670aa0ce90334523dc552b13b4336 (diff)
parentb31d386781cf85c193f3b1355dd0604cd6a59943 (diff)
downloadqemu-master.zip
qemu-master.tar.gz
qemu-master.tar.bz2
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into stagingHEADstagingmaster
* configure: detect --cpu=mipsisa64r6 * target/i386: decode address before going back to translate.c * meson: allow configuring the x86-64 baseline * meson: remove dead optimization option * exec: small changes to allow compilation with C++ in Android emulator * fix SEV compilation on 32-bit systems # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmZ+8mEUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroMVmAf+PjJBpMYNFb2qxJDw5jI7hITsrtm4 # v5TKo9x7E3pna5guae5ODFencYhBITQznHFa3gO9w09QN7Gq/rKjuBBST9VISslU # dW3HtxY9A1eHQtNqHuD7jBWWo9N0hhNiLRa6xz/VDTjEJSxhjSdK2bRW9Yz9hZAe # 8bbEEC9us21RdFTS+eijOMo9SPyASUlqIq4RbQpbAVuzzOMeXnfOuX9VSTcBy9o2 # 7cKMg7zjL8WQugJKynyl5lny7m1Ji55LD2UrYMF6Mik3Wz5kwgHcUITJ+ZHd/9hR # a+MI7o/jyCPdmX9pBvJCxyerCVYBu0ugLqYKpAcsqU6111FLrnGgDvHf/g== # =LdYd # -----END PGP SIGNATURE----- # gpg: Signature made Fri 28 Jun 2024 10:26:57 AM PDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (23 commits) target/i386/sev: Fix printf formats target/i386/sev: Use size_t for object sizes target/i386: SEV: store pointer to decoded id_auth in SevSnpGuest target/i386: SEV: rename sev_snp_guest->id_auth target/i386: SEV: store pointer to decoded id_block in SevSnpGuest target/i386: SEV: rename sev_snp_guest->id_block target/i386: remove unused enum target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL target/i386: use cpu_cc_dst for CC_OP_POPCNT target/i386: fix CC_OP dump include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH() exec: don't use void* in pointer arithmetic in headers exec: avoid using C++ keywords in function parameters block: rename former bdrv_file_open callbacks block: remove separate bdrv_file_open callback block: do not check bdrv_file_open block: make assertion more generic meson: remove dead optimization option meson: allow configuring the x86-64 baseline Revert "host/i386: assume presence of SSE2" ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/block/block_int-common.h3
-rw-r--r--include/exec/memory.h6
-rw-r--r--include/qapi/util.h2
-rw-r--r--include/qemu/atomic.h42
-rw-r--r--include/qemu/compiler.h46
5 files changed, 50 insertions, 49 deletions
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 7612761..ebb4e56 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -248,9 +248,6 @@ struct BlockDriver {
int GRAPH_UNLOCKED_PTR (*bdrv_open)(
BlockDriverState *bs, QDict *options, int flags, Error **errp);
- /* Protocol drivers should implement this instead of bdrv_open */
- int GRAPH_UNLOCKED_PTR (*bdrv_file_open)(
- BlockDriverState *bs, QDict *options, int flags, Error **errp);
void (*bdrv_close)(BlockDriverState *bs);
int coroutine_fn GRAPH_UNLOCKED_PTR (*bdrv_co_create)(
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 0903513..c26ede3 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -925,7 +925,7 @@ struct MemoryListener {
* the current transaction.
*/
void (*log_start)(MemoryListener *listener, MemoryRegionSection *section,
- int old, int new);
+ int old_val, int new_val);
/**
* @log_stop:
@@ -944,7 +944,7 @@ struct MemoryListener {
* the current transaction.
*/
void (*log_stop)(MemoryListener *listener, MemoryRegionSection *section,
- int old, int new);
+ int old_val, int new_val);
/**
* @log_sync:
@@ -2764,7 +2764,7 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr,
#include "exec/memory_ldst_phys.h.inc"
struct MemoryRegionCache {
- void *ptr;
+ uint8_t *ptr;
hwaddr xlat;
hwaddr len;
FlatView *fv;
diff --git a/include/qapi/util.h b/include/qapi/util.h
index 20dfea8..b825424 100644
--- a/include/qapi/util.h
+++ b/include/qapi/util.h
@@ -62,7 +62,7 @@ int parse_qapi_name(const char *name, bool complete);
#define QAPI_LIST_LENGTH(list) \
({ \
size_t _len = 0; \
- typeof(list) _tail; \
+ typeof_strip_qual(list) _tail; \
for (_tail = list; _tail != NULL; _tail = _tail->next) { \
_len++; \
} \
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
index 99110ab..dc4118d 100644
--- a/include/qemu/atomic.h
+++ b/include/qemu/atomic.h
@@ -20,48 +20,6 @@
/* Compiler barrier */
#define barrier() ({ asm volatile("" ::: "memory"); (void)0; })
-/* The variable that receives the old value of an atomically-accessed
- * variable must be non-qualified, because atomic builtins return values
- * through a pointer-type argument as in __atomic_load(&var, &old, MODEL).
- *
- * This macro has to handle types smaller than int manually, because of
- * implicit promotion. int and larger types, as well as pointers, can be
- * converted to a non-qualified type just by applying a binary operator.
- */
-#define typeof_strip_qual(expr) \
- typeof( \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(expr), bool) || \
- __builtin_types_compatible_p(typeof(expr), const bool) || \
- __builtin_types_compatible_p(typeof(expr), volatile bool) || \
- __builtin_types_compatible_p(typeof(expr), const volatile bool), \
- (bool)1, \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(expr), signed char) || \
- __builtin_types_compatible_p(typeof(expr), const signed char) || \
- __builtin_types_compatible_p(typeof(expr), volatile signed char) || \
- __builtin_types_compatible_p(typeof(expr), const volatile signed char), \
- (signed char)1, \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(expr), unsigned char) || \
- __builtin_types_compatible_p(typeof(expr), const unsigned char) || \
- __builtin_types_compatible_p(typeof(expr), volatile unsigned char) || \
- __builtin_types_compatible_p(typeof(expr), const volatile unsigned char), \
- (unsigned char)1, \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(expr), signed short) || \
- __builtin_types_compatible_p(typeof(expr), const signed short) || \
- __builtin_types_compatible_p(typeof(expr), volatile signed short) || \
- __builtin_types_compatible_p(typeof(expr), const volatile signed short), \
- (signed short)1, \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(expr), unsigned short) || \
- __builtin_types_compatible_p(typeof(expr), const unsigned short) || \
- __builtin_types_compatible_p(typeof(expr), volatile unsigned short) || \
- __builtin_types_compatible_p(typeof(expr), const volatile unsigned short), \
- (unsigned short)1, \
- (expr)+0))))))
-
#ifndef __ATOMIC_RELAXED
#error "Expecting C11 atomic ops"
#endif
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index c797f0d..554c5ce 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -227,4 +227,50 @@
#define SECOND_ARG(first, second, ...) second
#define IS_EMPTY_(junk_maybecomma) SECOND_ARG(junk_maybecomma 1, 0)
+#ifndef __cplusplus
+/*
+ * Useful in macros that need to declare temporary variables. For example,
+ * the variable that receives the old value of an atomically-accessed
+ * variable must be non-qualified, because atomic builtins return values
+ * through a pointer-type argument as in __atomic_load(&var, &old, MODEL).
+ *
+ * This macro has to handle types smaller than int manually, because of
+ * implicit promotion. int and larger types, as well as pointers, can be
+ * converted to a non-qualified type just by applying a binary operator.
+ */
+#define typeof_strip_qual(expr) \
+ typeof( \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(typeof(expr), bool) || \
+ __builtin_types_compatible_p(typeof(expr), const bool) || \
+ __builtin_types_compatible_p(typeof(expr), volatile bool) || \
+ __builtin_types_compatible_p(typeof(expr), const volatile bool), \
+ (bool)1, \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(typeof(expr), signed char) || \
+ __builtin_types_compatible_p(typeof(expr), const signed char) || \
+ __builtin_types_compatible_p(typeof(expr), volatile signed char) || \
+ __builtin_types_compatible_p(typeof(expr), const volatile signed char), \
+ (signed char)1, \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(typeof(expr), unsigned char) || \
+ __builtin_types_compatible_p(typeof(expr), const unsigned char) || \
+ __builtin_types_compatible_p(typeof(expr), volatile unsigned char) || \
+ __builtin_types_compatible_p(typeof(expr), const volatile unsigned char), \
+ (unsigned char)1, \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(typeof(expr), signed short) || \
+ __builtin_types_compatible_p(typeof(expr), const signed short) || \
+ __builtin_types_compatible_p(typeof(expr), volatile signed short) || \
+ __builtin_types_compatible_p(typeof(expr), const volatile signed short), \
+ (signed short)1, \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(typeof(expr), unsigned short) || \
+ __builtin_types_compatible_p(typeof(expr), const unsigned short) || \
+ __builtin_types_compatible_p(typeof(expr), volatile unsigned short) || \
+ __builtin_types_compatible_p(typeof(expr), const volatile unsigned short), \
+ (unsigned short)1, \
+ (expr)+0))))))
+#endif
+
#endif /* COMPILER_H */