require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_MACHINE_VM_PARAM_)) {
    eval 'sub _MACHINE_VM_PARAM_ () {1;}' unless defined(&_MACHINE_VM_PARAM_);
    eval 'sub USRTEXT () {0x1000;}' unless defined(&USRTEXT);
    eval 'sub USRSTACK () { &VM_MAXUSER_ADDRESS;}' unless defined(&USRSTACK);
    unless(defined(&MAXTSIZ)) {
	eval 'sub MAXTSIZ () {(8*1024*1024);}' unless defined(&MAXTSIZ);
    }
    unless(defined(&DFLDSIZ)) {
	eval 'sub DFLDSIZ () {(32*1024*1024);}' unless defined(&DFLDSIZ);
    }
    unless(defined(&MAXDSIZ)) {
	eval 'sub MAXDSIZ () {(64*1024*1024);}' unless defined(&MAXDSIZ);
    }
    unless(defined(&DFLSSIZ)) {
	eval 'sub DFLSSIZ () {(2*1024*1024);}' unless defined(&DFLSSIZ);
    }
    unless(defined(&MAXSSIZ)) {
	eval 'sub MAXSSIZ () { &MAXDSIZ;}' unless defined(&MAXSSIZ);
    }
    eval 'sub STACKGAP_RANDOM () {256*1024;}' unless defined(&STACKGAP_RANDOM);
    unless(defined(&SHMMAXPGS)) {
	eval 'sub SHMMAXPGS () {1024;}' unless defined(&SHMMAXPGS);
    }
    eval 'sub VM_MIN_ADDRESS () {(( &vaddr_t)0);}' unless defined(&VM_MIN_ADDRESS);
    eval 'sub VM_MAX_ADDRESS () {(( &vaddr_t)0xfffff000);}' unless defined(&VM_MAX_ADDRESS);
    eval 'sub VM_MAXUSER_ADDRESS () { &VM_MAX_ADDRESS;}' unless defined(&VM_MAXUSER_ADDRESS);
    eval 'sub VM_MIN_KERNEL_ADDRESS () {(( &vaddr_t)0);}' unless defined(&VM_MIN_KERNEL_ADDRESS);
    eval 'sub VM_MAX_KERNEL_ADDRESS () {(( &vaddr_t)0x20000000);}' unless defined(&VM_MAX_KERNEL_ADDRESS);
    eval 'sub VM_PHYS_SIZE () {(1*  &NPTEPG *  &PAGE_SIZE);}' unless defined(&VM_PHYS_SIZE);
    eval 'sub VM_PHYSSEG_MAX () {1;}' unless defined(&VM_PHYSSEG_MAX);
    eval 'sub VM_PHYSSEG_STRAT () { &VM_PSTRAT_RANDOM;}' 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);
    unless(defined(&_LOCORE)) {
	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; ($pg)-> ($mdpage->{pvent}->{pv_flags}) = 0; }  &while (0));
	}' unless defined(&VM_MDPAGE_INIT);
    }
}
1;
