mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-18 17:39:17 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/38ccdb02ce0 Pull-request: https://github.com/SerenityOS/serenity/pull/7258 Issue: https://github.com/SerenityOS/serenity/issues/7241 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/tomuta
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…
Reference in a new issue