| 1549 | } |
| 1550 | |
| 1551 | static inline bool |
| 1552 | its_cmd_queue_full(struct gicv3_its_softc *sc) |
| 1553 | { |
| 1554 | size_t read_idx, next_write_idx; |
| 1555 | |
| 1556 | /* Get the index of the next command */ |
| 1557 | next_write_idx = (sc->sc_its_cmd_next_idx + 1) % |
| 1558 | (ITS_CMDQ_SIZE / sizeof(struct its_cmd)); |
| 1559 | /* And the index of the current command being read */ |
| 1560 | read_idx = gic_its_read_4(sc, GITS_CREADR) / sizeof(struct its_cmd); |
| 1561 | |
| 1562 | /* |
| 1563 | * The queue is full when the write offset points |
| 1564 | * at the command before the current read offset. |
| 1565 | */ |
| 1566 | return (next_write_idx == read_idx); |
| 1567 | } |
| 1568 | |
| 1569 | static inline void |
| 1570 | its_cmd_sync(struct gicv3_its_softc *sc, struct its_cmd *cmd) |
no outgoing calls
no test coverage detected