summaryrefslogtreecommitdiff
path: root/Kernel/Devices/SerialDevice.h
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-23 17:25:07 +0300
committerAndreas Kling <kling@serenityos.org>2021-05-17 18:15:25 +0200
commit0e5aba16efa4bb2474974f07aba2e7874fc0ca09 (patch)
tree4ab79e24964114c98e97579fb7a8c54ecc7c218c /Kernel/Devices/SerialDevice.h
parent3ad0a0d8c33b7cbe569533e6ffe73fa7f324347c (diff)
downloadserenity-0e5aba16efa4bb2474974f07aba2e7874fc0ca09.zip
Kernel: Use unsigned instead of signed types in SerialDevice
Addresses are unsigned by definition, and the conversion from signed to unsigned and back in SerialDevice looked a bit dubious.
Diffstat (limited to 'Kernel/Devices/SerialDevice.h')
-rw-r--r--Kernel/Devices/SerialDevice.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/Kernel/Devices/SerialDevice.h b/Kernel/Devices/SerialDevice.h
index e4f5167848..7a0205429a 100644
--- a/Kernel/Devices/SerialDevice.h
+++ b/Kernel/Devices/SerialDevice.h
@@ -18,7 +18,7 @@ namespace Kernel {
class SerialDevice final : public CharacterDevice {
AK_MAKE_ETERNAL
public:
- SerialDevice(int base_addr, unsigned minor);
+ SerialDevice(u32 base_addr, unsigned minor);
virtual ~SerialDevice() override;
// ^CharacterDevice
@@ -112,25 +112,23 @@ private:
virtual const char* class_name() const override { return "SerialDevice"; }
void initialize();
- void set_interrupts(char interrupt_enable);
+ void set_interrupts(bool interrupt_enable);
void set_baud(Baud);
- void set_fifo_control(char fifo_control);
+ void set_fifo_control(u8 fifo_control);
void set_line_control(ParitySelect, StopBits, WordLength);
void set_break_enable(bool break_enable);
- void set_modem_control(char modem_control);
- char get_line_status() const;
- bool rx_ready();
- bool tx_ready();
-
- int m_base_addr;
- char m_interrupt_enable;
- char m_fifo_control;
- Baud m_baud;
- ParitySelect m_parity_select;
- StopBits m_stop_bits;
- WordLength m_word_length;
- bool m_break_enable;
- char m_modem_control;
+ void set_modem_control(u8 modem_control);
+ u8 get_line_status() const;
+
+ u32 m_base_addr { 0 };
+ bool m_interrupt_enable { false };
+ u8 m_fifo_control { 0 };
+ Baud m_baud { Baud38400 };
+ ParitySelect m_parity_select { None };
+ StopBits m_stop_bits { One };
+ WordLength m_word_length { EightBits };
+ bool m_break_enable { false };
+ u8 m_modem_control { 0 };
};
}