aboutsummaryrefslogtreecommitdiff
path: root/device
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-05-04 00:26:32 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-05 02:25:13 +0200
commit50b744c4c2877dfbec54dc7bdae0d141e34c17c3 (patch)
tree572f99b8ac945e9f51d7c788dc4bcfc6aa5e6dc9 /device
parent3f90df494c3a3b3925b4bd9084cd56205e107f91 (diff)
downloadgnumach-50b744c4c2877dfbec54dc7bdae0d141e34c17c3.tar.gz
gnumach-50b744c4c2877dfbec54dc7bdae0d141e34c17c3.tar.bz2
gnumach-50b744c4c2877dfbec54dc7bdae0d141e34c17c3.zip
Improve portability for device/net_io.c and use designated initializers
Message-Id: <ZFMz+B3dsMAWl3hM@jupiter.tail36e24.ts.net>
Diffstat (limited to 'device')
-rw-r--r--device/net_io.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/device/net_io.c b/device/net_io.c
index bad6d3eb..cabb1be9 100644
--- a/device/net_io.c
+++ b/device/net_io.c
@@ -386,22 +386,23 @@ boolean_t ethernet_priority(const ipc_kmsg_t kmsg)
}
mach_msg_type_t header_type = {
- MACH_MSG_TYPE_BYTE,
- 8,
- NET_HDW_HDR_MAX,
- TRUE,
- FALSE,
- FALSE,
- 0
+ .msgt_name = MACH_MSG_TYPE_BYTE,
+ .msgt_size = 8,
+ .msgt_number = NET_HDW_HDR_MAX,
+ .msgt_inline = TRUE,
+ .msgt_longform = FALSE,
+ .msgt_deallocate = FALSE,
+ .msgt_unused = 0
};
mach_msg_type_t packet_type = {
- MACH_MSG_TYPE_BYTE, /* name */
- 8, /* size */
- 0, /* number */
- TRUE, /* inline */
- FALSE, /* longform */
- FALSE /* deallocate */
+ .msgt_name = MACH_MSG_TYPE_BYTE,
+ .msgt_size = 8,
+ .msgt_number = 0,
+ .msgt_inline = TRUE,
+ .msgt_longform = FALSE,
+ .msgt_deallocate = FALSE,
+ .msgt_unused = 0
};
/*
@@ -465,9 +466,10 @@ static boolean_t net_deliver(boolean_t nonblocking)
MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND, 0);
/* remember message sizes must be rounded up */
kmsg->ikm_header.msgh_size =
- (((mach_msg_size_t) (sizeof(struct net_rcv_msg)
+ (mach_msg_size_t) P2ROUND(sizeof(struct net_rcv_msg)
- sizeof net_kmsg(kmsg)->sent
- - NET_RCV_MAX + count)) + 3) &~ 3;
+ - NET_RCV_MAX + count,
+ __alignof__ (uintptr_t));
kmsg->ikm_header.msgh_local_port = MACH_PORT_NULL;
kmsg->ikm_header.msgh_kind = MACH_MSGH_KIND_NORMAL;
kmsg->ikm_header.msgh_id = NET_RCV_MSG_ID;