require '_h2ph_pre.ph';

unless(defined(&LINUX_ISAPNP_H)) {
    eval 'sub LINUX_ISAPNP_H () {1;}' unless defined(&LINUX_ISAPNP_H);
    require 'linux/config.ph';
    require 'linux/errno.ph';
    eval 'sub ISAPNP_CFG_ACTIVATE () {0x30;}' unless defined(&ISAPNP_CFG_ACTIVATE);
    eval 'sub ISAPNP_CFG_MEM () {0x40;}' unless defined(&ISAPNP_CFG_MEM);
    eval 'sub ISAPNP_CFG_PORT () {0x60;}' unless defined(&ISAPNP_CFG_PORT);
    eval 'sub ISAPNP_CFG_IRQ () {0x70;}' unless defined(&ISAPNP_CFG_IRQ);
    eval 'sub ISAPNP_CFG_DMA () {0x74;}' unless defined(&ISAPNP_CFG_DMA);
    eval 'sub ISAPNP_VENDOR {
        local($a,$b,$c) = @_;
	    eval q(((((($a)-ord(\'A\'+1)&0x3f)<<2)|				((((b)-\'A\'+1)&0x18)>>3)|((((b)-\'A\'+1)&7)<<13)|				((((c)-\'A\')+1)&0x1f)<<8)));
    }' unless defined(&ISAPNP_VENDOR);
    eval 'sub ISAPNP_DEVICE {
        local($x) = @_;
	    eval q((((($x)&0xf000)>>8)| ((($x)&0xf00)>>8)| ((($x)&0xf0)<<8)| ((($x)&0xf)<<8)));
    }' unless defined(&ISAPNP_DEVICE);
    eval 'sub ISAPNP_FUNCTION {
        local($x) = @_;
	    eval q( &ISAPNP_DEVICE($x));
    }' unless defined(&ISAPNP_FUNCTION);
}
1;
