From aea244efe1d3c4b44f4ba67c5b540982b560ac26 Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Sat, 30 Sep 2023 12:48:06 +0200 Subject: [PATCH] Kernel: Mark SDHC InterruptStatus structured view as const This view is really nice to check flags, but when clearing them we must make sure that we only ever try to set 1 bit at a time, which makes setting bits through the structured view a footgun, as that fetches, ors in and then sets, potentially resetting other flags. --- Kernel/Devices/Storage/SD/Registers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Devices/Storage/SD/Registers.h b/Kernel/Devices/Storage/SD/Registers.h index 1f3489b4b9..ba890fe08b 100644 --- a/Kernel/Devices/Storage/SD/Registers.h +++ b/Kernel/Devices/Storage/SD/Registers.h @@ -103,7 +103,7 @@ struct HostControlRegisterMap { u32 tuning_error : 1; u32 response_error : 1; u32 vendor_specific_error : 1; - }; + } const; u32 raw; } interrupt_status; u32 interrupt_status_enable;