MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / stopCMD

Function stopCMD

Kernel/include/ahci.h:397–412  ·  view source on GitHub ↗

Stop command engine

Source from the content-addressed store, hash-verified

395
396 // Stop command engine
397 inline void stopCMD(hba_port_t *port)
398 {
399 // Clear ST (bit0)
400 port->cmd &= ~HBA_PxCMD_ST;
401
402 // Wait until FR (bit14), CR (bit15) are cleared
403 while(1)
404 {
405 if (port->cmd & HBA_PxCMD_CR)
406 continue;
407 break;
408 }
409
410 // Clear FRE (bit4)
411 port->cmd &= ~HBA_PxCMD_FRE;
412 }
413}

Callers 3

PortMethod · 0.85
AccessMethod · 0.85
IdentifyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected