require '_h2ph_pre.ph';

unless(defined(&_MACHINE_PTE_H_)) {
    eval 'sub _MACHINE_PTE_H_ () {1;}' unless defined(&_MACHINE_PTE_H_);
    eval 'sub PT_ENTRY_NULL () {( 0);}' unless defined(&PT_ENTRY_NULL);
    eval 'sub ST_ENTRY_NULL () {( 0);}' unless defined(&ST_ENTRY_NULL);
    eval 'sub SG_V () {0x00000002;}' unless defined(&SG_V);
    eval 'sub SG_NV () {0x00000000;}' unless defined(&SG_NV);
    eval 'sub SG_PROT () {0x00000004;}' unless defined(&SG_PROT);
    eval 'sub SG_RO () {0x00000004;}' unless defined(&SG_RO);
    eval 'sub SG_RW () {0x00000000;}' unless defined(&SG_RW);
    eval 'sub SG_U () {0x00000008;}' unless defined(&SG_U);
    eval 'sub SG_FRAME () {0xffffe000;}' unless defined(&SG_FRAME);
    eval 'sub SG_IMASK () {0xff000000;}' unless defined(&SG_IMASK);
    eval 'sub SG_ISHIFT () {24;}' unless defined(&SG_ISHIFT);
    eval 'sub SG_PMASK () {0x00ffe000;}' unless defined(&SG_PMASK);
    eval 'sub SG_PSHIFT () {13;}' unless defined(&SG_PSHIFT);
    eval 'sub SG4_MASK1 () {0xfe000000;}' unless defined(&SG4_MASK1);
    eval 'sub SG4_SHIFT1 () {25;}' unless defined(&SG4_SHIFT1);
    eval 'sub SG4_MASK2 () {0x01fc0000;}' unless defined(&SG4_MASK2);
    eval 'sub SG4_SHIFT2 () {18;}' unless defined(&SG4_SHIFT2);
    eval 'sub SG4_MASK3 () {0x0003e000;}' unless defined(&SG4_MASK3);
    eval 'sub SG4_SHIFT3 () {13;}' unless defined(&SG4_SHIFT3);
    eval 'sub SG4_ADDR1 () {0xfffffe00;}' unless defined(&SG4_ADDR1);
    eval 'sub SG4_ADDR2 () {0xffffff80;}' unless defined(&SG4_ADDR2);
    eval 'sub SG4_LEV1SIZE () {128;}' unless defined(&SG4_LEV1SIZE);
    eval 'sub SG4_LEV2SIZE () {128;}' unless defined(&SG4_LEV2SIZE);
    eval 'sub SG4_LEV3SIZE () {32;}' unless defined(&SG4_LEV3SIZE);
    eval 'sub PG_V () {0x00000001;}' unless defined(&PG_V);
    eval 'sub PG_NV () {0x00000000;}' unless defined(&PG_NV);
    eval 'sub PG_PROT () {0x00000004;}' unless defined(&PG_PROT);
    eval 'sub PG_U () {0x00000008;}' unless defined(&PG_U);
    eval 'sub PG_M () {0x00000010;}' unless defined(&PG_M);
    eval 'sub PG_W () {0x00000100;}' unless defined(&PG_W);
    eval 'sub PG_RO () {0x00000004;}' unless defined(&PG_RO);
    eval 'sub PG_RW () {0x00000000;}' unless defined(&PG_RW);
    eval 'sub PG_FRAME () {0xffffe000;}' unless defined(&PG_FRAME);
    eval 'sub PG_CI () {0x00000040;}' unless defined(&PG_CI);
    eval 'sub PG_SHIFT () {13;}' unless defined(&PG_SHIFT);
    eval 'sub PG_PFNUM {
        local($x) = @_;
	    eval q(((($x) &  &PG_FRAME) >>  &PG_SHIFT));
    }' unless defined(&PG_PFNUM);
    eval 'sub PG_CMASK () {0x00000060;}' unless defined(&PG_CMASK);
    eval 'sub PG_CWT () {0x00000000;}' unless defined(&PG_CWT);
    eval 'sub PG_CCB () {0x00000020;}' unless defined(&PG_CCB);
    eval 'sub PG_CIS () {0x00000040;}' unless defined(&PG_CIS);
    eval 'sub PG_CIN () {0x00000060;}' unless defined(&PG_CIN);
    eval 'sub PG_SO () {0x00000080;}' unless defined(&PG_SO);
    eval 'sub AMIGA_040RTSIZE () {512;}' unless defined(&AMIGA_040RTSIZE);
    eval 'sub AMIGA_040STSIZE () {512;}' unless defined(&AMIGA_040STSIZE);
    eval 'sub AMIGA_040PTSIZE () {128;}' unless defined(&AMIGA_040PTSIZE);
    if(0) {
	eval 'sub AMIGA_STSIZE () {1024;}' unless defined(&AMIGA_STSIZE);
    } else {
	eval 'sub AMIGA_STSIZE () {( &MAXUL2SIZE* &SG4_LEV2SIZE*$sizeof{ &st_entry_t});}' unless defined(&AMIGA_STSIZE);
    }
    eval 'sub AMIGA_MAX_COREUPT () {1024;}' unless defined(&AMIGA_MAX_COREUPT);
    eval 'sub AMIGA_UPTSIZE () { &roundup( &VM_MAXUSER_ADDRESS /  &NPTEPG,  &NBPG);}' unless defined(&AMIGA_UPTSIZE);
    eval 'sub AMIGA_UPTBASE () {0x10000000;}' unless defined(&AMIGA_UPTBASE);
    eval 'sub AMIGA_UPTMAXSIZE () { &roundup(( &AMIGA_MAX_COREUPT *  &AMIGA_UPTSIZE),  &NBPG);}' unless defined(&AMIGA_UPTMAXSIZE);
    eval 'sub AMIGA_MAX_KPTSIZE () {( &AMIGA_MAX_COREUPT *  &AMIGA_UPTSIZE /  &NPTEPG);}' unless defined(&AMIGA_MAX_KPTSIZE);
    eval 'sub AMIGA_KPTSIZE () { &roundup(( &VM_MAX_KERNEL_ADDRESS -  &VM_MIN_KERNEL_ADDRESS) /  &NPTEPG,  &NBPG);}' unless defined(&AMIGA_KPTSIZE);
    eval 'sub AMIGA_MAX_PTSIZE () { &roundup(0xffffffff /  &NPTEPG,  &NBPG);}' unless defined(&AMIGA_MAX_PTSIZE);
    eval 'sub kvtopte {
        local($va) = @_;
	    eval q(( $Sysmap[(($va) -  &VM_MIN_KERNEL_ADDRESS) >>  &PGSHIFT]));
    }' unless defined(&kvtopte);
    eval 'sub ptetokv {
        local($pt) = @_;
	    eval q((((($pt) -  &Sysmap) <<  &PGSHIFT) +  &VM_MIN_KERNEL_ADDRESS));
    }' unless defined(&ptetokv);
    eval 'sub kvtophys {
        local($va) = @_;
	    eval q((( ($kvtopte->{pg_pfnum}) <<  &PGSHIFT) | (($va) &  &PGOFSET)));
    }' unless defined(&kvtophys);
}
1;
