mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +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:
parent
cbaa3465a8
commit
a2810d3cf8
9 changed files with 31 additions and 36 deletions
|
@ -255,15 +255,9 @@ UNMAP_AFTER_INIT u32 E1000ENetworkAdapter::read_eeprom(u8 address)
|
|||
VERIFY(m_has_eeprom);
|
||||
u16 data = 0;
|
||||
u32 tmp = 0;
|
||||
if (m_has_eeprom) {
|
||||
out32(REG_EEPROM, ((u32)address << 2) | 1);
|
||||
while (!((tmp = in32(REG_EEPROM)) & (1 << 1)))
|
||||
;
|
||||
} else {
|
||||
out32(REG_EEPROM, ((u32)address << 2) | 1);
|
||||
while (!((tmp = in32(REG_EEPROM)) & (1 << 1)))
|
||||
;
|
||||
}
|
||||
out32(REG_EEPROM, ((u32)address << 2) | 1);
|
||||
while (!((tmp = in32(REG_EEPROM)) & (1 << 1)))
|
||||
Processor::wait_check();
|
||||
data = (tmp >> 16) & 0xffff;
|
||||
return data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue