X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/489fcbc119f6ae46efc8f4077cbb5aa43683e404..af8e873ae38b72a56a89485c62bb5ccd22a9f8a7:/lunaix-os/hal/ahci/ata.c diff --git a/lunaix-os/hal/ahci/ata.c b/lunaix-os/hal/ahci/ata.c index a2f10ba..a77e03b 100644 --- a/lunaix-os/hal/ahci/ata.c +++ b/lunaix-os/hal/ahci/ata.c @@ -5,6 +5,14 @@ #include #include +void +sata_read_error(struct hba_port* port) +{ + uint32_t tfd = port->regs[HBA_RPxTFD]; + port->device->last_error = (tfd >> 8) & 0xff; + port->device->last_status = tfd & 0xff; +} + int __sata_buffer_io(struct hba_device* dev, uint64_t lba, @@ -28,7 +36,7 @@ __sata_buffer_io(struct hba_device* dev, header->options |= HBA_CMDH_WRITE * (write == 1); uint16_t count = ICEIL(size, port->device->block_size); - struct sata_reg_fis* fis = table->command_fis; + struct sata_reg_fis* fis = (struct sata_reg_fis*)table->command_fis; if ((port->device->flags & HBA_DEV_FEXTLBA)) { // 如果该设备支持48位LBA寻址 @@ -87,11 +95,3 @@ sata_write_buffer(struct hba_device* dev, { return __sata_buffer_io(dev, lba, buffer, size, 1); } - -void -sata_read_error(struct hba_port* port) -{ - uint32_t tfd = port->regs[HBA_RPxTFD]; - port->device->last_error = (tfd >> 8) & 0xff; - port->device->last_status = tfd & 0xff; -} \ No newline at end of file