require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_I386_INTR_H_)) {
    eval 'sub _I386_INTR_H_ () {1;}' unless defined(&_I386_INTR_H_);
    require 'machine/intrdefs.ph';
    unless(defined(&_LOCORE)) {
	if(defined(&MULTIPROCESSOR)) {
	    require 'machine/i82489reg.ph';
	    require 'machine/i82489var.ph';
	    require 'machine/cpu.ph';
	}
	eval 'sub IMASK {
	    local($level) = @_;
    	    eval q( $imask[ &IPL($level)]);
	}' unless defined(&IMASK);
	eval 'sub IUNMASK {
	    local($level) = @_;
    	    eval q( $iunmask[ &IPL($level)]);
	}' unless defined(&IUNMASK);
	eval 'sub __splbarrier () {
	    eval q( &__asm  &__volatile(\\"\\":::\\"memory\\"));
	}' unless defined(&__splbarrier);
	if(defined(&DIAGNOSTIC)) {
	    eval 'sub splassert {
	        local($__wantipl) = @_;
    		eval q( &do {  &if ( &__predict_false( &splassert_ctl > 0)) {  &splassert_check($__wantipl,  &__func__); } }  &while (0));
	    }' unless defined(&splassert);
	} else {
	    eval 'sub splassert {
	        local($wantipl) = @_;
    		eval q( &do { }  &while (0));
	    }' unless defined(&splassert);
	}
	eval 'sub _SPLRAISE {
	    local($ocpl, $ncpl) = @_;
    	    eval q($ocpl =  &lapic_tpr;  &if ($ncpl > $ocpl)  &lapic_tpr = $ncpl);
	}' unless defined(&_SPLRAISE);
	eval 'sub _SPLX {
	    local($ncpl) = @_;
    	    eval q( &lapic_tpr = $ncpl;  &if ( &ipending &  &IUNMASK($ncpl))  &Xspllower());
	}' unless defined(&_SPLX);
	eval 'sub splbio () {
	    eval q( &splraise( &IPL_BIO));
	}' unless defined(&splbio);
	eval 'sub splnet () {
	    eval q( &splraise( &IPL_NET));
	}' unless defined(&splnet);
	eval 'sub spltty () {
	    eval q( &splraise( &IPL_TTY));
	}' unless defined(&spltty);
	eval 'sub splaudio () {
	    eval q( &splraise( &IPL_AUDIO));
	}' unless defined(&splaudio);
	eval 'sub splclock () {
	    eval q( &splraise( &IPL_CLOCK));
	}' unless defined(&splclock);
	eval 'sub splstatclock () {
	    eval q( &splhigh());
	}' unless defined(&splstatclock);
	eval 'sub splipi () {
	    eval q( &splraise( &IPL_IPI));
	}' unless defined(&splipi);
	eval 'sub splsoftclock () {
	    eval q( &splraise( &IPL_SOFTCLOCK));
	}' unless defined(&splsoftclock);
	eval 'sub splsoftnet () {
	    eval q( &splraise( &IPL_SOFTNET));
	}' unless defined(&splsoftnet);
	eval 'sub splsofttty () {
	    eval q( &splraise( &IPL_SOFTTTY));
	}' unless defined(&splsofttty);
	eval 'sub splvm () {
	    eval q( &splraise( &IPL_VM));
	}' unless defined(&splvm);
	eval 'sub splimp () {
	    eval q( &splvm());
	}' unless defined(&splimp);
	eval 'sub splhigh () {
	    eval q( &splraise( &IPL_HIGH));
	}' unless defined(&splhigh);
	eval 'sub splsched () {
	    eval q( &splraise( &IPL_SCHED));
	}' unless defined(&splsched);
	eval 'sub spllock () {
	    eval q( &splhigh());
	}' unless defined(&spllock);
	eval 'sub spl0 () {
	    eval q( &spllower( &IPL_NONE));
	}' unless defined(&spl0);
	eval 'sub setsoftast () {
	    eval q(( &astpending = 1));
	}' unless defined(&setsoftast);
	eval 'sub setsoftclock () {
	    eval q( &softintr(1<<  &SIR_CLOCK,  &IPL_SOFTCLOCK));
	}' unless defined(&setsoftclock);
	eval 'sub setsoftnet () {
	    eval q( &softintr(1<<  &SIR_NET,  &IPL_SOFTNET));
	}' unless defined(&setsoftnet);
	eval 'sub setsofttty () {
	    eval q( &softintr(1<<  &SIR_TTY,  &IPL_SOFTTTY));
	}' unless defined(&setsofttty);
	eval 'sub I386_IPI_HALT () {0x1;}' unless defined(&I386_IPI_HALT);
	eval 'sub I386_IPI_MICROSET () {0x2;}' unless defined(&I386_IPI_MICROSET);
	eval 'sub I386_IPI_FLUSH_FPU () {0x4;}' unless defined(&I386_IPI_FLUSH_FPU);
	eval 'sub I386_IPI_SYNCH_FPU () {0x8;}' unless defined(&I386_IPI_SYNCH_FPU);
	eval 'sub I386_IPI_TLB () {0x10;}' unless defined(&I386_IPI_TLB);
	eval 'sub I386_IPI_MTRR () {0x20;}' unless defined(&I386_IPI_MTRR);
	eval 'sub I386_IPI_GDT () {0x40;}' unless defined(&I386_IPI_GDT);
	eval 'sub I386_IPI_DDB () {0x80;}' unless defined(&I386_IPI_DDB);
	eval 'sub I386_NIPI () {8;}' unless defined(&I386_NIPI);
	if(defined(&MULTIPROCESSOR)) {
	}
    }
}
1;
