require '_h2ph_pre.ph';

unless(defined(&ATP850_IDETIME)) {
    sub ATP850_IDETIME {
	local($channel) = @_;
	eval q((0x40 + ($channel) * 4));
    }
}
unless(defined(&ATP860_IDETIME)) {
    sub ATP860_IDETIME () {	0x40;}
}
unless(defined(&ATP850_SETTIME)) {
    sub ATP850_SETTIME {
	local($drive, $act, $rec) = @_;
	eval q(((((($act) & 0xf) << 8) | (($rec) & 0xf)) << (($drive) * 16)));
    }
}
unless(defined(&ATP860_SETTIME)) {
    sub ATP860_SETTIME {
	local($channel, $drive, $act, $rec) = @_;
	eval q(((((($act) & 0xf) << 4) | (($rec) & 0xf)) << (($channel) * 16+ ($drive) * 8)));
    }
}
unless(defined(&ATP860_SETTIME_MASK)) {
    sub ATP860_SETTIME_MASK {
	local($channel) = @_;
	eval q((0xffff << (($channel) * 16)));
    }
}
unless(defined(&ATP850_UDMA)) {
    sub ATP850_UDMA () {	0x54;}
}
unless(defined(&ATP860_UDMA)) {
    sub ATP860_UDMA () {	0x44;}
}
unless(defined(&ATP850_UDMA_MODE)) {
    sub ATP850_UDMA_MODE {
	local($channel, $drive, $x) = @_;
	eval q(((($x) & 0x3) << (($channel) * 4+ ($drive) * 2)));
    }
}
unless(defined(&ATP860_UDMA_MODE)) {
    sub ATP860_UDMA_MODE {
	local($channel, $drive, $x) = @_;
	eval q(((($x) & 0xf) << (($channel) * 8+ ($drive) * 4)));
    }
}
unless(defined(&ATP850_UDMA_MASK)) {
    sub ATP850_UDMA_MASK {
	local($channel) = @_;
	eval q((0xf << (($channel) * 4)));
    }
}
unless(defined(&ATP860_UDMA_MASK)) {
    sub ATP860_UDMA_MASK {
	local($channel) = @_;
	eval q((0xff << (($channel) * 8)));
    }
}
unless(defined(&ATP8x0_CTRL)) {
    sub ATP8x0_CTRL () {	0x48;}
}
unless(defined(&ATP8x0_CTRL_EN)) {
    sub ATP8x0_CTRL_EN {
	local($chan) = @_;
	eval q((0x20000 << ($chan)));
    }
}
unless(defined(&ATP860_CTRL_INT)) {
    sub ATP860_CTRL_INT () {	0x10000;}
}
unless(defined(&ATP860_CTRL_80P)) {
    sub ATP860_CTRL_80P {
	local($chan) = @_;
	eval q((0x100 << ($chan)));
    }
}
1;
