1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 23:37:43 +00:00

Kernel: Use Processor::wait_check in loops waiting for HW to respond

This gives the processor the hint that it is in a hot loop and allows us
to do other work in between
This commit is contained in:
Hendiadyoin1 2023-09-12 14:58:55 +02:00 committed by Andrew Kaster
parent cbaa3465a8
commit a2810d3cf8
9 changed files with 31 additions and 36 deletions

View file

@ -66,7 +66,7 @@ ErrorOr<size_t> SerialDevice::write(OpenFileDescription& description, u64, UserO
void SerialDevice::put_char(char ch)
{
while ((get_line_status() & EmptyTransmitterHoldingRegister) == 0)
;
Processor::wait_check();
if (ch == '\n' && !m_last_put_char_was_carriage_return)
m_registers_io_window->write8(0, '\r');