summaryrefslogtreecommitdiff
path: root/Kernel/TTY/TTY.h
diff options
context:
space:
mode:
authorConrad Pankoff <deoxxa@fknsrs.biz>2019-08-12 21:32:28 +1000
committerAndreas Kling <awesomekling@gmail.com>2019-08-12 14:15:24 +0200
commit4b44962e030f6e3abf6bfc82fbf8382884d92504 (patch)
tree95f91b8a15ccc303369a6a935bba687e93288227 /Kernel/TTY/TTY.h
parentce8387d1ed001aae593c934e1119705525b51d85 (diff)
downloadserenity-4b44962e030f6e3abf6bfc82fbf8382884d92504.zip
Kernel: Use a CircularQueue for input rather than a DoubleBuffer
TTY::emit is called from an IRQ handler, and is used to push input data into a buffer for later retrieval. Previously this was using DoubleBuffer, but that class wants to take a lock. Our lock code wants to make sure interrupts are enabled, but they're disabled while an IRQ handler is running. This made the kernel sad, but this CircularQueue cheers it up by avoiding the lock requirement completely.
Diffstat (limited to 'Kernel/TTY/TTY.h')
-rw-r--r--Kernel/TTY/TTY.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/TTY/TTY.h b/Kernel/TTY/TTY.h
index 97fd9900c8..c4a23a1adb 100644
--- a/Kernel/TTY/TTY.h
+++ b/Kernel/TTY/TTY.h
@@ -1,6 +1,7 @@
#pragma once
#include "DoubleBuffer.h"
+#include <AK/CircularQueue.h>
#include <Kernel/Devices/CharacterDevice.h>
#include <Kernel/UnixTypes.h>
@@ -46,7 +47,7 @@ private:
// ^CharacterDevice
virtual bool is_tty() const final override { return true; }
- DoubleBuffer m_buffer;
+ CircularQueue<u8, 16> m_input_buffer;
pid_t m_pgid { 0 };
termios m_termios;
unsigned short m_rows { 0 };