1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:27:34 +00:00

Kernel: Let's say that IO::delay(N) delays for N microseconds

Supposedly that's how much delay you get when doing I/O on port 0x80.
This commit is contained in:
Andreas Kling 2020-05-16 10:39:06 +02:00
parent 85aafe492d
commit 03eb0e5638
3 changed files with 5 additions and 11 deletions

View file

@ -94,12 +94,10 @@ inline void repeated_out16(u16 port, const u16* data, int data_size)
: "d"(port));
}
inline void delay()
inline void delay(size_t microseconds)
{
// ~3 microsecs
for (auto i = 0; i < 32; i++) {
for (size_t i = 0; i < microseconds; ++i)
IO::in8(0x80);
}
}
}