require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_MACHINE_INTR_H_)) {
    eval 'sub _MACHINE_INTR_H_ () {1;}' unless defined(&_MACHINE_INTR_H_);
    eval 'sub IMASK_EXTERNAL () {1;}' unless defined(&IMASK_EXTERNAL);
    eval 'sub IPL_BIO () {0;}' unless defined(&IPL_BIO);
    eval 'sub IPL_AUDIO () { &IPL_BIO;}' unless defined(&IPL_AUDIO);
    eval 'sub IPL_NET () {1;}' unless defined(&IPL_NET);
    eval 'sub IPL_TTY () {2;}' unless defined(&IPL_TTY);
    eval 'sub IPL_VM () {3;}' unless defined(&IPL_VM);
    eval 'sub IPL_CLOCK () {4;}' unless defined(&IPL_CLOCK);
    eval 'sub IPL_NONE () {5;}' unless defined(&IPL_NONE);
    eval 'sub IPL_HIGH () {6;}' unless defined(&IPL_HIGH);
    eval 'sub NIPLS () {7;}' unless defined(&NIPLS);
    eval 'sub IST_NONE () {0;}' unless defined(&IST_NONE);
    eval 'sub IST_PULSE () {1;}' unless defined(&IST_PULSE);
    eval 'sub IST_EDGE () {2;}' unless defined(&IST_EDGE);
    eval 'sub IST_LEVEL () {3;}' unless defined(&IST_LEVEL);
    eval 'sub SINT_CLOCK () {31;}' unless defined(&SINT_CLOCK);
    eval 'sub SINT_CLOCKMASK () {(1<<  &SINT_CLOCK);}' unless defined(&SINT_CLOCKMASK);
    eval 'sub SINT_NET () {30;}' unless defined(&SINT_NET);
    eval 'sub SINT_NETMASK () {((1<<  &SINT_NET) |  &SINT_CLOCKMASK);}' unless defined(&SINT_NETMASK);
    eval 'sub SINT_TTY () {29;}' unless defined(&SINT_TTY);
    eval 'sub SINT_TTYMASK () {((1<<  &SINT_TTY) |  &SINT_CLOCKMASK);}' unless defined(&SINT_TTYMASK);
    eval 'sub SINT_ALLMASK () {( &SINT_CLOCKMASK |  &SINT_NETMASK |  &SINT_TTYMASK);}' unless defined(&SINT_ALLMASK);
    eval 'sub SPL_CLOCK () {28;}' unless defined(&SPL_CLOCK);
    eval 'sub SPL_CLOCKMASK () {(1<<  &SPL_CLOCK);}' unless defined(&SPL_CLOCKMASK);
    unless(defined(&_LOCORE)) {
	if(1) {
	    eval 'sub splbio () {
	        eval q( &splraise( $imask[ &IPL_BIO]));
	    }' unless defined(&splbio);
	    eval 'sub splnet () {
	        eval q( &splraise( $imask[ &IPL_NET]));
	    }' unless defined(&splnet);
	    eval 'sub spltty () {
	        eval q( &splraise( $imask[ &IPL_TTY]));
	    }' unless defined(&spltty);
	    eval 'sub splaudio () {
	        eval q( &splraise( $imask[ &IPL_AUDIO]));
	    }' unless defined(&splaudio);
	    eval 'sub splclock () {
	        eval q( &splraise( &SPL_CLOCKMASK| &SINT_ALLMASK));
	    }' unless defined(&splclock);
	    eval 'sub splvm () {
	        eval q( &splraise( $imask[ &IPL_VM]));
	    }' unless defined(&splvm);
	    eval 'sub splsoftclock () {
	        eval q( &splraise( &SINT_CLOCKMASK));
	    }' unless defined(&splsoftclock);
	    eval 'sub splsoftnet () {
	        eval q( &splraise( &SINT_NETMASK| &SINT_CLOCKMASK));
	    }' unless defined(&splsoftnet);
	    eval 'sub splsofttty () {
	        eval q( &splraise( &SINT_TTYMASK));
	    }' unless defined(&splsofttty);
	} else {
	    eval 'sub splbio () {
	        eval q( &splhigh());
	    }' unless defined(&splbio);
	    eval 'sub splnet () {
	        eval q( &splhigh());
	    }' unless defined(&splnet);
	    eval 'sub spltty () {
	        eval q( &splhigh());
	    }' unless defined(&spltty);
	    eval 'sub splclock () {
	        eval q( &splhigh());
	    }' unless defined(&splclock);
	    eval 'sub splvm () {
	        eval q( &splhigh());
	    }' unless defined(&splvm);
	    eval 'sub splsoftclock () {
	        eval q( &splhigh());
	    }' unless defined(&splsoftclock);
	    eval 'sub splsoftnet () {
	        eval q( &splhigh());
	    }' unless defined(&splsoftnet);
	    eval 'sub splsofttty () {
	        eval q( &splhigh());
	    }' unless defined(&splsofttty);
	}
	eval 'sub splstatclock () {
	    eval q( &splhigh());
	}' unless defined(&splstatclock);
	eval 'sub splhigh () {
	    eval q( &splraise(-1));
	}' unless defined(&splhigh);
	eval 'sub spl0 () {
	    eval q( &spllower(0));
	}' unless defined(&spl0);
	eval 'sub setsoftclock () {
	    eval q( &set_ipending( &SINT_CLOCKMASK););
	}' unless defined(&setsoftclock);
	eval 'sub setsoftnet () {
	    eval q( &set_ipending( &SINT_NETMASK););
	}' unless defined(&setsoftnet);
	eval 'sub setsofttty () {
	    eval q( &set_ipending( &SINT_TTYMASK););
	}' unless defined(&setsofttty);
	eval 'sub splassert {
	    my($X) = @_;
    	    eval q();
	}' unless defined(&splassert);
	eval 'sub INTPRI_CLOCK () {1;}' unless defined(&INTPRI_CLOCK);
	eval 'sub INTPRI_MACEIO () {2;}' unless defined(&INTPRI_MACEIO);
	eval 'sub INTPRI_XBOWMUX () {2;}' unless defined(&INTPRI_XBOWMUX);
	eval 'sub INTPRI_MACEAUX () {3;}' unless defined(&INTPRI_MACEAUX);
	eval 'sub INTMASKSIZE () {($sizeof{ &intrmask_t} * 8);}' unless defined(&INTMASKSIZE);
	if(0) {
	}
	eval 'sub register_pending_int_handler {
	    eval q(( &void(* &pending)) {  &pending_hand =  &pending; });
	}' unless defined(&register_pending_int_handler);
	if(defined(&INLINE_SPLRAISE)) {
	    eval 'sub splraise {
	        my($newcpl) = @_;
    		eval q(\\"(assembly code)\\");
	    }' unless defined(&splraise);
	} else {
	}
	eval 'sub splx {
	    my($newcpl) = @_;
    	    eval q({  &if ( &ipending & ~$newcpl) (* &pending_hand)($newcpl);  &else  &cpl = $newcpl; });
	}' unless defined(&splx);
	eval 'sub spllower {
	    my($newcpl) = @_;
    	    eval q({ \'int\'  &oldcpl;  &oldcpl =  &cpl;  &if ( &ipending & ~$newcpl) (* &pending_hand)($newcpl);  &else  &cpl = $newcpl; ( &oldcpl); });
	}' unless defined(&spllower);
	require 'sys/evcount.ph';
	eval 'sub NLOWINT () {16;}' unless defined(&NLOWINT);
	if(defined(&IMASK_EXTERNAL)) {
	}
    }
}
1;
