Driver IO Busywait Kernel Driver Question
I have a driver that does the following:
// Kind of like a serial driver with no interrupt
for (c in buff){
write_to_reg(c);
while(statusreg & BUSY_MASK); // busy wait for operation to complete
}
Naturally, this causes a lot of busy waiting, and the CPU usage goes up. Is there a good way to reduce the CPU usage in this circumstance?
Thanks!
|