From cf344027f830f8ecf9e834c49117e8c745db6bd6 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 13 Sep 2019 21:36:59 -0400 Subject: [PATCH] kernel: Add padding in mutex fields for equivalent KDEBUG/non-KDEBUG sizing. Non-KDEBUG kernels and kernel add-ons use atomic operations to acquire and release the locks inline, so non-KDEBUG kernels/addons are only compatible with other non-KDEBUG kernels/addons. Following this change, though, KDEBUG kernels/addons should be able to run under non-KDEBUG kernels/addons, too, since they always call into the actual kernel functions and do not inline anything of consequence. --- headers/private/kernel/lock.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/headers/private/kernel/lock.h b/headers/private/kernel/lock.h index bcc53c54d9..500118bf53 100644 --- a/headers/private/kernel/lock.h +++ b/headers/private/kernel/lock.h @@ -24,6 +24,7 @@ typedef struct mutex { spinlock lock; #if KDEBUG thread_id holder; + uint16 _unused; #else int32 count; uint16 ignore_unlock_count; @@ -38,6 +39,8 @@ typedef struct recursive_lock { mutex lock; #if !KDEBUG thread_id holder; +#else + int32 _unused; #endif int recursion; } recursive_lock;