From 3e5b8e65d3611a1968344dcfd260b35197663b2b Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 11 May 2017 11:27:17 +0200 Subject: [PATCH] add padding to align allocate memory to a 32 Byte boundary - required to align memory for AVX usage --- arch/x86/kernel/tasks.c | 2 +- include/hermit/malloc.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/tasks.c b/arch/x86/kernel/tasks.c index b73dfe926..13bebbee5 100644 --- a/arch/x86/kernel/tasks.c +++ b/arch/x86/kernel/tasks.c @@ -39,7 +39,7 @@ #include #include -#define TLS_OFFSET 8 +#define TLS_OFFSET 0 /* * Note that linker symbols are not variables, they have no memory allocated for diff --git a/include/hermit/malloc.h b/include/hermit/malloc.h index 75eeef9f1..8537078f0 100644 --- a/include/hermit/malloc.h +++ b/include/hermit/malloc.h @@ -71,6 +71,8 @@ typedef union buddy { uint8_t exponent; /// Must be equal to BUDDY_MAGIC for a valid memory block uint16_t magic; + /// padding to gurantee a sizeof 32Byte + uint8_t padding[28]; } prefix; } buddy_t;