1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

Kernel: Make all Spinlocks use u8 for storage, remove template

The default template argument is only used in one place, and it
looks like it was probably just an oversight. The rest of the Kernel
code all uses u8 as the type. So lets make that the default and remove
the unused template argument, as there doesn't seem to be a reason to
allow the size to be customizable.
This commit is contained in:
Brian Gianforcaro 2021-09-05 10:02:03 -07:00 committed by Andreas Kling
parent 5905d2e9e9
commit bb58a4d943
38 changed files with 56 additions and 58 deletions

View file

@ -60,7 +60,7 @@ private:
Memory::TypedMapping<BochsDisplayMMIORegisters volatile> m_registers;
RefPtr<FramebufferDevice> m_framebuffer_device;
RefPtr<Graphics::GenericFramebufferConsole> m_framebuffer_console;
Spinlock<u8> m_console_mode_switch_lock;
Spinlock m_console_mode_switch_lock;
bool m_console_enabled { false };
bool m_io_required { false };
};

View file

@ -47,6 +47,6 @@ protected:
virtual u8* framebuffer_data() = 0;
void clear_glyph(size_t x, size_t y);
size_t m_pitch;
mutable Spinlock<u8> m_lock;
mutable Spinlock m_lock;
};
}

View file

@ -39,7 +39,7 @@ private:
explicit TextModeConsole(const VGACompatibleAdapter&);
mutable Spinlock<u8> m_vga_lock;
mutable Spinlock m_vga_lock;
u16 m_vga_start_row { 0 };
u16 m_current_vga_start_address { 0 };
u8* m_current_vga_window { nullptr };

View file

@ -53,7 +53,7 @@ private:
size_t m_framebuffer_width { 0 };
size_t m_framebuffer_height { 0 };
Spinlock<u8> m_activation_lock;
Spinlock m_activation_lock;
RefPtr<Memory::AnonymousVMObject> m_real_framebuffer_vmobject;
RefPtr<Memory::AnonymousVMObject> m_swapped_framebuffer_vmobject;

View file

@ -40,7 +40,7 @@ public:
bool framebuffer_devices_allowed() const { return m_framebuffer_devices_allowed; }
bool framebuffer_devices_exist() const;
Spinlock<u8>& main_vga_lock() { return m_main_vga_lock; }
Spinlock& main_vga_lock() { return m_main_vga_lock; }
RefPtr<Graphics::Console> console() const { return m_console; }
void deactivate_graphical_mode();
@ -56,7 +56,7 @@ private:
unsigned m_current_minor_number { 0 };
const bool m_framebuffer_devices_allowed;
Spinlock<u8> m_main_vga_lock;
Spinlock m_main_vga_lock;
};
}

View file

@ -161,9 +161,9 @@ private:
Optional<PLLSettings> create_pll_settings(u64 target_frequency, u64 reference_clock, const PLLMaxSettings&);
Spinlock<u8> m_control_lock;
Spinlock<u8> m_modeset_lock;
mutable Spinlock<u8> m_registers_lock;
Spinlock m_control_lock;
Spinlock m_modeset_lock;
mutable Spinlock m_registers_lock;
Graphics::VideoInfoBlock m_crt_edid;
const PhysicalAddress m_registers;