mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +00:00
Kernel: Process request to change virtual console from the IO Work queue
Instead of processing the input after receiving an IRQ, we shift the responsibility to the io work queue to handle this for us, so if a page fault occurs when trying to switch the VirtualConsole, the kernel can handle that.
This commit is contained in:
parent
9dd3203cc6
commit
38ccdb02ce
1 changed files with 4 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <Kernel/Devices/HID/PS2KeyboardDevice.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/TTY/ConsoleManagement.h>
|
||||
#include <Kernel/WorkQueue.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -70,7 +71,9 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte)
|
|||
if (m_modifiers & Mod_Alt) {
|
||||
switch (ch) {
|
||||
case 0x02 ... 0x07: // 1 to 6
|
||||
ConsoleManagement::the().switch_to(ch - 0x02);
|
||||
g_io_work->queue([this, ch]() {
|
||||
ConsoleManagement::the().switch_to(ch - 0x02);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
key_state_changed(ch, pressed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue