require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_PCI_PCIIDE_SIS_REG_H_)) {
    eval 'sub _DEV_PCI_PCIIDE_SIS_REG_H_ () {1;}' unless defined(&_DEV_PCI_PCIIDE_SIS_REG_H_);
    eval 'sub SIS_TIM {
        my($channel) = @_;
	    eval q((0x40 + ($channel * 4)));
    }' unless defined(&SIS_TIM);
    eval 'sub SIS_TIM66_REC_OFF {
        my($drive) = @_;
	    eval q((16* ($drive)));
    }' unless defined(&SIS_TIM66_REC_OFF);
    eval 'sub SIS_TIM66_ACT_OFF {
        my($drive) = @_;
	    eval q((8+ 16* ($drive)));
    }' unless defined(&SIS_TIM66_ACT_OFF);
    eval 'sub SIS_TIM66_UDMA_TIME_OFF {
        my($drive) = @_;
	    eval q((12+ 16* ($drive)));
    }' unless defined(&SIS_TIM66_UDMA_TIME_OFF);
    eval 'sub SIS_TIM100_REC_OFF {
        my($drive) = @_;
	    eval q((16* ($drive)));
    }' unless defined(&SIS_TIM100_REC_OFF);
    eval 'sub SIS_TIM100_ACT_OFF {
        my($drive) = @_;
	    eval q((4+ 16* ($drive)));
    }' unless defined(&SIS_TIM100_ACT_OFF);
    eval 'sub SIS_TIM100_UDMA_TIME_OFF {
        my($drive) = @_;
	    eval q((8+ 16* ($drive)));
    }' unless defined(&SIS_TIM100_UDMA_TIME_OFF);
    eval 'sub SIS_TIM133 {
        my($reg57, $channel, $drive) = @_;
	    eval q((((($reg57) & 0x40) ? 0x70 : 0x40) + (($channel) << 3) + (($drive) << 2)));
    }' unless defined(&SIS_TIM133);
    eval 'sub SIS_CTRL0 () {0x4a;}' unless defined(&SIS_CTRL0);
    eval 'sub SIS_CTRL0_PCIBURST () {0x80;}' unless defined(&SIS_CTRL0_PCIBURST);
    eval 'sub SIS_CTRL0_FAST_PW () {0x20;}' unless defined(&SIS_CTRL0_FAST_PW);
    eval 'sub SIS_CTRL0_BO () {0x8;}' unless defined(&SIS_CTRL0_BO);
    eval 'sub SIS_CTRL0_CHAN0_EN () {0x2;}' unless defined(&SIS_CTRL0_CHAN0_EN);
    eval 'sub SIS_CTRL0_CHAN1_EN () {0x4;}' unless defined(&SIS_CTRL0_CHAN1_EN);
    eval 'sub SIS_CTRL1 () {0x4b;}' unless defined(&SIS_CTRL1);
    eval 'sub SIS_CTRL1_POSTW_EN {
        my($chan, $drv) = @_;
	    eval q((0x10 << (($drv) + 2* ($chan))));
    }' unless defined(&SIS_CTRL1_POSTW_EN);
    eval 'sub SIS_CTRL1_PREFETCH_EN {
        my($chan, $drv) = @_;
	    eval q((0x1 << (($drv) + 2* ($chan))));
    }' unless defined(&SIS_CTRL1_PREFETCH_EN);
    eval 'sub SIS_MISC () {0x52;}' unless defined(&SIS_MISC);
    eval 'sub SIS_MISC_TIM_SEL () {0x8;}' unless defined(&SIS_MISC_TIM_SEL);
    eval 'sub SIS_MISC_GTC () {0x4;}' unless defined(&SIS_MISC_GTC);
    eval 'sub SIS_MISC_FIFO_SIZE () {0x1;}' unless defined(&SIS_MISC_FIFO_SIZE);
    eval 'sub SIS_REG_49 () {0x49;}' unless defined(&SIS_REG_49);
    eval 'sub SIS_REG_50 () {0x50;}' unless defined(&SIS_REG_50);
    eval 'sub SIS_REG_51 () {0x51;}' unless defined(&SIS_REG_51);
    eval 'sub SIS_REG_52 () {0x52;}' unless defined(&SIS_REG_52);
    eval 'sub SIS_REG_53 () {0x53;}' unless defined(&SIS_REG_53);
    eval 'sub SIS_REG_57 () {0x57;}' unless defined(&SIS_REG_57);
    eval 'sub SIS_REG_CBL () {0x48;}' unless defined(&SIS_REG_CBL);
    eval 'sub SIS_REG_CBL_33 {
        my($channel) = @_;
	    eval q((0x10 << ($channel)));
    }' unless defined(&SIS_REG_CBL_33);
    eval 'sub SIS96x_REG_CBL {
        my($channel) = @_;
	    eval q((0x51 + ($channel) * 2));
    }' unless defined(&SIS96x_REG_CBL);
    eval 'sub SIS96x_REG_CBL_33 () {0x80;}' unless defined(&SIS96x_REG_CBL_33);
    eval 'sub SIS_PRODUCT_5518 () {0x5518;}' unless defined(&SIS_PRODUCT_5518);
}
1;
