aboutsummaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-03-07 02:01:13 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-03-08 00:44:07 +0100
commit8e5e86fc13732b60d2e4d14152d92db1f1ae73f9 (patch)
tree07aacb1367209c143667ebaac6f838fcddad3e89 /i386
parente52779eb879ea8a14bb293e97c989f52eb439cbb (diff)
downloadgnumach-8e5e86fc13732b60d2e4d14152d92db1f1ae73f9.tar.gz
gnumach-8e5e86fc13732b60d2e4d14152d92db1f1ae73f9.tar.bz2
gnumach-8e5e86fc13732b60d2e4d14152d92db1f1ae73f9.zip
Align mach_msg_type_t and mach_msg_type_long_t with the same alignment as uintptr_t.
With this change, any 64 bit code using the IPC subsystem without relying on MiG will work without any changes. We have a few examples of this inside gnumach but also in the Hurd servers. For example, in hurd/console/display.c typedef struct { mach_msg_header_t Head; mach_msg_type_t ticknoType; natural_t tickno; mach_msg_type_t changeType; file_changed_type_t change; mach_msg_type_t startType; loff_t start; mach_msg_type_t endType; loff_t end; } Request; This will now work correctly in 64 bits, without requiring any explicit padding. As a follow up, we can simplify mach_msg_type_long_t so that we only need an 8 byte structure where the second field will include the number of elements for the long form. This is already included in mach_msg_type_t as unused_msgtl_number. Message-Id: <ZAbhOfOzsb8qPFs6@jupiter.tail36e24.ts.net>
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/copy_user.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/i386/i386/copy_user.h b/i386/i386/copy_user.h
index c7e8b4e1..5cdbfa80 100644
--- a/i386/i386/copy_user.h
+++ b/i386/i386/copy_user.h
@@ -71,7 +71,7 @@ static inline int copyout_address(const vm_offset_t *kaddr, rpc_vm_offset_t *uad
static inline int copyin_port(const mach_port_name_t *uaddr, mach_port_t *kaddr)
{
-#ifdef __x86_64
+#ifdef __x86_64__
return copyin_32to64(uaddr, kaddr);
#else /* __x86_64__ */
return copyin(uaddr, kaddr, sizeof(*uaddr));
@@ -80,7 +80,7 @@ static inline int copyin_port(const mach_port_name_t *uaddr, mach_port_t *kaddr)
static inline int copyout_port(const mach_port_t *kaddr, mach_port_name_t *uaddr)
{
-#ifdef __x86_64
+#ifdef __x86_64__
return copyout_64to32(kaddr, uaddr);
#else /* __x86_64__ */
return copyout(kaddr, uaddr, sizeof(*kaddr));