MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / poll

Method poll

src/fs/ata.rs:258–272  ·  view source on GitHub ↗

POLL

(&mut self, bit: Status, val: bool)

Source from the content-addressed store, hash-verified

256
257 // POLL
258 fn poll(&mut self, bit: Status, val: bool) -> Result<(), ()>
259 {
260 let start = crate::clock::uptime();
261 while self.status().get_bit(bit as usize) != val
262 {
263 if crate::clock::uptime() - start > 1.0
264 {
265 serprintln!("[INFO] ATA HUNG DURING POLLING OF {:?} BIT OF STATUS_REG", bit);
266 self.debug();
267 return Err(());
268 }
269 spin_loop();
270 }
271 Ok(())
272 }
273
274
275 // READ

Callers 2

driveselMethod · 0.45
writecmdMethod · 0.45

Calls 4

statusMethod · 0.80
debugMethod · 0.80
uptimeFunction · 0.50
ErrEnum · 0.50

Tested by

no test coverage detected