require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&VMPARAM_H)) {
    eval 'sub VMPARAM_H () {1;}' unless defined(&VMPARAM_H);
    eval 'sub USRTEXT () {0x2000;}' unless defined(&USRTEXT);
    eval 'sub USRSTACK () {0xffffffffffffe000;}' unless defined(&USRSTACK);
    if(0) {
	unless(defined(&MAXTSIZ)) {
	    eval 'sub MAXTSIZ () {(4*1024*1024*1024);}' unless defined(&MAXTSIZ);
	}
	unless(defined(&DFLDSIZ)) {
	    eval 'sub DFLDSIZ () {(128*1024*1024);}' unless defined(&DFLDSIZ);
	}
	unless(defined(&MAXDSIZ)) {
	    eval 'sub MAXDSIZ () {(512*1024*1024*1024);}' unless defined(&MAXDSIZ);
	}
	unless(defined(&DFLSSIZ)) {
	    eval 'sub DFLSSIZ () {(1024*1024);}' unless defined(&DFLSSIZ);
	}
	unless(defined(&MAXSSIZ)) {
	    eval 'sub MAXSSIZ () { &MAXDSIZ;}' unless defined(&MAXSSIZ);
	}
    } else {
	unless(defined(&MAXTSIZ)) {
	    eval 'sub MAXTSIZ () {(1*1024*1024*1024);}' unless defined(&MAXTSIZ);
	}
	unless(defined(&DFLDSIZ)) {
	    eval 'sub DFLDSIZ () {(128*1024*1024);}' unless defined(&DFLDSIZ);
	}
	unless(defined(&MAXDSIZ)) {
	    eval 'sub MAXDSIZ () {(1*1024*1024*1024);}' unless defined(&MAXDSIZ);
	}
	unless(defined(&DFLSSIZ)) {
	    eval 'sub DFLSSIZ () {(1024*1024);}' unless defined(&DFLSSIZ);
	}
	unless(defined(&MAXSSIZ)) {
	    eval 'sub MAXSSIZ () {(8*1024*1024);}' unless defined(&MAXSSIZ);
	}
    }
    eval 'sub STACKGAP_RANDOM () {256*1024;}' unless defined(&STACKGAP_RANDOM);
    unless(defined(&SHMMAXPGS)) {
	eval 'sub SHMMAXPGS () {4096;}' unless defined(&SHMMAXPGS);
    }
    eval 'sub VM_MIN_ADDRESS () {(( &vaddr_t)0);}' unless defined(&VM_MIN_ADDRESS);
    eval 'sub VM_MAX_ADDRESS () {(( &vaddr_t)-1);}' unless defined(&VM_MAX_ADDRESS);
    eval 'sub VM_MAXUSER_ADDRESS () {(( &vaddr_t)-1);}' unless defined(&VM_MAXUSER_ADDRESS);
    eval 'sub VM_PIE_MIN_ADDR () { &PAGE_SIZE;}' unless defined(&VM_PIE_MIN_ADDR);
    eval 'sub VM_PIE_MAX_ADDR () {0x10000000000;}' unless defined(&VM_PIE_MAX_ADDR);
    eval 'sub VM_MIN_KERNEL_ADDRESS () {(( &vaddr_t) &KERNBASE);}' unless defined(&VM_MIN_KERNEL_ADDRESS);
    eval 'sub VM_MAX_KERNEL_ADDRESS () {(( &vaddr_t)0x7ffffffffff);}' unless defined(&VM_MAX_KERNEL_ADDRESS);
    eval 'sub VM_PHYSSEG_MAX () {32;}' unless defined(&VM_PHYSSEG_MAX);
    eval 'sub VM_PHYSSEG_STRAT () { &VM_PSTRAT_BSEARCH;}' unless defined(&VM_PHYSSEG_STRAT);
    eval 'sub VM_PHYSSEG_NOADD () {1;}' unless defined(&VM_PHYSSEG_NOADD);
    eval 'sub VM_NFREELIST () {1;}' unless defined(&VM_NFREELIST);
    eval 'sub VM_FREELIST_DEFAULT () {0;}' unless defined(&VM_FREELIST_DEFAULT);
    eval 'sub __HAVE_VM_PAGE_MD () {1;}' unless defined(&__HAVE_VM_PAGE_MD);
    eval 'sub VM_MDPAGE_INIT {
        my($pg) = @_;
	    eval q( &do { ($pg)-> ($mdpage->{pvent}->{pv_next}) =  &NULL; ($pg)-> ($mdpage->{pvent}->{pv_pmap}) =  &NULL; ($pg)-> ($mdpage->{pvent}->{pv_va}) = 0; }  &while (0));
    }' unless defined(&VM_MDPAGE_INIT);
    if(defined ( &_KERNEL)  && !defined( &_LOCORE)) {
    }
}
1;
