include/qemu/atomic: Drop aligned_{u}int64_t

As we no longer support i386 as a host architecture,
this abstraction is no longer required.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson
2026-01-08 14:15:01 +11:00
parent 997d86a9bb
commit 239b9d0488
5 changed files with 6 additions and 19 deletions

View File

@@ -27,8 +27,8 @@
# define SHIFT 4 # define SHIFT 4
#elif DATA_SIZE == 8 #elif DATA_SIZE == 8
# define SUFFIX q # define SUFFIX q
# define DATA_TYPE aligned_uint64_t # define DATA_TYPE uint64_t
# define SDATA_TYPE aligned_int64_t # define SDATA_TYPE int64_t
# define BSWAP bswap64 # define BSWAP bswap64
# define SHIFT 3 # define SHIFT 3
#elif DATA_SIZE == 4 #elif DATA_SIZE == 4

View File

@@ -234,17 +234,4 @@
_oldn; \ _oldn; \
}) })
/*
* Abstractions to access atomically (i.e. "once") i64/u64 variables.
*
* The i386 abi is odd in that by default members are only aligned to
* 4 bytes, which means that 8-byte types can wind up mis-aligned.
* Clang will then warn about this, and emit a call into libatomic.
*
* Use of these types in structures when they will be used with atomic
* operations can avoid this.
*/
typedef int64_t aligned_int64_t __attribute__((aligned(8)));
typedef uint64_t aligned_uint64_t __attribute__((aligned(8)));
#endif /* QEMU_ATOMIC_H */ #endif /* QEMU_ATOMIC_H */

View File

@@ -47,7 +47,7 @@ typedef struct TimersState {
int64_t last_delta; int64_t last_delta;
/* Compensate for varying guest execution speed. */ /* Compensate for varying guest execution speed. */
aligned_int64_t qemu_icount_bias; int64_t qemu_icount_bias;
int64_t vm_clock_warp_start; int64_t vm_clock_warp_start;
int64_t cpu_clock_offset; int64_t cpu_clock_offset;

View File

@@ -83,7 +83,7 @@ static abi_ulong hppa_lws(CPUHPPAState *env)
uint64_t o64, n64, r64; uint64_t o64, n64, r64;
o64 = *(uint64_t *)g2h(cs, old); o64 = *(uint64_t *)g2h(cs, old);
n64 = *(uint64_t *)g2h(cs, new); n64 = *(uint64_t *)g2h(cs, new);
r64 = qatomic_cmpxchg((aligned_uint64_t *)g2h(cs, addr), o64, n64); r64 = qatomic_cmpxchg((uint64_t *)g2h(cs, addr), o64, n64);
ret = r64 != o64; ret = r64 != o64;
} }
break; break;

View File

@@ -83,8 +83,8 @@ typedef struct QSPCallSite QSPCallSite;
struct QSPEntry { struct QSPEntry {
void *thread_ptr; void *thread_ptr;
const QSPCallSite *callsite; const QSPCallSite *callsite;
aligned_uint64_t n_acqs; uint64_t n_acqs;
aligned_uint64_t ns; uint64_t ns;
unsigned int n_objs; /* count of coalesced objs; only used for reporting */ unsigned int n_objs; /* count of coalesced objs; only used for reporting */
}; };
typedef struct QSPEntry QSPEntry; typedef struct QSPEntry QSPEntry;