require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_M88K_INTR_H_)) {
    eval 'sub _M88K_INTR_H_ () {1;}' unless defined(&_M88K_INTR_H_);
    if(defined(&_KERNEL)) {
	unless(defined(&_LOCORE)) {
	    if(defined(&DIAGNOSTIC)) {
		eval 'sub splassert {
		    my($__wantipl) = @_;
    		    eval q( &do {  &if ( &splassert_ctl > 0) {  &splassert_check($__wantipl,  &__func__); } }  &while (0));
		}' unless defined(&splassert);
		eval 'sub splsoftassert {
		    my($wantipl) = @_;
    		    eval q( &splassert( &IPL_SOFTINT));
		}' unless defined(&splsoftassert);
	    } else {
		eval 'sub splassert {
		    my($wantipl) = @_;
    		    eval q( &do { }  &while (0));
		}' unless defined(&splassert);
		eval 'sub splsoftassert {
		    my($wantipl) = @_;
    		    eval q( &do { }  &while (0));
		}' unless defined(&splsoftassert);
	    }
	}
	eval 'sub splsoftclock () {
	    eval q( &raiseipl( &IPL_SOFTINT));
	}' unless defined(&splsoftclock);
	eval 'sub splsoftnet () {
	    eval q( &raiseipl( &IPL_SOFTINT));
	}' unless defined(&splsoftnet);
	eval 'sub splbio () {
	    eval q( &raiseipl( &IPL_BIO));
	}' unless defined(&splbio);
	eval 'sub splnet () {
	    eval q( &raiseipl( &IPL_NET));
	}' unless defined(&splnet);
	eval 'sub spltty () {
	    eval q( &raiseipl( &IPL_TTY));
	}' unless defined(&spltty);
	eval 'sub splclock () {
	    eval q( &raiseipl( &IPL_CLOCK));
	}' unless defined(&splclock);
	eval 'sub splstatclock () {
	    eval q( &raiseipl( &IPL_STATCLOCK));
	}' unless defined(&splstatclock);
	eval 'sub splsched () {
	    eval q( &raiseipl( &IPL_SCHED));
	}' unless defined(&splsched);
	eval 'sub splvm () {
	    eval q( &raiseipl( &IPL_VM));
	}' unless defined(&splvm);
	eval 'sub splhigh () {
	    eval q( &setipl( &IPL_HIGH));
	}' unless defined(&splhigh);
	eval 'sub spllock () {
	    eval q( &splhigh());
	}' unless defined(&spllock);
	eval 'sub splx {
	    my($x) = @_;
    	    eval q((($x) ?  &setipl(($x)) :  &spl0()));
	}' unless defined(&splx);
	unless(defined(&_LOCORE)) {
	    eval 'sub IPL_SOFT () {0;}' unless defined(&IPL_SOFT);
	    eval 'sub IPL_SOFTCLOCK () {1;}' unless defined(&IPL_SOFTCLOCK);
	    eval 'sub IPL_SOFTNET () {2;}' unless defined(&IPL_SOFTNET);
	    eval 'sub IPL_SOFTTTY () {3;}' unless defined(&IPL_SOFTTTY);
	    eval 'sub SI_SOFT () {0;}' unless defined(&SI_SOFT);
	    eval 'sub SI_SOFTCLOCK () {1;}' unless defined(&SI_SOFTCLOCK);
	    eval 'sub SI_SOFTNET () {2;}' unless defined(&SI_SOFTNET);
	    eval 'sub SI_SOFTTTY () {3;}' unless defined(&SI_SOFTTTY);
	    eval 'sub SI_NQUEUES () {4;}' unless defined(&SI_NQUEUES);
	    require 'machine/mutex.ph';
	    require 'sys/queue.ph';
	    eval 'sub setsoftnet () {
	        eval q( &softintr_schedule( &softnet_intrhand));
	    }' unless defined(&setsoftnet);
	}
    }
}
1;
