From 47fcc71f96286be7e6d6190d6cb1663b6cf0f6cb Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 28 Feb 2022 13:45:10 +0000 Subject: [PATCH] include/s390.h: add STATIC_ASSERTION for size of lowcore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps to find possible bugs earlier, e.g. possible bugs in the changes in the upcoming patches. Signed-off-by: Marc Hartmayer Reviewed-by: Steffen Eiden Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- include/boot/s390.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boot/s390.h b/include/boot/s390.h index 89397a22..01c80940 100644 --- a/include/boot/s390.h +++ b/include/boot/s390.h @@ -16,6 +16,8 @@ #define __LC_IPLDEV 0x0c6c #define __LC_OS_INFO 0x0e18 +#define LOWCORE_SIZE _AC(0x2000, UL) + #define PAGE_SIZE _AC(4096, UL) /* Minimum size of a stack frame in bytes */ @@ -210,6 +212,7 @@ struct _lowcore { /* align to the top of the prefix area */ uint8_t pad_0x1900[0x2000-0x1900]; /* 0x1900 */ } __packed __aligned(8192); +STATIC_ASSERT(sizeof(struct _lowcore) == LOWCORE_SIZE) #define S390_lowcore (*((struct _lowcore *) 0))