Jelajahi Sumber

Kernel: Bit mask line control options in SerialDevice::set_line_control

The line control option bits (parity, stop bits, word length) were
masked and then combined incorrectly, resulting in them not being set
when requested.
Idan Horowitz 4 tahun lalu
induk
melakukan
c75ca4ea8f
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      Kernel/Devices/SerialDevice.cpp

+ 1 - 1
Kernel/Devices/SerialDevice.cpp

@@ -105,7 +105,7 @@ void SerialDevice::set_line_control(ParitySelect parity_select, StopBits stop_bi
     m_stop_bits = stop_bits;
     m_stop_bits = stop_bits;
     m_word_length = word_length;
     m_word_length = word_length;
 
 
-    IO::out8(m_base_addr + 3, IO::in8(m_base_addr + 3) & (0xc0 | parity_select | stop_bits | word_length));
+    IO::out8(m_base_addr + 3, (IO::in8(m_base_addr + 3) & ~0x3f) | parity_select | stop_bits | word_length);
 }
 }
 
 
 void SerialDevice::set_break_enable(bool break_enable)
 void SerialDevice::set_break_enable(bool break_enable)