From b6bdd91cfab27557656b543f56600010cfc40f1a Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Wed, 5 May 2021 23:02:07 +0200 Subject: [PATCH] nova: avoid unaligned warnings by gcc10 Issue #4126 --- repos/base-nova/include/nova/syscall-generic.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repos/base-nova/include/nova/syscall-generic.h b/repos/base-nova/include/nova/syscall-generic.h index 7718edd256..4d7c62fa19 100644 --- a/repos/base-nova/include/nova/syscall-generic.h +++ b/repos/base-nova/include/nova/syscall-generic.h @@ -592,10 +592,11 @@ namespace Nova { } gdtr, idtr; unsigned long long tsc_val, tsc_off; } __attribute__((packed)); + mword_t mr[(4096 - 4 * sizeof(mword_t)) / sizeof(mword_t)]; }; /* message payload */ - mword_t * msg() { return reinterpret_cast(&mtd); } + mword_t * msg() { return mr; } struct Item { mword_t crd; @@ -747,7 +748,9 @@ namespace Nova { } mword_t mtd_value() const { return static_cast(mtd).value(); } - } __attribute__((packed)); + }; + + static_assert(sizeof(Utcb) == 4096, "Unexpected size of UTCB"); /** * Size of event-specific portal window mapped at PD creation time