require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_MIPS_TRAP_H_)) {
    eval 'sub _MIPS_TRAP_H_ () {1;}' unless defined(&_MIPS_TRAP_H_);
    eval 'sub T_INT () {0;}' unless defined(&T_INT);
    eval 'sub T_TLB_MOD () {1;}' unless defined(&T_TLB_MOD);
    eval 'sub T_TLB_LD_MISS () {2;}' unless defined(&T_TLB_LD_MISS);
    eval 'sub T_TLB_ST_MISS () {3;}' unless defined(&T_TLB_ST_MISS);
    eval 'sub T_ADDR_ERR_LD () {4;}' unless defined(&T_ADDR_ERR_LD);
    eval 'sub T_ADDR_ERR_ST () {5;}' unless defined(&T_ADDR_ERR_ST);
    eval 'sub T_BUS_ERR_IFETCH () {6;}' unless defined(&T_BUS_ERR_IFETCH);
    eval 'sub T_BUS_ERR_LD_ST () {7;}' unless defined(&T_BUS_ERR_LD_ST);
    eval 'sub T_SYSCALL () {8;}' unless defined(&T_SYSCALL);
    eval 'sub T_BREAK () {9;}' unless defined(&T_BREAK);
    eval 'sub T_RES_INST () {10;}' unless defined(&T_RES_INST);
    eval 'sub T_COP_UNUSABLE () {11;}' unless defined(&T_COP_UNUSABLE);
    eval 'sub T_OVFLOW () {12;}' unless defined(&T_OVFLOW);
    eval 'sub T_TRAP () {13;}' unless defined(&T_TRAP);
    eval 'sub T_VCEI () {14;}' unless defined(&T_VCEI);
    eval 'sub T_FPE () {15;}' unless defined(&T_FPE);
    eval 'sub T_IWATCH () {16;}' unless defined(&T_IWATCH);
    eval 'sub T_C2E () {18;}' unless defined(&T_C2E);
    eval 'sub T_MDMX () {22;}' unless defined(&T_MDMX);
    eval 'sub T_DWATCH () {23;}' unless defined(&T_DWATCH);
    eval 'sub T_MCHECK () {24;}' unless defined(&T_MCHECK);
    eval 'sub T_CACHEERR () {30;}' unless defined(&T_CACHEERR);
    eval 'sub T_VCED () {31;}' unless defined(&T_VCED);
    eval 'sub T_USER () {0x20;}' unless defined(&T_USER);
    eval 'sub KT_BADERR () {1;}' unless defined(&KT_BADERR);
    eval 'sub KT_COPYERR () {2;}' unless defined(&KT_COPYERR);
    eval 'sub KT_KCOPYERR () {3;}' unless defined(&KT_KCOPYERR);
    eval 'sub KT_DDBERR () {4;}' unless defined(&KT_DDBERR);
    unless(defined(&_LOCORE)) {
	if(defined( &DDB) || defined( &DEBUG)) {
	    eval 'sub trapdebug_enter {
	        my($x, $cd) = @_;
    		eval q({  &u_int32_t  &__s =  &disableintr();  ($trp->{status}) =  ($x->{sr});  ($trp->{cause}) =  ($x->{cause});  ($trp->{vadr}) =  ($x->{badvaddr});  ($trp->{pc}) =  ($x->{pc});  ($trp->{sp}) =  ($x->{sp});  ($trp->{ra}) =  ($x->{ra});  ($trp->{cpl}) =  ($x->{cpl});  ($trp->{code}) = $cd;  &if (++ &trp ==  $trapdebug[ &TRAPSIZE])  &trp =  &trapdebug;  &setsr( &__s); });
	    }' unless defined(&trapdebug_enter);
	    eval 'sub TRAPSIZE () {10;}' unless defined(&TRAPSIZE);
	} else {
	    eval 'sub trapdebug_enter {
	        my($x, $y) = @_;
    		eval q();
	    }' unless defined(&trapdebug_enter);
	}
    }
}
1;
