MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / ide_cmd_write

Function ide_cmd_write

tinyemu/ide.c:682–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682static void ide_cmd_write(void *opaque, uint32_t offset,
683 uint32_t val, int size_log2)
684{
685 IDEIFState *s1 = opaque;
686 IDEState *s;
687 int i;
688
689#ifdef DEBUG_IDE
690 printf("ide: cmd write=0x%02x\n", val);
691#endif
692 if (!(s1->cmd & IDE_CMD_RESET) && (val & IDE_CMD_RESET)) {
693 /* low to high */
694 for(i = 0; i < 2; i++) {
695 s = s1->drives[i];
696 if (s) {
697 s->status = BUSY_STAT | SEEK_STAT;
698 s->error = 0x01;
699 }
700 }
701 } else if ((s1->cmd & IDE_CMD_RESET) && !(val & IDE_CMD_RESET)) {
702 /* high to low */
703 for(i = 0; i < 2; i++) {
704 s = s1->drives[i];
705 if (s) {
706 s->status = READY_STAT | SEEK_STAT;
707 ide_set_signature(s);
708 }
709 }
710 }
711 s1->cmd = val;
712}
713
714static void ide_data_writew(void *opaque, uint32_t offset,
715 uint32_t val, int size_log2)

Callers

nothing calls this directly

Calls 1

ide_set_signatureFunction · 0.85

Tested by

no test coverage detected