require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_INTR_H_)) {
    eval 'sub _SYS_INTR_H_ () {1;}' unless defined(&_SYS_INTR_H_);
    eval 'sub INTRIDBUF () {64;}' unless defined(&INTRIDBUF);
    eval 'sub INTRDEVNAMEBUF () {256;}' unless defined(&INTRDEVNAMEBUF);
    if(defined(&_KERNEL)) {
	require 'sys/types.ph';
	unless(defined(&__HAVE_MD_SOFTINT_TRIGGER)) {
	}
	eval 'sub SOFTINT_BIO () {0x;}' unless defined(&SOFTINT_BIO);
	eval 'sub SOFTINT_CLOCK () {0x1;}' unless defined(&SOFTINT_CLOCK);
	eval 'sub SOFTINT_SERIAL () {0x2;}' unless defined(&SOFTINT_SERIAL);
	eval 'sub SOFTINT_NET () {0x3;}' unless defined(&SOFTINT_NET);
	eval 'sub SOFTINT_MPSAFE () {0x100;}' unless defined(&SOFTINT_MPSAFE);
	eval 'sub SOFTINT_RCPU () {0x200;}' unless defined(&SOFTINT_RCPU);
	eval 'sub SOFTINT_PENDING () {0x1000;}' unless defined(&SOFTINT_PENDING);
	eval 'sub SOFTINT_COUNT () {0x4;}' unless defined(&SOFTINT_COUNT);
	eval 'sub SOFTINT_LVLMASK () {0xff;}' unless defined(&SOFTINT_LVLMASK);
	eval 'sub SOFTINT_IMPMASK () {0xf000;}' unless defined(&SOFTINT_IMPMASK);
	eval 'sub IPL_BIO () { &IPL_VM;}' unless defined(&IPL_BIO);
	eval 'sub IPL_NET () { &IPL_VM;}' unless defined(&IPL_NET);
	eval 'sub IPL_TTY () { &IPL_VM;}' unless defined(&IPL_TTY);
	eval 'sub IPL_AUDIO () { &IPL_SCHED;}' unless defined(&IPL_AUDIO);
	eval 'sub IPL_CLOCK () { &IPL_SCHED;}' unless defined(&IPL_CLOCK);
	eval 'sub IPL_SERIAL () { &IPL_HIGH;}' unless defined(&IPL_SERIAL);
	eval 'sub splbio () {
	    eval q( &splvm());
	}' unless defined(&splbio);
	eval 'sub splnet () {
	    eval q( &splvm());
	}' unless defined(&splnet);
	eval 'sub spltty () {
	    eval q( &splvm());
	}' unless defined(&spltty);
	eval 'sub splaudio () {
	    eval q( &splsched());
	}' unless defined(&splaudio);
	eval 'sub splclock () {
	    eval q( &splsched());
	}' unless defined(&splclock);
	eval 'sub splserial () {
	    eval q( &splhigh());
	}' unless defined(&splserial);
	require 'machine/intr.ph';
    }
 elsif(defined(&_KMEMUSER)) {
	eval 'sub SOFTINT_COUNT () {0x4;}' unless defined(&SOFTINT_COUNT);
    }
}
1;
