mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
Kernel/Graphics: Move x86-specific support for VGA to Arch/x86 directory
The new VGAIOArbiter class is now responsible to conduct x86-specific instructions to control VGA hardware from the old ISA ports. This allows us to ensure the GraphicsManagement code doesn't use x86-specific code, thus allowing it to be compiled within non-x86 kernel builds.
This commit is contained in:
parent
8b9c056c5a
commit
48f3d762af
5 changed files with 154 additions and 30 deletions
40
Kernel/Arch/x86/VGA/IOArbiter.h
Normal file
40
Kernel/Arch/x86/VGA/IOArbiter.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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/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 m_main_vga_lock { LockRank::None };
|
||||
bool m_vga_access_is_disabled { false };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue