SSUOS_P6/src/kernel/device/ata.c
/* Low-level ATA primitives. */
Low-level ATA primitives.
Low - level ATA primitives .
static bool 
delay_ata_for(struct ata_device *device, int what_for)
{
	int i;
	for(i = 0; i < 5000; i++)
	{
		if(what_for == ATA_WAIT_IDLE && 
				(inb (ATA_REG_STATUS (device->port_addr)) & (ATA_SR_BSY | ATA_SR_DRQ)) == 0)
			return true;
		else if(what_for == ATA_WAIT_BUSY && !(inb (ATA_DEV_CTRL_REG (device->port_addr)) & ATA_SR_BSY))
			return (inb (ATA_DEV_CTRL_REG (device->port_addr)) & ATA_SR_DRQ) != 0;
	}
	return false;
}
static bool delay_ata_for ( struct ata_device * device , int what_for ) { int i ; for ( i = 0 ; i < 5000 ; i ++ ) { if ( what_for == ATA_WAIT_IDLE && ( inb ( ATA_REG_STATUS ( device -> port_addr ) ) & ( ATA_SR_BSY | ATA_SR_DRQ ) ) == 0 ) return true ; else if ( what_for == ATA_WAIT_BUSY && ! ( inb ( ATA_DEV_CTRL_REG ( device -> port_addr ) ) & ATA_SR_BSY ) ) return ( inb ( ATA_DEV_CTRL_REG ( device -> port_addr ) ) & ATA_SR_DRQ ) != 0 ; } return false ; }
Low-level ATA primitives.
Low - level ATA primitives .