require '_h2ph_pre.ph';

unless(defined(&_MACHINE_MPTR_H_)) {
    eval 'sub _MACHINE_MPTR_H_ () {1;}' unless defined(&_MACHINE_MPTR_H_);
    if(defined(&_KERNEL)) {
	require 'amiga/amiga/custom.ph';
	if(defined(&DRACO)) {
	    require 'amiga/amiga/drcustom.ph';
	}
	eval 'sub SIR_NET () {0x1;}' unless defined(&SIR_NET);
	eval 'sub SIR_CLOCK () {0x2;}' unless defined(&SIR_CLOCK);
	eval 'sub SIR_CBACK () {0x4;}' unless defined(&SIR_CBACK);
	eval 'sub siroff {
	    local($x) = @_;
    	    eval q( &ssir &= ~($x));
	}' unless defined(&siroff);
	if(defined(&DRACO)) {
	    eval 'sub setsoftint () {
	        eval q(( &is_draco()? (* &draco_intfrc |=  &DRIRQ_SOFT) : ( ($custom->{intreq}) =  &INTF_SETCLR| &INTF_SOFTINT)));
	    }' unless defined(&setsoftint);
	    eval 'sub clrsoftint () {
	        eval q(( &is_draco()? (* &draco_intfrc &= ~ &DRIRQ_SOFT) : ( ($custom->{intreq}) =  &INTF_SOFTINT)));
	    }' unless defined(&clrsoftint);
	} else {
	    eval 'sub setsoftint () {
	        eval q(( ($custom->{intreq}) =  &INTF_SETCLR| &INTF_SOFTINT));
	    }' unless defined(&setsoftint);
	    eval 'sub clrsoftint () {
	        eval q(( ($custom->{intreq}) =  &INTF_SOFTINT));
	    }' unless defined(&clrsoftint);
	}
	eval 'sub setsoftnet () {
	    eval q(( &ssir |=  &SIR_NET,  &setsoftint()));
	}' unless defined(&setsoftnet);
	eval 'sub setsoftclock () {
	    eval q(( &ssir |=  &SIR_CLOCK,  &setsoftint()));
	}' unless defined(&setsoftclock);
	eval 'sub setsoftcback () {
	    eval q(( &ssir |=  &SIR_CBACK,  &setsoftint()));
	}' unless defined(&setsoftcback);
    }
}
1;
