From e03b56863d2bca3e649e81531c1b0299524481ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:17 +0400 Subject: Replace config-time define HOST_WORDS_BIGENDIAN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad usage, if the config header wasn't included before. This can help to make some code independent from qemu too. gcc supports __BYTE_ORDER__ from about 4.6 and clang from 3.2. Signed-off-by: Marc-André Lureau [ For the s390x parts I'm involved in ] Acked-by: Halil Pasic Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/bswap.h | 8 ++++---- include/qemu/host-utils.h | 2 +- include/qemu/int128.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 2d3bb8b..9dff7c7 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -84,7 +84,7 @@ static inline void bswap64s(uint64_t *s) *s = bswap64(*s); } -#if defined(HOST_WORDS_BIGENDIAN) +#if HOST_BIG_ENDIAN #define be_bswap(v, size) (v) #define le_bswap(v, size) glue(bswap, size)(v) #define be_bswaps(v, size) @@ -188,7 +188,7 @@ CPU_CONVERT(le, 64, uint64_t) * a compile-time constant if you pass in a constant. So this can be * used to initialize static variables. */ -#if defined(HOST_WORDS_BIGENDIAN) +#if HOST_BIG_ENDIAN # define const_le32(_x) \ ((((_x) & 0x000000ffU) << 24) | \ (((_x) & 0x0000ff00U) << 8) | \ @@ -211,7 +211,7 @@ typedef union { typedef union { float64 d; -#if defined(HOST_WORDS_BIGENDIAN) +#if HOST_BIG_ENDIAN struct { uint32_t upper; uint32_t lower; @@ -235,7 +235,7 @@ typedef union { typedef union { float128 q; -#if defined(HOST_WORDS_BIGENDIAN) +#if HOST_BIG_ENDIAN struct { uint32_t upmost; uint32_t upper; diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h index ca979dc..f19bd29 100644 --- a/include/qemu/host-utils.h +++ b/include/qemu/host-utils.h @@ -88,7 +88,7 @@ static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) union { uint64_t ll; struct { -#ifdef HOST_WORDS_BIGENDIAN +#if HOST_BIG_ENDIAN uint32_t high, low; #else uint32_t low, high; diff --git a/include/qemu/int128.h b/include/qemu/int128.h index 2c40642..37e07fd 100644 --- a/include/qemu/int128.h +++ b/include/qemu/int128.h @@ -205,7 +205,7 @@ typedef struct Int128 Int128; * a union with other integer types). */ struct Int128 { -#ifdef HOST_WORDS_BIGENDIAN +#if HOST_BIG_ENDIAN int64_t hi; uint64_t lo; #else -- cgit v1.1 From 7773e13fa729bbd2b106121b6c63b11a46c7d0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:19 +0400 Subject: osdep: poison {HOST,TARGET}_WORDS_BIGENDIAN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Suggested-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-9-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 9f06bf5..95a1491 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -34,6 +34,18 @@ #include "exec/poison.h" #endif +/* + * HOST_WORDS_BIGENDIAN was replaced with HOST_BIG_ENDIAN. Prevent it from + * creeping back in. + */ +#pragma GCC poison HOST_WORDS_BIGENDIAN + +/* + * TARGET_WORDS_BIGENDIAN was replaced with TARGET_BIG_ENDIAN. Prevent it from + * creeping back in. + */ +#pragma GCC poison TARGET_WORDS_BIGENDIAN + #include "qemu/compiler.h" /* Older versions of C++ don't get definitions of various macros from -- cgit v1.1 From 8e3b0cbb7212a1e5707ed2d4c26b4e3d2483768d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:22 +0400 Subject: Replace qemu_real_host_page variables with inlined functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the global variables with inlined helper functions. getpagesize() is very likely annotated with a "const" function attribute (at least with glibc), and thus optimization should apply even better. This avoids the need for a constructor initialization too. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-12-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 95a1491..240b487 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -431,9 +431,9 @@ extern int madvise(char *, size_t, int); /* Use 1 MiB (segment size) alignment so gmap can be used by KVM. */ # define QEMU_VMALLOC_ALIGN (256 * 4096) #elif defined(__linux__) && defined(__sparc__) -# define QEMU_VMALLOC_ALIGN MAX(qemu_real_host_page_size, SHMLBA) +# define QEMU_VMALLOC_ALIGN MAX(qemu_real_host_page_size(), SHMLBA) #else -# define QEMU_VMALLOC_ALIGN qemu_real_host_page_size +# define QEMU_VMALLOC_ALIGN qemu_real_host_page_size() #endif #ifdef CONFIG_POSIX @@ -590,8 +590,15 @@ pid_t qemu_fork(Error **errp); /* Using intptr_t ensures that qemu_*_page_mask is sign-extended even * when intptr_t is 32-bit and we are aligning a long long. */ -extern uintptr_t qemu_real_host_page_size; -extern intptr_t qemu_real_host_page_mask; +static inline uintptr_t qemu_real_host_page_size(void) +{ + return getpagesize(); +} + +static inline intptr_t qemu_real_host_page_mask(void) +{ + return -(intptr_t)qemu_real_host_page_size(); +} /* * After using getopt or getopt_long, if you need to parse another set -- cgit v1.1 From 1dacd88ddcf33eb6ed044c4080e3ef5e3de4b6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:27 +0400 Subject: include: move TFR to osdep.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macro requires EINTR, which has its header included in osdep.h. (Not sure what TFR stands for, perhaps "Test For Retry". Rename it ?) Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-17-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 240b487..489a5d1 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -226,6 +226,8 @@ extern "C" { #define ESHUTDOWN 4099 #endif +#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) + /* time_t may be either 32 or 64 bits depending on the host OS, and * can be either signed or unsigned, so we can't just hardcode a * specific maximum value. This is not a C preprocessor constant, -- cgit v1.1 From 0d14a2f30043665f40c11f78b5a1fb80bdc6568a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:28 +0400 Subject: include: move qemu_write_full() declaration to osdep.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closer to other IO functions. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-18-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 489a5d1..259436f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -527,6 +527,9 @@ static inline void qemu_timersub(const struct timeval *val1, #define qemu_timersub timersub #endif +ssize_t qemu_write_full(int fd, const void *buf, size_t count) + G_GNUC_WARN_UNUSED_RESULT; + void qemu_set_cloexec(int fd); void fips_set_state(bool requested); -- cgit v1.1 From 3bd04c091eb1cf2e01cd59e4e232b6b3bbdba15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:29 +0400 Subject: include: move qemu_pipe() to osdep.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-19-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 259436f..a733294 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -530,6 +530,10 @@ static inline void qemu_timersub(const struct timeval *val1, ssize_t qemu_write_full(int fd, const void *buf, size_t count) G_GNUC_WARN_UNUSED_RESULT; +#ifndef _WIN32 +int qemu_pipe(int pipefd[2]); +#endif + void qemu_set_cloexec(int fd); void fips_set_state(bool requested); -- cgit v1.1 From c097f1e603c9deef308e17499b91dd6d552c2dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:30 +0400 Subject: include: move coroutine IO functions to coroutine.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index c828a95..284571b 100644 --- a/include/qemu/coroutine.h +++ b/include/qemu/coroutine.h @@ -343,4 +343,27 @@ void qemu_coroutine_decrease_pool_batch_size(unsigned int additional_pool_size); #include "qemu/lockable.h" +/** + * Sends a (part of) iovec down a socket, yielding when the socket is full, or + * Receives data into a (part of) iovec from a socket, + * yielding when there is no data in the socket. + * The same interface as qemu_sendv_recvv(), with added yielding. + * XXX should mark these as coroutine_fn + */ +ssize_t qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt, + size_t offset, size_t bytes, bool do_send); +#define qemu_co_recvv(sockfd, iov, iov_cnt, offset, bytes) \ + qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, false) +#define qemu_co_sendv(sockfd, iov, iov_cnt, offset, bytes) \ + qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, true) + +/** + * The same as above, but with just a single buffer + */ +ssize_t qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send); +#define qemu_co_recv(sockfd, buf, bytes) \ + qemu_co_send_recv(sockfd, buf, bytes, false) +#define qemu_co_send(sockfd, buf, bytes) \ + qemu_co_send_recv(sockfd, buf, bytes, true) + #endif /* QEMU_COROUTINE_H */ -- cgit v1.1 From 415b732751daeccfff681898a716180ceb34dc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:32 +0400 Subject: include: move C/util-related declarations to cutils.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-22-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/cutils.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 3205439..2137e65 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -214,4 +214,24 @@ static inline const char *yes_no(bool b) return b ? "yes" : "no"; } +/* + * helper to parse debug environment variables + */ +int parse_debug_env(const char *name, int max, int initial); + +/* + * Hexdump a line of a byte buffer into a hexadecimal/ASCII buffer + */ +#define QEMU_HEXDUMP_LINE_BYTES 16 /* Number of bytes to dump */ +#define QEMU_HEXDUMP_LINE_LEN 75 /* Number of characters in line */ +void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr, + unsigned int len, bool ascii); + +/* + * Hexdump a buffer to a file. An optional string prefix is added to every line + */ + +void qemu_hexdump(FILE *fp, const char *prefix, + const void *bufptr, size_t size); + #endif -- cgit v1.1 From 16a18f26818c783fed153f7a8fb4a9afdfb547ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:35 +0400 Subject: include: move progress API to qemu-progress.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-25-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/qemu-progress.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 include/qemu/qemu-progress.h (limited to 'include/qemu') diff --git a/include/qemu/qemu-progress.h b/include/qemu/qemu-progress.h new file mode 100644 index 0000000..137e1c3 --- /dev/null +++ b/include/qemu/qemu-progress.h @@ -0,0 +1,8 @@ +#ifndef QEMU_PROGRESS_H +#define QEMU_PROGRESS_H + +void qemu_progress_init(int enabled, float min_skip); +void qemu_progress_end(void); +void qemu_progress_print(float delta, int max); + +#endif /* QEMU_PROGRESS_H */ -- cgit v1.1 From 69242e7e7ea55f2a3f4fa50e367cad849c9cdc36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:39 +0400 Subject: Move CPU softfloat unions to cpu-float.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The types are no longer used in bswap.h since commit f930224fffe ("bswap.h: Remove unused float-access functions"), there isn't much sense in keeping it there and having a dependency on fpu/. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-29-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/bswap.h | 60 --------------------------------------------- include/qemu/cpu-float.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 60 deletions(-) create mode 100644 include/qemu/cpu-float.h (limited to 'include/qemu') diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 9dff7c7..346d05f 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -19,8 +19,6 @@ extern "C" { #endif -#include "fpu/softfloat-types.h" - #ifdef BSWAP_FROM_BYTESWAP static inline uint16_t bswap16(uint16_t x) { @@ -202,64 +200,6 @@ CPU_CONVERT(le, 64, uint64_t) # define const_le16(_x) (_x) #endif -/* Unions for reinterpreting between floats and integers. */ - -typedef union { - float32 f; - uint32_t l; -} CPU_FloatU; - -typedef union { - float64 d; -#if HOST_BIG_ENDIAN - struct { - uint32_t upper; - uint32_t lower; - } l; -#else - struct { - uint32_t lower; - uint32_t upper; - } l; -#endif - uint64_t ll; -} CPU_DoubleU; - -typedef union { - floatx80 d; - struct { - uint64_t lower; - uint16_t upper; - } l; -} CPU_LDoubleU; - -typedef union { - float128 q; -#if HOST_BIG_ENDIAN - struct { - uint32_t upmost; - uint32_t upper; - uint32_t lower; - uint32_t lowest; - } l; - struct { - uint64_t upper; - uint64_t lower; - } ll; -#else - struct { - uint32_t lowest; - uint32_t lower; - uint32_t upper; - uint32_t upmost; - } l; - struct { - uint64_t lower; - uint64_t upper; - } ll; -#endif -} CPU_QuadU; - /* unaligned/endian-independent pointer access */ /* diff --git a/include/qemu/cpu-float.h b/include/qemu/cpu-float.h new file mode 100644 index 0000000..9110994 --- /dev/null +++ b/include/qemu/cpu-float.h @@ -0,0 +1,64 @@ +#ifndef QEMU_CPU_FLOAT_H_ +#define QEMU_CPU_FLOAT_H_ + +#include "fpu/softfloat-types.h" + +/* Unions for reinterpreting between floats and integers. */ + +typedef union { + float32 f; + uint32_t l; +} CPU_FloatU; + +typedef union { + float64 d; +#if HOST_BIG_ENDIAN + struct { + uint32_t upper; + uint32_t lower; + } l; +#else + struct { + uint32_t lower; + uint32_t upper; + } l; +#endif + uint64_t ll; +} CPU_DoubleU; + +typedef union { + floatx80 d; + struct { + uint64_t lower; + uint16_t upper; + } l; +} CPU_LDoubleU; + +typedef union { + float128 q; +#if HOST_BIG_ENDIAN + struct { + uint32_t upmost; + uint32_t upper; + uint32_t lower; + uint32_t lowest; + } l; + struct { + uint64_t upper; + uint64_t lower; + } ll; +#else + struct { + uint32_t lowest; + uint32_t lower; + uint32_t upper; + uint32_t upmost; + } l; + struct { + uint64_t lower; + uint64_t upper; + } ll; +#endif +} CPU_QuadU; + +#endif /* QEMU_CPU_FLOAT_H_ */ -- cgit v1.1 From e9c4e0a8e54008bd83459777c8b8f5a38ff6fea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Mar 2022 19:57:40 +0400 Subject: Move fcntl_setfl() to oslib-posix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is only implemented for POSIX anyway. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-30-marcandre.lureau@redhat.com> [Add braces around if statements. - Paolo] Signed-off-by: Paolo Bonzini --- include/qemu/cutils.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/qemu') diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 2137e65..e873bad 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -131,7 +131,6 @@ const char *qemu_strchrnul(const char *s, int c); time_t mktimegm(struct tm *tm); int qemu_fdatasync(int fd); int qemu_msync(void *addr, size_t length, int fd); -int fcntl_setfl(int fd, int flag); int qemu_parse_fd(const char *param); int qemu_strtoi(const char *nptr, const char **endptr, int base, int *result); -- cgit v1.1 From f9fc8932b11f3bcf2a2626f567cb6fdd36a33a94 Mon Sep 17 00:00:00 2001 From: "Longpeng(Mike)" Date: Tue, 22 Feb 2022 17:05:04 +0800 Subject: thread-posix: remove the posix semaphore support POSIX specifies an absolute time for sem_timedwait(), it would be affected if the system time is changing, but there is not a relative time or monotonic clock version of sem_timedwait, so we cannot gain from POSIX semaphore any more. An alternative way is to use sem_trywait + usleep, maybe we can remove CONFIG_SEM_TIMEDWAIT in this way? No, because some systems (e.g. mac os) mark the sem_xxx API as deprecated. So maybe remove the usage of POSIX semaphore and turn to use the pthread variant for all systems looks better. Signed-off-by: Longpeng(Mike) Message-Id: <20220222090507.2028-2-longpeng2@huawei.com> Signed-off-by: Paolo Bonzini --- include/qemu/thread-posix.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h index b792e6e..5466608 100644 --- a/include/qemu/thread-posix.h +++ b/include/qemu/thread-posix.h @@ -27,13 +27,9 @@ struct QemuCond { }; struct QemuSemaphore { -#ifndef CONFIG_SEM_TIMEDWAIT pthread_mutex_t lock; pthread_cond_t cond; unsigned int count; -#else - sem_t sem; -#endif bool initialized; }; -- cgit v1.1 From a0d45db85496c195ab5f3f2ced742fc93d9709c2 Mon Sep 17 00:00:00 2001 From: "Longpeng(Mike)" Date: Tue, 22 Feb 2022 17:05:06 +0800 Subject: thread-posix: implement Semaphore with QemuCond and QemuMutex Now that QemuSemaphore is implemented through pthread_cond_t only, we can use QemuCond and QemuMutex to make the code smaller. Features such as mutex tracing and CLOCK_MONOTONIC timedwait are supported in qemu-sem naturally. Signed-off-by: Longpeng(Mike) Message-Id: <20220222090507.2028-4-longpeng2@huawei.com> Signed-off-by: Paolo Bonzini --- include/qemu/thread-posix.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h index 5466608..5f2f3d1 100644 --- a/include/qemu/thread-posix.h +++ b/include/qemu/thread-posix.h @@ -27,10 +27,9 @@ struct QemuCond { }; struct QemuSemaphore { - pthread_mutex_t lock; - pthread_cond_t cond; + QemuMutex mutex; + QemuCond cond; unsigned int count; - bool initialized; }; struct QemuEvent { -- cgit v1.1