aboutsummaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-05-15 10:04:22 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-05-15 10:04:22 +0100
commitf39ddb3a08df2d2573d6aff062190f093912f9ef (patch)
tree06ac1527235b1164670d873019b96782caafb86e /include/exec
parentc691c8761616cff9c58caf345bfa7ae450e00088 (diff)
parentf606e4d6258fa82c3f6c1cc762ebe483db5f5db6 (diff)
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.13-pull-request' into staging
# gpg: Signature made Mon 14 May 2018 19:15:02 BST # gpg: using RSA key F30C38BD3F2FBE3C # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" # gpg: aka "Laurent Vivier <laurent@vivier.eu>" # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/linux-user-for-2.13-pull-request: linux-user: correctly align types in thunking code linux-user: fix UNAME_MACHINE for sparc/sparc64 linux-user: add sparc/sparc64 specific errno linux-user: fix conversion of flock/flock64 l_type field linux-user: update sparc/syscall_nr.h to linux header 4.16 linux-user: fix flock/flock64 padding linux-user: define correct fcntl() values for sparc Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/user/thunk.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
index f19ef4b230..8f55b233b3 100644
--- a/include/exec/user/thunk.h
+++ b/include/exec/user/thunk.h
@@ -149,20 +149,32 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
case TYPE_CHAR:
return 1;
case TYPE_SHORT:
- return 2;
+ if (is_host) {
+ return __alignof__(short);
+ } else {
+ return ABI_SHORT_ALIGNMENT;
+ }
case TYPE_INT:
- return 4;
+ if (is_host) {
+ return __alignof__(int);
+ } else {
+ return ABI_INT_ALIGNMENT;
+ }
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
- return 8;
+ if (is_host) {
+ return __alignof__(long long);
+ } else {
+ return ABI_LLONG_ALIGNMENT;
+ }
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_PTRVOID:
case TYPE_PTR:
if (is_host) {
- return sizeof(void *);
+ return __alignof__(long);
} else {
- return TARGET_ABI_BITS / 8;
+ return ABI_LONG_ALIGNMENT;
}
break;
case TYPE_OLDDEVT: