1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 09:27:46 +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

@ -114,7 +114,7 @@ ErrorOr<size_t> MiniUART::write(Kernel::OpenFileDescription& description, u64, K
void MiniUART::put_char(u8 ch)
{
while ((m_registers->line_status & TransmitterEmpty) == 0)
;
Processor::wait_check();
if (ch == '\n' && !m_last_put_char_was_carriage_return)
m_registers->io_data = '\r';