require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_LOCORE)) {
}
if(defined(&SUN4_MMU3L)  && !defined(&SUN4)) {
    die("configuration error");
}
unless(defined(&NBPRG)) {
    sub NBPRG () {	(1<< 24);}
}
unless(defined(&RGSHIFT)) {
    sub RGSHIFT () {	24;}
}
unless(defined(&RGOFSET)) {
    sub RGOFSET () {	( &NBPRG - 1);}
}
unless(defined(&NSEGRG)) {
    sub NSEGRG () {	( &NBPRG /  &NBPSG);}
}
unless(defined(&NBPSG)) {
    sub NBPSG () {	(1<< 18);}
}
unless(defined(&SGSHIFT)) {
    sub SGSHIFT () {	18;}
}
unless(defined(&SGOFSET)) {
    sub SGOFSET () {	( &NBPSG - 1);}
}
if((defined(&SUN4) || defined(&SUN4E))  && (defined(&SUN4C) || defined(&SUN4D) || defined(&SUN4M))) {
    eval 'sub NPTESG () { &nptesg;}' unless defined(&NPTESG);
} else {
    eval 'sub NPTESG () {( &NBPSG /  &NBPG);}' unless defined(&NPTESG);
}
unless(defined(&VA_VREG)) {
    sub VA_VREG {
	my($va) = @_;
	eval q(((($va) >>  &RGSHIFT) & 255));
    }
}
unless(defined(&VA_VSEG)) {
    sub VA_VSEG {
	my($va) = @_;
	eval q(((($va) >>  &SGSHIFT) & 63));
    }
}
unless(defined(&VA_SUN4_VPG)) {
    sub VA_SUN4_VPG {
	my($va) = @_;
	eval q(((($va) >> 13) & 31));
    }
}
unless(defined(&VA_SUN4C_VPG)) {
    sub VA_SUN4C_VPG {
	my($va) = @_;
	eval q(((($va) >> 12) & 63));
    }
}
unless(defined(&VA_SUN4M_VPG)) {
    sub VA_SUN4M_VPG {
	my($va) = @_;
	eval q(((($va) >> 12) & 63));
    }
}
unless(defined(&VA_SUN4_OFF)) {
    sub VA_SUN4_OFF {
	my($va) = @_;
	eval q(((($va)) & 0x1fff));
    }
}
unless(defined(&VA_SUN4C_OFF)) {
    sub VA_SUN4C_OFF {
	my($va) = @_;
	eval q(((($va)) & 0xfff));
    }
}
unless(defined(&VA_SUN4M_OFF)) {
    sub VA_SUN4M_OFF {
	my($va) = @_;
	eval q(((($va)) & 0xfff));
    }
}
unless(defined(&VA_ROUNDDOWNTOREG)) {
    sub VA_ROUNDDOWNTOREG {
	my($va) = @_;
	eval q((($va) & ~ &RGOFSET));
    }
}
unless(defined(&VA_ROUNDDOWNTOSEG)) {
    sub VA_ROUNDDOWNTOSEG {
	my($va) = @_;
	eval q((($va) & ~ &SGOFSET));
    }
}
unless(defined(&VRTOVA)) {
    sub VRTOVA {
	my($vr) = @_;
	eval q((( &CPU_ISSUN4M ||  &HASSUN4_MMU3L) ? ( <<  &RGSHIFT) : ((($vr) << ( &RGSHIFT+2)) >> 2)));
    }
}
unless(defined(&VSTOVA)) {
    sub VSTOVA {
	my($vr,$vs) = @_;
	eval q((( &CPU_ISSUN4M ||  &HASSUN4_MMU3L) ? (( <<  &RGSHIFT) + ( <<  &SGSHIFT)) : ((( << ( &RGSHIFT+2)) >> 2) + (($vs) <<  &SGSHIFT))));
    }
}
unless(defined(&VA_INHOLE)) {
    sub VA_INHOLE {
	my($va) = @_;
	eval q(( &mmu_has_hole ? ( ((($va) >>  &PG_VSHIFT) + 1) > 1) : 0));
    }
}
unless(defined(&MMU_HOLE_START)) {
    sub MMU_HOLE_START () {	0x20000000;}
}
unless(defined(&MMU_HOLE_END)) {
    sub MMU_HOLE_END () {	0xe0000000;}
}
if(defined(&SUN4D) || defined(&SUN4M) ) {
    if(defined(&SUN4) || defined(&SUN4E) ) {
	eval 'sub VA_VPG {
	    my($va) = @_;
    	    eval q(( &CPU_ISSUN4OR4E ?  &VA_SUN4_VPG($va) :  &VA_SUN4C_VPG($va)));
	}' unless defined(&VA_VPG);
	eval 'sub VA_OFF {
	    my($va) = @_;
    	    eval q(( &CPU_ISSUN4OR4E ?  &VA_SUN4_OFF($va) :  &VA_SUN4C_OFF($va)));
	}' unless defined(&VA_OFF);
    } else {
	eval 'sub VA_VPG {
	    my($va) = @_;
    	    eval q( &VA_SUN4M_VPG($va));
	}' unless defined(&VA_VPG);
	eval 'sub VA_OFF {
	    my($va) = @_;
    	    eval q( &VA_SUN4M_OFF($va));
	}' unless defined(&VA_OFF);
    }
} else {
    if((defined(&SUN4) || defined(&SUN4E))  && defined(&SUN4C)) {
	eval 'sub VA_VPG {
	    my($va) = @_;
    	    eval q(( &CPU_ISSUN4C ?  &VA_SUN4C_VPG($va) :  &VA_SUN4_VPG($va)));
	}' unless defined(&VA_VPG);
	eval 'sub VA_OFF {
	    my($va) = @_;
    	    eval q(( &CPU_ISSUN4C ?  &VA_SUN4C_OFF($va) :  &VA_SUN4_OFF($va)));
	}' unless defined(&VA_OFF);
    }
    if(defined(&SUN4C)  && !(defined(&SUN4) || defined(&SUN4E))) {
	eval 'sub VA_VPG {
	    my($va) = @_;
    	    eval q( &VA_SUN4C_VPG($va));
	}' unless defined(&VA_VPG);
	eval 'sub VA_OFF {
	    my($va) = @_;
    	    eval q( &VA_SUN4C_OFF($va));
	}' unless defined(&VA_OFF);
    }
    if(!defined(&SUN4C)  && (defined(&SUN4) || defined(&SUN4E))) {
	eval 'sub VA_VPG {
	    my($va) = @_;
    	    eval q( &VA_SUN4_VPG($va));
	}' unless defined(&VA_VPG);
	eval 'sub VA_OFF {
	    my($va) = @_;
    	    eval q( &VA_SUN4_OFF($va));
	}' unless defined(&VA_OFF);
    }
}
unless(defined(&PG_V)) {
    sub PG_V () {	0x80000000;}
}
unless(defined(&PG_PROT)) {
    sub PG_PROT () {	0x60000000;}
}
unless(defined(&PG_W)) {
    sub PG_W () {	0x40000000;}
}
unless(defined(&PG_S)) {
    sub PG_S () {	0x20000000;}
}
unless(defined(&PG_NC)) {
    sub PG_NC () {	0x10000000;}
}
unless(defined(&PG_TYPE)) {
    sub PG_TYPE () {	0xc000000;}
}
unless(defined(&PG_OBMEM)) {
    sub PG_OBMEM () {	0x;}
}
unless(defined(&PG_OBIO)) {
    sub PG_OBIO () {	0x4000000;}
}
unless(defined(&PG_VME16)) {
    sub PG_VME16 () {	0x8000000;}
}
unless(defined(&PG_VME32)) {
    sub PG_VME32 () {	0xc000000;}
}
if(defined(&SUN4D) || defined(&SUN4M)) {
    eval 'sub PG_SUN4M_OBMEM () {0x;}' unless defined(&PG_SUN4M_OBMEM);
    eval 'sub PG_SUN4M_OBIO () {0xf;}' unless defined(&PG_SUN4M_OBIO);
    eval 'sub SRMMU_PGTYPE () {0xf0000000;}' unless defined(&SRMMU_PGTYPE);
}
unless(defined(&PG_U)) {
    sub PG_U () {	0x2000000;}
}
unless(defined(&PG_M)) {
    sub PG_M () {	0x1000000;}
}
unless(defined(&PG_IOC)) {
    sub PG_IOC () {	0x800000;}
}
unless(defined(&PG_MBZ)) {
    sub PG_MBZ () {	0x780000;}
}
unless(defined(&PG_PFNUM)) {
    sub PG_PFNUM () {	0x7ffff;}
}
unless(defined(&PG_TNC_SHIFT)) {
    sub PG_TNC_SHIFT () {	26;}
}
unless(defined(&PG_M_SHIFT)) {
    sub PG_M_SHIFT () {	24;}
}
unless(defined(&PG_M_SHIFT4M)) {
    sub PG_M_SHIFT4M () {	5;}
}
unless(defined(&PG_KR)) {
    sub PG_KR () {	0x20000000;}
}
unless(defined(&PG_KW)) {
    sub PG_KW () {	0x60000000;}
}
unless(defined(&PG_URKR)) {
    sub PG_URKR () {	0;}
}
unless(defined(&PG_UW)) {
    sub PG_UW () {	0x40000000;}
}
if(defined(&KGDB)) {
    if(defined(&SUN4M)) {
    }
}
unless(defined(&PG_VSHIFT)) {
    sub PG_VSHIFT () {	29;}
}
unless(defined(&PG_PROTSHIFT)) {
    sub PG_PROTSHIFT () {	29;}
}
unless(defined(&PG_PROTUWRITE)) {
    sub PG_PROTUWRITE () {	6;}
}
unless(defined(&PG_PROTUREAD)) {
    sub PG_PROTUREAD () {	4;}
}
unless(defined(&SRMMU_TEINVALID)) {
    sub SRMMU_TEINVALID () {	0x;}
}
unless(defined(&SRMMU_TEPTD)) {
    sub SRMMU_TEPTD () {	0x1;}
}
unless(defined(&SRMMU_TEPTE)) {
    sub SRMMU_TEPTE () {	0x2;}
}
unless(defined(&SRMMU_TERES)) {
    sub SRMMU_TERES () {	0x3;}
}
unless(defined(&SRMMU_TETYPE)) {
    sub SRMMU_TETYPE () {	0x3;}
}
unless(defined(&SRMMU_PPNMASK)) {
    sub SRMMU_PPNMASK () {	0xffffff00;}
}
unless(defined(&SRMMU_PPNSHIFT)) {
    sub SRMMU_PPNSHIFT () {	0x8;}
}
unless(defined(&SRMMU_PPNPASHIFT)) {
    sub SRMMU_PPNPASHIFT () {	0x4;}
}
unless(defined(&SRMMU_L1PPNSHFT)) {
    sub SRMMU_L1PPNSHFT () {	0x14;}
}
unless(defined(&SRMMU_L1PPNMASK)) {
    sub SRMMU_L1PPNMASK () {	0xfff00000;}
}
unless(defined(&SRMMU_L2PPNSHFT)) {
    sub SRMMU_L2PPNSHFT () {	0xe;}
}
unless(defined(&SRMMU_L2PPNMASK)) {
    sub SRMMU_L2PPNMASK () {	0xfc000;}
}
unless(defined(&SRMMU_L3PPNSHFT)) {
    sub SRMMU_L3PPNSHFT () {	0x8;}
}
unless(defined(&SRMMU_L3PPNMASK)) {
    sub SRMMU_L3PPNMASK () {	0x3f00;}
}
unless(defined(&SRMMU_PG_C)) {
    sub SRMMU_PG_C () {	0x80;}
}
unless(defined(&SRMMU_PG_M)) {
    sub SRMMU_PG_M () {	0x40;}
}
unless(defined(&SRMMU_PG_R)) {
    sub SRMMU_PG_R () {	0x20;}
}
unless(defined(&SRMMU_PGBITSMSK)) {
    sub SRMMU_PGBITSMSK () {	0xe0;}
}
unless(defined(&SRMMU_PROT_MASK)) {
    sub SRMMU_PROT_MASK () {	0x1c;}
}
unless(defined(&SRMMU_PROT_SHFT)) {
    sub SRMMU_PROT_SHFT () {	0x2;}
}
unless(defined(&PPROT_R_R)) {
    sub PPROT_R_R () {	0x;}
}
unless(defined(&PPROT_RW_RW)) {
    sub PPROT_RW_RW () {	0x4;}
}
unless(defined(&PPROT_RX_RX)) {
    sub PPROT_RX_RX () {	0x8;}
}
unless(defined(&PPROT_RWX_RWX)) {
    sub PPROT_RWX_RWX () {	0xc;}
}
unless(defined(&PPROT_X_X)) {
    sub PPROT_X_X () {	0x10;}
}
unless(defined(&PPROT_R_RW)) {
    sub PPROT_R_RW () {	0x14;}
}
unless(defined(&PPROT_N_RX)) {
    sub PPROT_N_RX () {	0x18;}
}
unless(defined(&PPROT_N_RWX)) {
    sub PPROT_N_RWX () {	0x1c;}
}
unless(defined(&PPROT_WRITE)) {
    sub PPROT_WRITE () {	0x4;}
}
unless(defined(&PPROT_S)) {
    sub PPROT_S () {	0x18;}
}
unless(defined(&PPROT_U2S_OMASK)) {
    sub PPROT_U2S_OMASK () {	0x18;}
}
unless(defined(&SRMMU_L1SIZE)) {
    sub SRMMU_L1SIZE () {	0x100;}
}
unless(defined(&SRMMU_L2SIZE)) {
    sub SRMMU_L2SIZE () {	0x40;}
}
unless(defined(&SRMMU_L3SIZE)) {
    sub SRMMU_L3SIZE () {	0x40;}
}
1;
