34 #include <sys/cdefs.h>
67 #define G1_ATA_MASTER 0x00
78 #define G1_ATA_MASTER_ALT 0x90
85 #define G1_ATA_SLAVE 0xB0
94 #define G1_ATA_LBA_MODE 0x40
209 const uint16_t *buf);
376 uint8_t *partition_type);
A simple block device.
Definition: blockdev.h:46
int g1_ata_write_lba_dma(uint64_t sector, size_t count, const uint16_t *buf, int block)
DMA Write disk sectors with Linear Block Addressing (LBA).
uint8_t g1_ata_select_device(uint8_t dev)
Set the active ATA device.
int g1_ata_read_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, uint16_t *buf)
Read one or more disk sectors with Cylinder-Head-Sector addressing.
int g1_dma_in_progress(void)
Is there a G1 DMA in progress currently?
int g1_ata_write_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, const uint16_t *buf)
Write one or more disk sectors with Cylinder-Head-Sector addressing.
int g1_ata_blockdev_for_partition(int partition, int dma, kos_blockdev_t *rv, uint8_t *partition_type)
Get a block device for a given partition on the slave ATA device.
int g1_ata_mutex_unlock(void)
Unlock the G1 ATA mutex.
int g1_ata_flush(void)
Flush the write cache on the attached disk.
Definitions for a simple block device interface.
int g1_ata_mutex_lock(void)
Lock the G1 ATA mutex.
int g1_ata_init(void)
Initialize G1 ATA support.
int g1_ata_read_lba(uint64_t sector, size_t count, uint16_t *buf)
Read one or more disk sectors with Linear Block Addressing (LBA).
void g1_ata_shutdown(void)
Shut down G1 ATA support.
int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, int block)
DMA read disk sectors with Linear Block Addressing (LBA).
int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf)
Write one or more disk sectors with Linear Block Addressing (LBA).