aboutsummaryrefslogtreecommitdiff
path: root/routine.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-02-12 17:14:23 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-13 00:42:36 +0100
commita391c8f0eef8573fd6b99e6cd264a5f2caa539cb (patch)
tree4e0835b958dcd51a59ab5a1bf652dec4ea2c544a /routine.c
parent403007dc55222d4ca1120dd7730baa7579d12d88 (diff)
downloadmig-a391c8f0eef8573fd6b99e6cd264a5f2caa539cb.tar.gz
mig-a391c8f0eef8573fd6b99e6cd264a5f2caa539cb.tar.bz2
mig-a391c8f0eef8573fd6b99e6cd264a5f2caa539cb.zip
Introduce complex_alignof to replace word_size
Remove the concept of word_size since it is meaningless in some architectures. This is also done in preparation to possibly introduce 8-byte aligned messages. Message-Id: <Y+lkv0uMo/3+hbCb@jupiter.tail36e24.ts.net>
Diffstat (limited to 'routine.c')
-rw-r--r--routine.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/routine.c b/routine.c
index c0a016c..3ae9298 100644
--- a/routine.c
+++ b/routine.c
@@ -47,6 +47,7 @@
#include "routine.h"
#include "message.h"
#include "cpu.h"
+#include "utils.h"
u_int rtNumber = 0;
@@ -316,19 +317,21 @@ rtFindSize(const argument_t *args, u_int mask)
const argument_t *arg;
u_int size = sizeof_mach_msg_header_t;
+ size = ALIGN(size, complex_alignof);
for (arg = args; arg != argNULL; arg = arg->argNext)
if (akCheck(arg->argKind, mask))
{
ipc_type_t *it = arg->argType;
/* might need proper alignment on demanding 64bit archies */
- size = (size + word_size-1) & ~(word_size-1);
if (arg->argLongForm) {
size += sizeof_mach_msg_type_long_t;
} else {
size += sizeof_mach_msg_type_t;
}
+ size = ALIGN(size, complex_alignof);
+ /* Note itMinTypeSize is already aligned to complex_alignof. */
size += it->itMinTypeSize;
}