1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:12:08 +00:00

Kernel: Apply changes to use LibBareMetal definitions

This commit is contained in:
Liav A 2020-02-09 16:47:15 +02:00 committed by Andreas Kling
parent 7c507c27bf
commit e559af2008
43 changed files with 84 additions and 892 deletions

View file

@ -25,7 +25,7 @@
*/
#include <Kernel/Devices/SerialDevice.h>
#include <Kernel/IO.h>
#include <LibBareMetal/IO.h>
SerialDevice::SerialDevice(int base_addr, unsigned minor)
: CharacterDevice(4, minor)
@ -95,8 +95,8 @@ void SerialDevice::set_baud(Baud baud)
m_baud = baud;
IO::out8(m_base_addr + 3, IO::in8(m_base_addr + 3) | 0x80); // turn on DLAB
IO::out8(m_base_addr + 0, ((char)(baud)) >> 2); // lower half of divisor
IO::out8(m_base_addr + 1, ((char)(baud)) & 0xff); // upper half of divisor
IO::out8(m_base_addr + 0, ((char)(baud)) >> 2); // lower half of divisor
IO::out8(m_base_addr + 1, ((char)(baud)) & 0xff); // upper half of divisor
IO::out8(m_base_addr + 3, IO::in8(m_base_addr + 3) & 0x7f); // turn off DLAB
}