require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&VA_SUN4U_VPG)) {
    sub VA_SUN4U_VPG {
	my($va) = @_;
	eval q(((($va) >> 13) & 31));
    }
}
unless(defined(&VA_SUN4U_OFF)) {
    sub VA_SUN4U_OFF {
	my($va) = @_;
	eval q(((($va)) & 0x1fff));
    }
}
unless(defined(&VA_VPG)) {
    sub VA_VPG {
	my($va) = @_;
	eval q( &VA_SUN4U_VPG($va));
    }
}
unless(defined(&VA_OFF)) {
    sub VA_OFF {
	my($va) = @_;
	eval q( &VA_SUN4U_OFF($va));
    }
}
unless(defined(&PG_SHIFT4U)) {
    sub PG_SHIFT4U () {	13;}
}
unless(defined(&MMU_PAGE_ALIGN)) {
    sub MMU_PAGE_ALIGN () {	8192;}
}
unless(defined(&TSBVA)) {
    sub TSBVA {
	my($i) = @_;
	eval q((( ($tsb[&(i)]->{tag}->{f}->{tag_va})<<22)|((($i)<<13)&0x3ff000)));
    }
}
unless(defined(&_LOCORE)) {
    if(0) {
    } else {
    }
    if(defined( &MULTIPROCESSOR)) {
	eval 'sub tlb_flush_pte {
	    my($va,$ctx) = @_;
    	    eval q( &smp_tlb_flush_pte($va, $ctx));
	}' unless defined(&tlb_flush_pte);
	eval 'sub tlb_flush_ctx {
	    my($ctx) = @_;
    	    eval q( &smp_tlb_flush_ctx($ctx));
	}' unless defined(&tlb_flush_ctx);
    } else {
	eval 'sub tlb_flush_pte {
	    my($va,$ctx) = @_;
    	    eval q( &sp_tlb_flush_pte($va, $ctx));
	}' unless defined(&tlb_flush_pte);
	eval 'sub tlb_flush_ctx {
	    my($ctx) = @_;
    	    eval q( &sp_tlb_flush_ctx($ctx));
	}' unless defined(&tlb_flush_ctx);
    }
}
unless(defined(&CTX_MASK)) {
    sub CTX_MASK () {	((1<<13)-1);}
}
unless(defined(&TSB_TAG_CTX_SHIFT)) {
    sub TSB_TAG_CTX_SHIFT () {	48;}
}
unless(defined(&TSB_TAG_VA_SHIFT)) {
    sub TSB_TAG_VA_SHIFT () {	22;}
}
unless(defined(&TSB_TAG_LOCKED)) {
    sub TSB_TAG_LOCKED () {	0x40000000000;}
}
unless(defined(&TSB_TAG_G)) {
    sub TSB_TAG_G () {	0x8000000000000000;}
}
unless(defined(&TSB_TAG_CTX)) {
    sub TSB_TAG_CTX {
	my($t) = @_;
	eval q((((( &int64_t)($t))>> &TSB_TAG_CTX_SHIFT) &CTX_MASK));
    }
}
unless(defined(&TSB_TAG_VA)) {
    sub TSB_TAG_VA {
	my($t) = @_;
	eval q((((( &int64_t)($t))<< &TSB_TAG_VA_SHIFT)));
    }
}
unless(defined(&TSB_TAG)) {
    sub TSB_TAG {
	my($g,$ctx,$va) = @_;
	eval q((((( &u_int64_t)(($g)!=0))<<63)|((( &u_int64_t)($ctx) &CTX_MASK)<< &TSB_TAG_CTX_SHIFT)|((( &u_int64_t)$va)>> &TSB_TAG_VA_SHIFT)));
    }
}
unless(defined(&PGSZ_8K)) {
    sub PGSZ_8K () {	0;}
}
unless(defined(&PGSZ_64K)) {
    sub PGSZ_64K () {	1;}
}
unless(defined(&PGSZ_512K)) {
    sub PGSZ_512K () {	2;}
}
unless(defined(&PGSZ_4M)) {
    sub PGSZ_4M () {	3;}
}
unless(defined(&SUN4U_PGSZ_SHIFT)) {
    sub SUN4U_PGSZ_SHIFT () {	61;}
}
unless(defined(&SUN4U_TLB_SZ)) {
    sub SUN4U_TLB_SZ {
	my($s) = @_;
	eval q(((( &uint64_t)($s)) <<  &SUN4U_PGSZ_SHIFT));
    }
}
unless(defined(&SUN4U_TLB_V)) {
    sub SUN4U_TLB_V () {	0x8000000000000000;}
}
unless(defined(&SUN4U_TLB_8K)) {
    sub SUN4U_TLB_8K () {	 &SUN4U_TLB_SZ( &PGSZ_8K);}
}
unless(defined(&SUN4U_TLB_64K)) {
    sub SUN4U_TLB_64K () {	 &SUN4U_TLB_SZ( &PGSZ_64K);}
}
unless(defined(&SUN4U_TLB_512K)) {
    sub SUN4U_TLB_512K () {	 &SUN4U_TLB_SZ( &PGSZ_512K);}
}
unless(defined(&SUN4U_TLB_4M)) {
    sub SUN4U_TLB_4M () {	 &SUN4U_TLB_SZ( &PGSZ_4M);}
}
unless(defined(&SUN4U_TLB_SZ_MASK)) {
    sub SUN4U_TLB_SZ_MASK () {	0x6000000000000000;}
}
unless(defined(&SUN4U_TLB_NFO)) {
    sub SUN4U_TLB_NFO () {	0x1000000000000000;}
}
unless(defined(&SUN4U_TLB_IE)) {
    sub SUN4U_TLB_IE () {	0x800000000000000;}
}
unless(defined(&SUN4U_TLB_SOFT2_MASK)) {
    sub SUN4U_TLB_SOFT2_MASK () {	0x7fc000000000000;}
}
unless(defined(&SUN4U_TLB_RESERVED_MASK)) {
    sub SUN4U_TLB_RESERVED_MASK () {	0x3800000000000;}
}
unless(defined(&SUN4U_TLB_PA_MASK)) {
    sub SUN4U_TLB_PA_MASK () {	0x7fffffffe000;}
}
unless(defined(&SUN4U_TLB_SOFT_MASK)) {
    sub SUN4U_TLB_SOFT_MASK () {	0x1f80;}
}
unless(defined(&SUN4U_TLB_ACCESS)) {
    sub SUN4U_TLB_ACCESS () {	0x200;}
}
unless(defined(&SUN4U_TLB_MODIFY)) {
    sub SUN4U_TLB_MODIFY () {	0x800;}
}
unless(defined(&SUN4U_TLB_REAL_W)) {
    sub SUN4U_TLB_REAL_W () {	0x400;}
}
unless(defined(&SUN4U_TLB_TSB_LOCK)) {
    sub SUN4U_TLB_TSB_LOCK () {	0x1000;}
}
unless(defined(&SUN4U_TLB_EXEC)) {
    sub SUN4U_TLB_EXEC () {	0x100;}
}
unless(defined(&SUN4U_TLB_EXEC_ONLY)) {
    sub SUN4U_TLB_EXEC_ONLY () {	0x80;}
}
unless(defined(&SUN4U_TLB_L)) {
    sub SUN4U_TLB_L () {	0x40;}
}
unless(defined(&SUN4U_TLB_CACHE_MASK)) {
    sub SUN4U_TLB_CACHE_MASK () {	0x30;}
}
unless(defined(&SUN4U_TLB_CP)) {
    sub SUN4U_TLB_CP () {	0x20;}
}
unless(defined(&SUN4U_TLB_CV)) {
    sub SUN4U_TLB_CV () {	0x10;}
}
unless(defined(&SUN4U_TLB_E)) {
    sub SUN4U_TLB_E () {	0x8;}
}
unless(defined(&SUN4U_TLB_P)) {
    sub SUN4U_TLB_P () {	0x4;}
}
unless(defined(&SUN4U_TLB_W)) {
    sub SUN4U_TLB_W () {	0x2;}
}
unless(defined(&SUN4U_TLB_G)) {
    sub SUN4U_TLB_G () {	0x1;}
}
unless(defined(&SUN4U_TSB_DATA)) {
    sub SUN4U_TSB_DATA {
	my($g,$sz,$pa,$priv,$write,$cache,$aliased,$valid,$ie) = @_;
	eval q(((($valid)? &SUN4U_TLB_V:0)| &SUN4U_TLB_SZ($sz)|((( &u_int64_t)($pa)) &SUN4U_TLB_PA_MASK)|(($cache)?(($aliased)? &SUN4U_TLB_CP: &SUN4U_TLB_CACHE_MASK): &SUN4U_TLB_E)|(($priv)? &SUN4U_TLB_P:0)|(($write)? &SUN4U_TLB_W:0)|(($g)? &SUN4U_TLB_G:0)|(($ie)? &SUN4U_TLB_IE:0)));
    }
}
unless(defined(&SUN4V_PGSZ_SHIFT)) {
    sub SUN4V_PGSZ_SHIFT () {	0;}
}
unless(defined(&SUN4V_TLB_SZ)) {
    sub SUN4V_TLB_SZ {
	my($s) = @_;
	eval q(((( &uint64_t)($s))<< &SUN4V_PGSZ_SHIFT));
    }
}
unless(defined(&SUN4V_TLB_V)) {
    sub SUN4V_TLB_V () {	0x8000000000000000;}
}
unless(defined(&SUN4V_TLB_8K)) {
    sub SUN4V_TLB_8K () {	 &SUN4V_TLB_SZ( &PGSZ_8K);}
}
unless(defined(&SUN4V_TLB_64K)) {
    sub SUN4V_TLB_64K () {	 &SUN4V_TLB_SZ( &PGSZ_64K);}
}
unless(defined(&SUN4V_TLB_512K)) {
    sub SUN4V_TLB_512K () {	 &SUN4V_TLB_SZ( &PGSZ_512K);}
}
unless(defined(&SUN4V_TLB_4M)) {
    sub SUN4V_TLB_4M () {	 &SUN4V_TLB_SZ( &PGSZ_4M);}
}
unless(defined(&SUN4V_TLB_SZ_MASK)) {
    sub SUN4V_TLB_SZ_MASK () {	0xf;}
}
unless(defined(&SUN4V_TLB_NFO)) {
    sub SUN4V_TLB_NFO () {	0x4000000000000000;}
}
unless(defined(&SUN4V_TLB_IE)) {
    sub SUN4V_TLB_IE () {	0x1000;}
}
unless(defined(&SUN4V_TLB_SOFT2_MASK)) {
    sub SUN4V_TLB_SOFT2_MASK () {	0x3f00000000000000;}
}
unless(defined(&SUN4V_TLB_PA_MASK)) {
    sub SUN4V_TLB_PA_MASK () {	0xffffffffffe000;}
}
unless(defined(&SUN4V_TLB_SOFT_MASK)) {
    sub SUN4V_TLB_SOFT_MASK () {	0x30;}
}
unless(defined(&SUN4V_TLB_ACCESS)) {
    sub SUN4V_TLB_ACCESS () {	0x10;}
}
unless(defined(&SUN4V_TLB_MODIFY)) {
    sub SUN4V_TLB_MODIFY () {	0x20;}
}
unless(defined(&SUN4V_TLB_REAL_W)) {
    sub SUN4V_TLB_REAL_W () {	0x2000000000000000;}
}
unless(defined(&SUN4V_TLB_TSB_LOCK)) {
    sub SUN4V_TLB_TSB_LOCK () {	0x1000000000000000;}
}
unless(defined(&SUN4V_TLB_EXEC)) {
    sub SUN4V_TLB_EXEC () {	 &SUN4V_TLB_X;}
}
unless(defined(&SUN4V_TLB_EXEC_ONLY)) {
    sub SUN4V_TLB_EXEC_ONLY () {	0x200000000000000;}
}
unless(defined(&SUN4V_TLB_CACHE_MASK)) {
    sub SUN4V_TLB_CACHE_MASK () {	0x600;}
}
unless(defined(&SUN4V_TLB_CP)) {
    sub SUN4V_TLB_CP () {	0x400;}
}
unless(defined(&SUN4V_TLB_CV)) {
    sub SUN4V_TLB_CV () {	0x200;}
}
unless(defined(&SUN4V_TLB_E)) {
    sub SUN4V_TLB_E () {	0x800;}
}
unless(defined(&SUN4V_TLB_P)) {
    sub SUN4V_TLB_P () {	0x100;}
}
unless(defined(&SUN4V_TLB_X)) {
    sub SUN4V_TLB_X () {	0x80;}
}
unless(defined(&SUN4V_TLB_W)) {
    sub SUN4V_TLB_W () {	0x40;}
}
unless(defined(&SUN4V_TLB_G)) {
    sub SUN4V_TLB_G () {	0x;}
}
unless(defined(&SUN4V_TSB_DATA)) {
    sub SUN4V_TSB_DATA {
	my($g,$sz,$pa,$priv,$write,$cache,$aliased,$valid,$ie) = @_;
	eval q(((($valid)? &SUN4V_TLB_V:0)| &SUN4V_TLB_SZ($sz)|((( &u_int64_t)($pa)) &SUN4V_TLB_PA_MASK)|(($cache)?(($aliased)? &SUN4V_TLB_CP: &SUN4V_TLB_CACHE_MASK): &SUN4V_TLB_E)|(($priv)? &SUN4V_TLB_P:0)|(($write)? &SUN4V_TLB_W:0)|(($g)? &SUN4V_TLB_G:0)|(($ie)? &SUN4V_TLB_IE:0)));
    }
}
unless(defined(&MMU_CACHE_VIRT)) {
    sub MMU_CACHE_VIRT () {	0x3;}
}
unless(defined(&MMU_CACHE_PHYS)) {
    sub MMU_CACHE_PHYS () {	0x2;}
}
unless(defined(&MMU_CACHE_NONE)) {
    sub MMU_CACHE_NONE () {	0x;}
}
unless(defined(&IOPTE_PPN_MASK)) {
    sub IOPTE_PPN_MASK () {	0x7ffff00;}
}
unless(defined(&IOPTE_PPN_SHIFT)) {
    sub IOPTE_PPN_SHIFT () {	8;}
}
unless(defined(&IOPTE_RSVD)) {
    sub IOPTE_RSVD () {	0xf1;}
}
unless(defined(&IOPTE_WRITE)) {
    sub IOPTE_WRITE () {	0x4;}
}
unless(defined(&IOPTE_VALID)) {
    sub IOPTE_VALID () {	0x2;}
}
1;
