require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_PCI_PCIIDE_HPT_REG_H_)) {
    eval 'sub _DEV_PCI_PCIIDE_HPT_REG_H_ () {1;}' unless defined(&_DEV_PCI_PCIIDE_HPT_REG_H_);
    eval 'sub HPT366_REV () {0x1;}' unless defined(&HPT366_REV);
    eval 'sub HPT370_REV () {0x3;}' unless defined(&HPT370_REV);
    eval 'sub HPT370A_REV () {0x4;}' unless defined(&HPT370A_REV);
    eval 'sub HPT372_REV () {0x5;}' unless defined(&HPT372_REV);
    eval 'sub HPT374_REV () {0x7;}' unless defined(&HPT374_REV);
    eval 'sub HPT_IDETIM {
        my($chan, $drive) = @_;
	    eval q((0x40 + (($drive) * 4) + (($chan) * 8)));
    }' unless defined(&HPT_IDETIM);
    eval 'sub HPT_IDETIM_BUFEN () {0x80000000;}' unless defined(&HPT_IDETIM_BUFEN);
    eval 'sub HPT_IDETIM_MSTEN () {0x40000000;}' unless defined(&HPT_IDETIM_MSTEN);
    eval 'sub HPT_IDETIM_DMAEN () {0x20000000;}' unless defined(&HPT_IDETIM_DMAEN);
    eval 'sub HPT_IDETIM_UDMAEN () {0x10000000;}' unless defined(&HPT_IDETIM_UDMAEN);
    eval 'sub HPT366_CTRL1 () {0x50;}' unless defined(&HPT366_CTRL1);
    eval 'sub HPT366_CTRL1_BLKDIS {
        my($chan) = @_;
	    eval q((0x40 << ($chan)));
    }' unless defined(&HPT366_CTRL1_BLKDIS);
    eval 'sub HPT366_CTRL1_CHANEN {
        my($chan) = @_;
	    eval q((0x10 << ($chan)));
    }' unless defined(&HPT366_CTRL1_CHANEN);
    eval 'sub HPT366_CTRL1_CLRBUF {
        my($chan) = @_;
	    eval q((0x4 << ($chan)));
    }' unless defined(&HPT366_CTRL1_CLRBUF);
    eval 'sub HPT366_CTRL1_LEG {
        my($chan) = @_;
	    eval q((0x1 << ($chan)));
    }' unless defined(&HPT366_CTRL1_LEG);
    eval 'sub HPT366_CTRL2 () {0x51;}' unless defined(&HPT366_CTRL2);
    eval 'sub HPT366_CTRL2_FASTIRQ () {0x80;}' unless defined(&HPT366_CTRL2_FASTIRQ);
    eval 'sub HPT366_CTRL2_HOLDIRQ {
        my($chan) = @_;
	    eval q((0x20 << ($chan)));
    }' unless defined(&HPT366_CTRL2_HOLDIRQ);
    eval 'sub HPT366_CTRL2_SGEN () {0x10;}' unless defined(&HPT366_CTRL2_SGEN);
    eval 'sub HPT366_CTRL2_CLEARFIFO {
        my($chan) = @_;
	    eval q((0x4 << ($chan)));
    }' unless defined(&HPT366_CTRL2_CLEARFIFO);
    eval 'sub HPT366_CTRL2_CLEARBMSM () {0x2;}' unless defined(&HPT366_CTRL2_CLEARBMSM);
    eval 'sub HPT366_CTRL2_CLEARSG () {0x1;}' unless defined(&HPT366_CTRL2_CLEARSG);
    eval 'sub HPT366_CTRL3 {
        my($chan) = @_;
	    eval q((0x52 + (($chan) * 4)));
    }' unless defined(&HPT366_CTRL3);
    eval 'sub HPT366_CTRL3_PDMA () {0x8000;}' unless defined(&HPT366_CTRL3_PDMA);
    eval 'sub HPT366_CTRL3_BP () {0x4000;}' unless defined(&HPT366_CTRL3_BP);
    eval 'sub HPT366_CTRL3_FASTIRQ_OFFSET () {9;}' unless defined(&HPT366_CTRL3_FASTIRQ_OFFSET);
    eval 'sub HPT366_CTRL3_FASTIRQ_MASK () {0x3;}' unless defined(&HPT366_CTRL3_FASTIRQ_MASK);
    eval 'sub HPT370_CTRL1 {
        my($chan) = @_;
	    eval q((0x50 + (($chan) * 4)));
    }' unless defined(&HPT370_CTRL1);
    eval 'sub HPT370_CTRL1_CLRSG () {0x80;}' unless defined(&HPT370_CTRL1_CLRSG);
    eval 'sub HPT370_CTRL1_READF () {0x40;}' unless defined(&HPT370_CTRL1_READF);
    eval 'sub HPT370_CTRL1_CLRST () {0x20;}' unless defined(&HPT370_CTRL1_CLRST);
    eval 'sub HPT370_CTRL1_CLRSGC () {0x10;}' unless defined(&HPT370_CTRL1_CLRSGC);
    eval 'sub HPT370_CTRL1_BLKDIS () {0x8;}' unless defined(&HPT370_CTRL1_BLKDIS);
    eval 'sub HPT370_CTRL1_EN () {0x4;}' unless defined(&HPT370_CTRL1_EN);
    eval 'sub HPT370_CTRL1_CLRDBUF () {0x2;}' unless defined(&HPT370_CTRL1_CLRDBUF);
    eval 'sub HPT370_CTRL1_LEGEN () {0x1;}' unless defined(&HPT370_CTRL1_LEGEN);
    eval 'sub HPT370_CTRL2 {
        my($chan) = @_;
	    eval q((0x51 + (($chan) * 4)));
    }' unless defined(&HPT370_CTRL2);
    eval 'sub HPT370_CTRL2_FASTIRQ () {0x2;}' unless defined(&HPT370_CTRL2_FASTIRQ);
    eval 'sub HPT370_CTRL2_HIRQ () {0x1;}' unless defined(&HPT370_CTRL2_HIRQ);
    eval 'sub HPT370_CTRL3 {
        my($chan) = @_;
	    eval q((0x52 + (($chan) * 4)));
    }' unless defined(&HPT370_CTRL3);
    eval 'sub HPT370_CTRL3_HIZ () {0x8000;}' unless defined(&HPT370_CTRL3_HIZ);
    eval 'sub HPT370_CTRL3_BP () {0x4000;}' unless defined(&HPT370_CTRL3_BP);
    eval 'sub HPT370_CTRL3_FASTIRQ_OFFSET () {9;}' unless defined(&HPT370_CTRL3_FASTIRQ_OFFSET);
    eval 'sub HPT370_CTRL3_FASTIRQ_MASK () {0x3;}' unless defined(&HPT370_CTRL3_FASTIRQ_MASK);
    eval 'sub HPT_STAT1 () {0x58;}' unless defined(&HPT_STAT1);
    eval 'sub HPT_STAT1_IRQPOLL {
        my($chan) = @_;
	    eval q((0x40 << ($chan)));
    }' unless defined(&HPT_STAT1_IRQPOLL);
    eval 'sub HPT_STAT1_DMARQ {
        my($chan) = @_;
	    eval q((0x4 << (($chan) * 3)));
    }' unless defined(&HPT_STAT1_DMARQ);
    eval 'sub HPT_STAT1_DMACK {
        my($chan) = @_;
	    eval q((0x2 << (($chan) * 3)));
    }' unless defined(&HPT_STAT1_DMACK);
    eval 'sub HPT_STAT1_IORDY {
        my($chan) = @_;
	    eval q((0x1 << (($chan) * 3)));
    }' unless defined(&HPT_STAT1_IORDY);
    eval 'sub HPT_STAT2 () {0x59;}' unless defined(&HPT_STAT2);
    eval 'sub HPT_STAT2_FLT_RST () {0x40;}' unless defined(&HPT_STAT2_FLT_RST);
    eval 'sub HPT_STAT2_RST {
        my($chan) = @_;
	    eval q((0x40 << ($chan)));
    }' unless defined(&HPT_STAT2_RST);
    eval 'sub HPT_STAT2_POLLEN {
        my($chan) = @_;
	    eval q((0x4 << (($chan) * 3)));
    }' unless defined(&HPT_STAT2_POLLEN);
    eval 'sub HPT_STAT2_IRQD1 {
        my($chan) = @_;
	    eval q((0x2 << (($chan) * 3)));
    }' unless defined(&HPT_STAT2_IRQD1);
    eval 'sub HPT_STAT2_IRQD0_CH1 () {0x8;}' unless defined(&HPT_STAT2_IRQD0_CH1);
    eval 'sub HPT_STAT2_POLLST () {0x1;}' unless defined(&HPT_STAT2_POLLST);
    eval 'sub HPT_CSEL () {0x5a;}' unless defined(&HPT_CSEL);
    eval 'sub HPT_CSEL_IRQDIS () {0x10;}' unless defined(&HPT_CSEL_IRQDIS);
    eval 'sub HPT_CSEL_PCIDIS () {0x8;}' unless defined(&HPT_CSEL_PCIDIS);
    eval 'sub HPT_CSEL_PCIWR () {0x4;}' unless defined(&HPT_CSEL_PCIWR);
    eval 'sub HPT_CSEL_CBLID {
        my($chan) = @_;
	    eval q((0x1 << (1- ($chan))));
    }' unless defined(&HPT_CSEL_CBLID);
    eval 'sub HPT_SC2 () {0x5b;}' unless defined(&HPT_SC2);
    eval 'sub HPT_SC2_OSC_OK () {0x80;}' unless defined(&HPT_SC2_OSC_OK);
    eval 'sub HPT_SC2_OSC_EN () {0x20;}' unless defined(&HPT_SC2_OSC_EN);
    eval 'sub HPT_SC2_ECLK () {0x10;}' unless defined(&HPT_SC2_ECLK);
    eval 'sub HPT_SC2_BPIO () {0x8;}' unless defined(&HPT_SC2_BPIO);
    eval 'sub HPT_SC2_DMARQW () {0x4;}' unless defined(&HPT_SC2_DMARQW);
    eval 'sub HPT_SC2_SCLK () {0x2;}' unless defined(&HPT_SC2_SCLK);
    eval 'sub HPT_SC2_MAEN () {0x1;}' unless defined(&HPT_SC2_MAEN);
}
1;
