require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_MIPS_PMAP_H_)) {
    eval 'sub _MIPS_PMAP_H_ () {1;}' unless defined(&_MIPS_PMAP_H_);
    if(defined(&_KERNEL)) {
	eval 'sub mips_trunc_seg {
	    my($x) = @_;
    	    eval q((( &vaddr_t)($x) & ~ &SEGOFSET));
	}' unless defined(&mips_trunc_seg);
	eval 'sub mips_round_seg {
	    my($x) = @_;
    	    eval q(((( &vaddr_t)($x) +  &SEGOFSET) & ~ &SEGOFSET));
	}' unless defined(&mips_round_seg);
	eval 'sub pmap_segmap {
	    my($m, $v) = @_;
    	    eval q((($m)-> ($p$m_segtab->{seg_tab[&((v)>>SEGSHIFT)]})));
	}' unless defined(&pmap_segmap);
	eval 'sub PMAP_SEGTABSIZE () {512;}' unless defined(&PMAP_SEGTABSIZE);
	eval 'sub PV_UNCACHED () {0x1;}' unless defined(&PV_UNCACHED);
	eval 'sub PV_CACHED () {0x2;}' unless defined(&PV_CACHED);
	eval 'sub PV_ATTR_MOD () {0x4;}' unless defined(&PV_ATTR_MOD);
	eval 'sub PV_ATTR_REF () {0x8;}' unless defined(&PV_ATTR_REF);
	eval 'sub PV_PRESERVE () {( &PV_UNCACHED| &PV_CACHED| &PV_ATTR_MOD| &PV_ATTR_REF);}' unless defined(&PV_PRESERVE);
	eval 'sub pmap_resident_count {
	    my($pmap) = @_;
    	    eval q((($pmap)-> ($pm_stats->{resident_count})));
	}' unless defined(&pmap_resident_count);
	eval 'sub pmap_wired_count {
	    my($pmap) = @_;
    	    eval q((($pmap)-> ($pm_stats->{wired_count})));
	}' unless defined(&pmap_wired_count);
	eval 'sub pmap_kernel () {
	    eval q(( &kernel_pmap_store));
	}' unless defined(&pmap_kernel);
	eval 'sub pmap_phys_address {
	    my($ppn) = @_;
    	    eval q( &ptoa($ppn));
	}' unless defined(&pmap_phys_address);
	eval 'sub PMAP_STEAL_MEMORY () {1;}' unless defined(&PMAP_STEAL_MEMORY);
	eval 'sub PMAP_PREFER {
	    my($pa, $va) = @_;
    	    eval q( &pmap_prefer($pa, $va));
	}' unless defined(&PMAP_PREFER);
	eval 'sub pmap_update {
	    my($x) = @_;
    	    eval q( &do { }  &while (0));
	}' unless defined(&pmap_update);
	eval 'sub pmap_collect {
	    my($x) = @_;
    	    eval q( &do { }  &while (0));
	}' unless defined(&pmap_collect);
	eval 'sub pmap_proc_iflush {
	    my($p,$va,$len) = @_;
    	    eval q( &do { }  &while (0));
	}' unless defined(&pmap_proc_iflush);
	eval 'sub pmap_unuse_final {
	    my($p) = @_;
    	    eval q( &do { }  &while (0));
	}' unless defined(&pmap_unuse_final);
    }
}
1;
