* [PATCH] thunk: do not use HOST_* defines
@ 2021-12-16 10:05 Paolo Bonzini
2021-12-17 9:13 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2021-12-16 10:05 UTC (permalink / raw)
To: qemu-devel; +Cc: lvivier
Just use sizeof, avoiding the need to write down all the ABIs twice.
Cc: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/exec/user/thunk.h | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
index 300a840d58..c50ba17317 100644
--- a/include/exec/user/thunk.h
+++ b/include/exec/user/thunk.h
@@ -22,6 +22,7 @@
#include "cpu.h"
#include "exec/user/abitypes.h"
+#include <asm/posix_types.h>
/* types enums definitions */
@@ -109,16 +110,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
break;
case TYPE_OLDDEVT:
if (is_host) {
-#if defined(HOST_X86_64)
- return 8;
-#elif defined(HOST_ALPHA) || defined(HOST_IA64) || defined(HOST_MIPS) || \
- defined(HOST_PARISC) || defined(HOST_SPARC64)
- return 4;
-#elif defined(HOST_PPC)
- return sizeof(void *);
-#else
- return 2;
-#endif
+ return sizeof(__kernel_old_dev_t);
} else {
#if defined(TARGET_X86_64)
return 8;
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thunk: do not use HOST_* defines
2021-12-16 10:05 [PATCH] thunk: do not use HOST_* defines Paolo Bonzini
@ 2021-12-17 9:13 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2021-12-17 9:13 UTC (permalink / raw)
To: qemu-devel; +Cc: lvivier
On 12/16/21 11:05, Paolo Bonzini wrote:
> Just use sizeof, avoiding the need to write down all the ABIs twice.
>
> Cc: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This breaks bsd-user, I'll resend when "[PATCH v7 00/15] linux-user:
simplify safe signal handling" is in.
Paolo
> ---
> include/exec/user/thunk.h | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
> index 300a840d58..c50ba17317 100644
> --- a/include/exec/user/thunk.h
> +++ b/include/exec/user/thunk.h
> @@ -22,6 +22,7 @@
>
> #include "cpu.h"
> #include "exec/user/abitypes.h"
> +#include <asm/posix_types.h>
>
> /* types enums definitions */
>
> @@ -109,16 +110,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
> break;
> case TYPE_OLDDEVT:
> if (is_host) {
> -#if defined(HOST_X86_64)
> - return 8;
> -#elif defined(HOST_ALPHA) || defined(HOST_IA64) || defined(HOST_MIPS) || \
> - defined(HOST_PARISC) || defined(HOST_SPARC64)
> - return 4;
> -#elif defined(HOST_PPC)
> - return sizeof(void *);
> -#else
> - return 2;
> -#endif
> + return sizeof(__kernel_old_dev_t);
> } else {
> #if defined(TARGET_X86_64)
> return 8;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-17 9:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 10:05 [PATCH] thunk: do not use HOST_* defines Paolo Bonzini
2021-12-17 9:13 ` Paolo Bonzini
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).