require '_h2ph_pre.ph';

unless(defined(&_SPARC_VMPARAM_H_)) {
    eval 'sub _SPARC_VMPARAM_H_ () {1;}' unless defined(&_SPARC_VMPARAM_H_);
    eval 'sub USRTEXT () {0x2000;}' unless defined(&USRTEXT);
    eval 'sub USRSTACK () { &KERNBASE;}' unless defined(&USRSTACK);
    unless(defined(&MAXTSIZ)) {
	eval 'sub MAXTSIZ () {(16*1024*1024);}' unless defined(&MAXTSIZ);
    }
    unless(defined(&DFLDSIZ)) {
	eval 'sub DFLDSIZ () {(32*1024*1024);}' unless defined(&DFLDSIZ);
    }
    unless(defined(&MAXDSIZ)) {
	eval 'sub MAXDSIZ () {(128*1024*1024);}' unless defined(&MAXDSIZ);
    }
    unless(defined(&DFLSSIZ)) {
	eval 'sub DFLSSIZ () {(512*1024);}' unless defined(&DFLSSIZ);
    }
    unless(defined(&MAXSSIZ)) {
	eval 'sub MAXSSIZ () { &MAXDSIZ;}' unless defined(&MAXSSIZ);
    }
    unless(defined(&SHMMAXPGS)) {
	eval 'sub SHMMAXPGS () {1024;}' unless defined(&SHMMAXPGS);
    }
    eval 'sub MAXSLP () {20;}' unless defined(&MAXSLP);
    eval 'sub VM_MIN_ADDRESS () {(0);}' unless defined(&VM_MIN_ADDRESS);
    eval 'sub VM_MAX_ADDRESS () {( &KERNBASE);}' unless defined(&VM_MAX_ADDRESS);
    eval 'sub VM_MAXUSER_ADDRESS () {( &KERNBASE);}' unless defined(&VM_MAXUSER_ADDRESS);
    eval 'sub VM_MIN_KERNEL_ADDRESS () {( &KERNBASE);}' unless defined(&VM_MIN_KERNEL_ADDRESS);
    eval 'sub VM_MAX_KERNEL_ADDRESS () {(0xfe000000);}' unless defined(&VM_MAX_KERNEL_ADDRESS);
    eval 'sub VM_MBUF_SIZE () {( &NMBCLUSTERS* &MCLBYTES);}' unless defined(&VM_MBUF_SIZE);
    eval 'sub VM_KMEM_SIZE () {( &NKMEMCLUSTERS* &PAGE_SIZE);}' unless defined(&VM_KMEM_SIZE);
    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);
    if(defined ( &_KERNEL)  && !defined( &_LOCORE)) {
	eval 'sub dvma_mapin {
	    local($map,$va,$len,$canwait) = @_;
    	    eval q( &dvma_mapin_space($map,$va,$len,$canwait,0));
	}' unless defined(&dvma_mapin);
    }
}
1;
