mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
![Liav A.](/assets/img/avatar_default.png)
We have many places in the kernel code that we have boolean flags that are only set once, and never reset again but are checked multiple times before and after the time they're being set, which matches the purpose of the SetOnce class.
42 lines
1 KiB
C++
42 lines
1 KiB
C++
/*
|
|
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullOwnPtr.h>
|
|
#include <AK/Platform.h>
|
|
#include <AK/SetOnce.h>
|
|
#include <AK/Types.h>
|
|
#include <Kernel/Locking/Spinlock.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class GraphicsManagement;
|
|
class VGAIOArbiter {
|
|
public:
|
|
static NonnullOwnPtr<VGAIOArbiter> must_create(Badge<GraphicsManagement>);
|
|
|
|
void disable_vga_emulation_access_permanently(Badge<GraphicsManagement>);
|
|
void enable_vga_text_mode_console_cursor(Badge<GraphicsManagement>);
|
|
void disable_vga_text_mode_console_cursor(Badge<GraphicsManagement>);
|
|
void set_vga_text_mode_cursor(Badge<GraphicsManagement>, size_t console_width, size_t x, size_t y);
|
|
|
|
void unblank_screen(Badge<GraphicsManagement>);
|
|
|
|
~VGAIOArbiter();
|
|
|
|
private:
|
|
VGAIOArbiter();
|
|
|
|
void disable_vga_text_mode_console_cursor();
|
|
void enable_vga_text_mode_console_cursor();
|
|
|
|
RecursiveSpinlock<LockRank::None> m_main_vga_lock {};
|
|
SetOnce m_vga_access_is_disabled;
|
|
};
|
|
|
|
}
|