require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_UVM_UVM_AMAP_H_)) {
    eval 'sub _UVM_UVM_AMAP_H_ () {1;}' unless defined(&_UVM_UVM_AMAP_H_);
    if(defined(&_KERNEL)) {
	if(defined(&UVM_AMAP_INLINE)) {
	    eval 'sub AMAP_INLINE () { &static  &__inline;}' unless defined(&AMAP_INLINE);
	} else {
	    eval 'sub AMAP_INLINE () {1;}' unless defined(&AMAP_INLINE);
	}
	eval 'sub AMAP_SHARED () {0x1;}' unless defined(&AMAP_SHARED);
	eval 'sub AMAP_REFALL () {0x2;}' unless defined(&AMAP_REFALL);
    }
    eval 'sub UVM_AMAP_PPREF () {1;}' unless defined(&UVM_AMAP_PPREF);
    if(defined(&UVM_AMAP_PPREF)) {
    }
    eval 'sub UVM_AMAP_LARGE () {256;}' unless defined(&UVM_AMAP_LARGE);
    eval 'sub UVM_AMAP_CHUNK () {16;}' unless defined(&UVM_AMAP_CHUNK);
    if(defined(&_KERNEL)) {
	eval 'sub AMAP_B2SLOT {
	    my($S,$B) = @_;
    	    eval q({  &KASSERT((($B) & ( &PAGE_SIZE - 1)) == 0); ($S) = ($B) >>  &PAGE_SHIFT; });
	}' unless defined(&AMAP_B2SLOT);
	eval 'sub amap_flags {
	    my($AMAP) = @_;
    	    eval q((($AMAP)-> &am_flags));
	}' unless defined(&amap_flags);
	eval 'sub amap_lock {
	    my($AMAP) = @_;
    	    eval q( &simple_lock(($AMAP)-> &am_l));
	}' unless defined(&amap_lock);
	eval 'sub amap_refs {
	    my($AMAP) = @_;
    	    eval q((($AMAP)-> &am_ref));
	}' unless defined(&amap_refs);
	eval 'sub amap_unlock {
	    my($AMAP) = @_;
    	    eval q( &simple_unlock(($AMAP)-> &am_l));
	}' unless defined(&amap_unlock);
	if(defined(&UVM_AMAP_PPREF)) {
	    eval 'sub PPREF_NONE () {( -1);}' unless defined(&PPREF_NONE);
	}
    }
}
1;
