require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_ARM_PTE_H_)) {
    eval 'sub _ARM_PTE_H_ () {1;}' unless defined(&_ARM_PTE_H_);
    unless(defined(&_LOCORE)) {
	unless(defined(&__BSD_PTENTRY_T__)) {
	    eval 'sub __BSD_PTENTRY_T__ () {1;}' unless defined(&__BSD_PTENTRY_T__);
	    eval 'sub PRIxPTE () { &PRIx32;}' unless defined(&PRIxPTE);
	}
    }
    eval 'sub L1_SS_SIZE () {0x1000000;}' unless defined(&L1_SS_SIZE);
    eval 'sub L1_SS_OFFSET () {( &L1_SS_SIZE - 1);}' unless defined(&L1_SS_OFFSET);
    eval 'sub L1_SS_FRAME () {(~ &L1_SS_OFFSET);}' unless defined(&L1_SS_FRAME);
    eval 'sub L1_SS_SHIFT () {24;}' unless defined(&L1_SS_SHIFT);
    eval 'sub L1_S_SIZE () {0x100000;}' unless defined(&L1_S_SIZE);
    eval 'sub L1_S_OFFSET () {( &L1_S_SIZE - 1);}' unless defined(&L1_S_OFFSET);
    eval 'sub L1_S_FRAME () {(~ &L1_S_OFFSET);}' unless defined(&L1_S_FRAME);
    eval 'sub L1_S_SHIFT () {20;}' unless defined(&L1_S_SHIFT);
    eval 'sub L2_L_SIZE () {0x10000;}' unless defined(&L2_L_SIZE);
    eval 'sub L2_L_OFFSET () {( &L2_L_SIZE - 1);}' unless defined(&L2_L_OFFSET);
    eval 'sub L2_L_FRAME () {(~ &L2_L_OFFSET);}' unless defined(&L2_L_FRAME);
    eval 'sub L2_L_SHIFT () {16;}' unless defined(&L2_L_SHIFT);
    eval 'sub L2_S_SEGSIZE () {( &PAGE_SIZE *  &L2_S_SIZE / 4);}' unless defined(&L2_S_SEGSIZE);
    eval 'sub L2_S_SIZE () {0x1000;}' unless defined(&L2_S_SIZE);
    eval 'sub L2_S_OFFSET () {( &L2_S_SIZE - 1);}' unless defined(&L2_S_OFFSET);
    eval 'sub L2_S_FRAME () {(~ &L2_S_OFFSET);}' unless defined(&L2_S_FRAME);
    eval 'sub L2_S_SHIFT () {12;}' unless defined(&L2_S_SHIFT);
    eval 'sub L2_T_SIZE () {0x400;}' unless defined(&L2_T_SIZE);
    eval 'sub L2_T_OFFSET () {( &L2_T_SIZE - 1);}' unless defined(&L2_T_OFFSET);
    eval 'sub L2_T_FRAME () {(~ &L2_T_OFFSET);}' unless defined(&L2_T_FRAME);
    eval 'sub L2_T_SHIFT () {10;}' unless defined(&L2_T_SHIFT);
    eval 'sub L1_ADDR_BITS () {0xfff00000;}' unless defined(&L1_ADDR_BITS);
    eval 'sub L2_ADDR_BITS () {0xff000;}' unless defined(&L2_ADDR_BITS);
    eval 'sub L1_TABLE_SIZE () {0x4000;}' unless defined(&L1_TABLE_SIZE);
    eval 'sub L2_TABLE_SIZE () {0x1000;}' unless defined(&L2_TABLE_SIZE);
    eval 'sub L2_TABLE_SIZE_REAL () {0x400;}' unless defined(&L2_TABLE_SIZE_REAL);
    eval 'sub L1TT_SIZE () {0x2000;}' unless defined(&L1TT_SIZE);
    eval 'sub L1_TYPE_INV () {0x;}' unless defined(&L1_TYPE_INV);
    eval 'sub L1_TYPE_C () {0x1;}' unless defined(&L1_TYPE_C);
    eval 'sub L1_TYPE_S () {0x2;}' unless defined(&L1_TYPE_S);
    eval 'sub L1_TYPE_F () {0x3;}' unless defined(&L1_TYPE_F);
    eval 'sub L1_TYPE_MASK () {0x3;}' unless defined(&L1_TYPE_MASK);
    eval 'sub L1_S_B () {0x4;}' unless defined(&L1_S_B);
    eval 'sub L1_S_C () {0x8;}' unless defined(&L1_S_C);
    eval 'sub L1_S_IMP () {0x10;}' unless defined(&L1_S_IMP);
    eval 'sub L1_S_DOM {
        my($x) = @_;
	    eval q((($x) << 5));
    }' unless defined(&L1_S_DOM);
    eval 'sub L1_S_DOM_MASK () { &L1_S_DOM(0xf);}' unless defined(&L1_S_DOM_MASK);
    eval 'sub L1_S_AP {
        my($x) = @_;
	    eval q((($x) << 10));
    }' unless defined(&L1_S_AP);
    eval 'sub L1_S_ADDR_MASK () {0xfff00000;}' unless defined(&L1_S_ADDR_MASK);
    eval 'sub L1_S_XSCALE_P () {0x200;}' unless defined(&L1_S_XSCALE_P);
    eval 'sub L1_S_XS_TEX {
        my($x) = @_;
	    eval q((($x) << 12));
    }' unless defined(&L1_S_XS_TEX);
    eval 'sub L1_S_V6_TEX {
        my($x) = @_;
	    eval q( &L1_S_XS_TEX($x));
    }' unless defined(&L1_S_V6_TEX);
    eval 'sub L1_S_V6_P () {0x200;}' unless defined(&L1_S_V6_P);
    eval 'sub L1_S_V6_SUPER () {0x40000;}' unless defined(&L1_S_V6_SUPER);
    eval 'sub L1_S_V6_XN () { &L1_S_IMP;}' unless defined(&L1_S_V6_XN);
    eval 'sub L1_S_V6_APX () {0x8000;}' unless defined(&L1_S_V6_APX);
    eval 'sub L1_S_V6_S () {0x10000;}' unless defined(&L1_S_V6_S);
    eval 'sub L1_S_V6_nG () {0x20000;}' unless defined(&L1_S_V6_nG);
    eval 'sub L1_S_V6_SS () {0x40000;}' unless defined(&L1_S_V6_SS);
    eval 'sub L1_S_V6_NS () {0x80000;}' unless defined(&L1_S_V6_NS);
    eval 'sub L1_C_IMP0 () {0x4;}' unless defined(&L1_C_IMP0);
    eval 'sub L1_C_IMP1 () {0x8;}' unless defined(&L1_C_IMP1);
    eval 'sub L1_C_IMP2 () {0x10;}' unless defined(&L1_C_IMP2);
    eval 'sub L1_C_DOM {
        my($x) = @_;
	    eval q((($x) << 5));
    }' unless defined(&L1_C_DOM);
    eval 'sub L1_C_DOM_MASK () { &L1_C_DOM(0xf);}' unless defined(&L1_C_DOM_MASK);
    eval 'sub L1_C_ADDR_MASK () {0xfffffc00;}' unless defined(&L1_C_ADDR_MASK);
    eval 'sub L1_C_XSCALE_P () {0x200;}' unless defined(&L1_C_XSCALE_P);
    eval 'sub L1_C_V6_P () {0x200;}' unless defined(&L1_C_V6_P);
    eval 'sub L1_F_IMP0 () {0x4;}' unless defined(&L1_F_IMP0);
    eval 'sub L1_F_IMP1 () {0x8;}' unless defined(&L1_F_IMP1);
    eval 'sub L1_F_IMP2 () {0x10;}' unless defined(&L1_F_IMP2);
    eval 'sub L1_F_DOM {
        my($x) = @_;
	    eval q((($x) << 5));
    }' unless defined(&L1_F_DOM);
    eval 'sub L1_F_DOM_MASK () { &L1_F_DOM(0xf);}' unless defined(&L1_F_DOM_MASK);
    eval 'sub L1_F_ADDR_MASK () {0xfffff000;}' unless defined(&L1_F_ADDR_MASK);
    eval 'sub L1_F_XSCALE_P () {0x200;}' unless defined(&L1_F_XSCALE_P);
    eval 'sub L2_TYPE_INV () {0x;}' unless defined(&L2_TYPE_INV);
    eval 'sub L2_TYPE_L () {0x1;}' unless defined(&L2_TYPE_L);
    eval 'sub L2_TYPE_S () {0x2;}' unless defined(&L2_TYPE_S);
    eval 'sub L2_TYPE_T () {0x3;}' unless defined(&L2_TYPE_T);
    eval 'sub L2_TYPE_MASK () {0x3;}' unless defined(&L2_TYPE_MASK);
    eval 'sub L2_TYPE_XS () {0x3;}' unless defined(&L2_TYPE_XS);
    eval 'sub L2_B () {0x4;}' unless defined(&L2_B);
    eval 'sub L2_C () {0x8;}' unless defined(&L2_C);
    eval 'sub L2_AP0 {
        my($x) = @_;
	    eval q((($x) << 4));
    }' unless defined(&L2_AP0);
    eval 'sub L2_AP1 {
        my($x) = @_;
	    eval q((($x) << 6));
    }' unless defined(&L2_AP1);
    eval 'sub L2_AP2 {
        my($x) = @_;
	    eval q((($x) << 8));
    }' unless defined(&L2_AP2);
    eval 'sub L2_AP3 {
        my($x) = @_;
	    eval q((($x) << 10));
    }' unless defined(&L2_AP3);
    eval 'sub L2_AP {
        my($x) = @_;
	    eval q(( &L2_AP0($x) |  &L2_AP1($x) |  &L2_AP2($x) |  &L2_AP3($x)));
    }' unless defined(&L2_AP);
    eval 'sub L2_XS_L_TEX {
        my($x) = @_;
	    eval q((($x) << 12));
    }' unless defined(&L2_XS_L_TEX);
    eval 'sub L2_XS_T_TEX {
        my($x) = @_;
	    eval q((($x) << 6));
    }' unless defined(&L2_XS_T_TEX);
    eval 'sub L2_XS_XN () {0x1;}' unless defined(&L2_XS_XN);
    eval 'sub L2_XS_APX () {0x200;}' unless defined(&L2_XS_APX);
    eval 'sub L2_XS_S () {0x400;}' unless defined(&L2_XS_S);
    eval 'sub L2_XS_nG () {0x800;}' unless defined(&L2_XS_nG);
    eval 'sub L2_V6_L_TEX () { &L2_XS_L_TEX;}' unless defined(&L2_V6_L_TEX);
    eval 'sub L2_V6_XS_TEX () { &L2_XS_T_TEX;}' unless defined(&L2_V6_XS_TEX);
    eval 'sub L2_XS_L_XN () {0x8000;}' unless defined(&L2_XS_L_XN);
    eval 'sub AP_W () {0x1;}' unless defined(&AP_W);
    eval 'sub AP_U () {0x2;}' unless defined(&AP_U);
    eval 'sub AP_R () {0x1;}' unless defined(&AP_R);
    eval 'sub AP_RO () {0x20;}' unless defined(&AP_RO);
    eval 'sub AP_KR () {0x;}' unless defined(&AP_KR);
    eval 'sub AP_KRW () {0x1;}' unless defined(&AP_KRW);
    eval 'sub AP_KRWUR () {0x2;}' unless defined(&AP_KRWUR);
    eval 'sub AP_KRWURW () {0x3;}' unless defined(&AP_KRWURW);
    eval 'sub APX_KR {
        my($APX) = @_;
	    eval q(($APX|0x1));
    }' unless defined(&APX_KR);
    eval 'sub APX_KRUR {
        my($APX) = @_;
	    eval q(($APX|0x2));
    }' unless defined(&APX_KRUR);
    eval 'sub APX_KRW {
        my($APX) = @_;
	    eval q(( 0x1));
    }' unless defined(&APX_KRW);
    eval 'sub APX_KRWUR {
        my($APX) = @_;
	    eval q(( 0x2));
    }' unless defined(&APX_KRWUR);
    eval 'sub APX_KRWURW {
        my($APX) = @_;
	    eval q(( 0x3));
    }' unless defined(&APX_KRWURW);
    eval 'sub AP7_KR () {0x21;}' unless defined(&AP7_KR);
    eval 'sub AP7_KRUR () {0x23;}' unless defined(&AP7_KRUR);
    eval 'sub AP7_KRW () {0x1;}' unless defined(&AP7_KRW);
    eval 'sub AP7_KRWURW () {0x3;}' unless defined(&AP7_KRWURW);
    eval 'sub DOMAIN_FAULT () {0x;}' unless defined(&DOMAIN_FAULT);
    eval 'sub DOMAIN_CLIENT () {0x1;}' unless defined(&DOMAIN_CLIENT);
    eval 'sub DOMAIN_RESERVED () {0x2;}' unless defined(&DOMAIN_RESERVED);
    eval 'sub DOMAIN_MANAGER () {0x3;}' unless defined(&DOMAIN_MANAGER);
    eval 'sub TEX_XSCALE_X () {0x1;}' unless defined(&TEX_XSCALE_X);
    eval 'sub TEX_ARMV6_TEX () {0x7;}' unless defined(&TEX_ARMV6_TEX);
}
1;
