summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86_64/ISABus
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2022-11-09 11:39:58 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2023-01-02 18:15:27 -0500
commita6a439243f3101e5d2f75f54b8aa6bc4c8b2e323 (patch)
tree6138d92caa93e67f63f0c6b20b3916224d9aae7b /Kernel/Arch/x86_64/ISABus
parent363cc121462e452236623db44845329db3098fca (diff)
downloadserenity-a6a439243f3101e5d2f75f54b8aa6bc4c8b2e323.zip
Kernel: Turn lock ranks into template parameters
This step would ideally not have been necessary (increases amount of refactoring and templates necessary, which in turn increases build times), but it gives us a couple of nice properties: - SpinlockProtected inside Singleton (a very common combination) can now obtain any lock rank just via the template parameter. It was not previously possible to do this with SingletonInstanceCreator magic. - SpinlockProtected's lock rank is now mandatory; this is the majority of cases and allows us to see where we're still missing proper ranks. - The type already informs us what lock rank a lock has, which aids code readability and (possibly, if gdb cooperates) lock mismatch debugging. - The rank of a lock can no longer be dynamic, which is not something we wanted in the first place (or made use of). Locks randomly changing their rank sounds like a disaster waiting to happen. - In some places, we might be able to statically check that locks are taken in the right order (with the right lock rank checking implementation) as rank information is fully statically known. This refactoring even more exposes the fact that Mutex has no lock rank capabilites, which is not fixed here.
Diffstat (limited to 'Kernel/Arch/x86_64/ISABus')
-rw-r--r--Kernel/Arch/x86_64/ISABus/I8042Controller.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Arch/x86_64/ISABus/I8042Controller.h b/Kernel/Arch/x86_64/ISABus/I8042Controller.h
index 997cf4517d..e62b5517a3 100644
--- a/Kernel/Arch/x86_64/ISABus/I8042Controller.h
+++ b/Kernel/Arch/x86_64/ISABus/I8042Controller.h
@@ -153,7 +153,7 @@ private:
void do_write(u8 port, u8 data);
u8 do_read(u8 port);
- Spinlock m_lock { LockRank::None };
+ Spinlock<LockRank::None> m_lock {};
bool m_first_port_available { false };
bool m_second_port_available { false };
bool m_is_dual_channel { false };