require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DEV_IC_I8259REG_H_)) {
    eval 'sub _DEV_IC_I8259REG_H_ () {1;}' unless defined(&_DEV_IC_I8259REG_H_);
    eval 'sub PIC_ICW1 () {0x;}' unless defined(&PIC_ICW1);
    eval 'sub ICW1_IC4 () {(1 << 0);}' unless defined(&ICW1_IC4);
    eval 'sub ICW1_SNGL () {(1 << 1);}' unless defined(&ICW1_SNGL);
    eval 'sub ICW1_ADI () {(1 << 2);}' unless defined(&ICW1_ADI);
    eval 'sub ICW1_LTIM () {(1 << 3);}' unless defined(&ICW1_LTIM);
    eval 'sub ICW1_SELECT () {(1 << 4);}' unless defined(&ICW1_SELECT);
    eval 'sub ICW1_IVA {
        my($x) = @_;
	    eval q((($x) << 5));
    }' unless defined(&ICW1_IVA);
    eval 'sub PIC_ICW2 () {0x1;}' unless defined(&PIC_ICW2);
    eval 'sub ICW2_VECTOR {
        my($x) = @_;
	    eval q((($x) & 0xf8));
    }' unless defined(&ICW2_VECTOR);
    eval 'sub ICW2_IRL {
        my($x) = @_;
	    eval q((($x) << 0));
    }' unless defined(&ICW2_IRL);
    eval 'sub PIC_ICW3 () {0x1;}' unless defined(&PIC_ICW3);
    eval 'sub ICW3_CASCADE {
        my($x) = @_;
	    eval q((1 << ($x)));
    }' unless defined(&ICW3_CASCADE);
    eval 'sub ICW3_SIC {
        my($x) = @_;
	    eval q((($x) << 0));
    }' unless defined(&ICW3_SIC);
    eval 'sub PIC_ICW4 () {0x1;}' unless defined(&PIC_ICW4);
    eval 'sub ICW4_8086 () {(1 << 0);}' unless defined(&ICW4_8086);
    eval 'sub ICW4_AEOI () {(1 << 1);}' unless defined(&ICW4_AEOI);
    eval 'sub ICW4_BUFM () {(1 << 2);}' unless defined(&ICW4_BUFM);
    eval 'sub ICW4_BUF () {(1 << 3);}' unless defined(&ICW4_BUF);
    eval 'sub ICW4_SFNM () {(1 << 4);}' unless defined(&ICW4_SFNM);
    eval 'sub PIC_OCW1 () {0x1;}' unless defined(&PIC_OCW1);
    eval 'sub OCW1_IRM {
        my($x) = @_;
	    eval q((1 << ($x)));
    }' unless defined(&OCW1_IRM);
    eval 'sub PIC_OCW2 () {0x;}' unless defined(&PIC_OCW2);
    eval 'sub OCW2_SELECT () {(0);}' unless defined(&OCW2_SELECT);
    eval 'sub OCW2_EOI () {(1 << 5);}' unless defined(&OCW2_EOI);
    eval 'sub OCW2_SL () {(1 << 6);}' unless defined(&OCW2_SL);
    eval 'sub OCW2_R () {(1 << 7);}' unless defined(&OCW2_R);
    eval 'sub OCW2_ILS {
        my($x) = @_;
	    eval q((($x) << 0));
    }' unless defined(&OCW2_ILS);
    eval 'sub PIC_OCW3 () {0x;}' unless defined(&PIC_OCW3);
    eval 'sub OCW3_SSMM () {(1 << 6);}' unless defined(&OCW3_SSMM);
    eval 'sub OCW3_SMM () {(1 << 5);}' unless defined(&OCW3_SMM);
    eval 'sub OCW3_SELECT () {(1 << 3);}' unless defined(&OCW3_SELECT);
    eval 'sub OCW3_POLL () {(1 << 2);}' unless defined(&OCW3_POLL);
    eval 'sub OCW3_RR () {(1 << 1);}' unless defined(&OCW3_RR);
    eval 'sub OCW3_RIS () {(1 << 0);}' unless defined(&OCW3_RIS);
    eval 'sub OCW3_POLL_IRQ {
        my($x) = @_;
	    eval q((($x) & 0x7f));
    }' unless defined(&OCW3_POLL_IRQ);
    eval 'sub OCW3_POLL_PENDING () {(1 << 7);}' unless defined(&OCW3_POLL_PENDING);
}
1;
