MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bcm_sdhost_waitcommand

Function bcm_sdhost_waitcommand

freebsd/arm/broadcom/bcm2835/bcm2835_sdhost.c:508–520  ·  view source on GitHub ↗

* rv 0 --> command finished * rv 1 --> command timed out */

Source from the content-addressed store, hash-verified

506 * rv 1 --> command timed out
507 */
508static inline int
509bcm_sdhost_waitcommand(struct bcm_sdhost_softc *sc)
510{
511 int timeout = 1000;
512
513 mtx_assert(&sc->mtx, MA_OWNED);
514
515 while ((RD4(sc, HC_COMMAND) & HC_CMD_ENABLE) && --timeout > 0) {
516 DELAY(100);
517 }
518
519 return ((timeout > 0) ? 0 : 1);
520}
521
522static int
523bcm_sdhost_waitcommand_status(struct bcm_sdhost_softc *sc)

Callers 3

bcm_sdhost_intrFunction · 0.85
bcm_sdhost_commandFunction · 0.85

Calls 3

mtx_assertFunction · 0.85
RD4Function · 0.70
DELAYFunction · 0.50

Tested by

no test coverage detected