require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_PMAP_VM_)) {
    eval 'sub _PMAP_VM_ () {1;}' unless defined(&_PMAP_VM_);
    require 'sys/types.ph';
    require 'uvm/uvm_prot.ph';
    if(defined(&_KERNEL)) {
	eval 'sub pmap_kernel () {
	    eval q( &kernel_pmap_ptr);
	}' unless defined(&pmap_kernel);
    }
    eval 'sub PMAP_CACHE_MASK () {0xf00;}' unless defined(&PMAP_CACHE_MASK);
    eval 'sub PMAP_NOCACHE () {0x100;}' unless defined(&PMAP_NOCACHE);
    eval 'sub PMAP_WRITE_COMBINE () {0x200;}' unless defined(&PMAP_WRITE_COMBINE);
    eval 'sub PMAP_WRITE_BACK () {0x300;}' unless defined(&PMAP_WRITE_BACK);
    eval 'sub PMAP_NOCACHE_OVR () {0x400;}' unless defined(&PMAP_NOCACHE_OVR);
    if(defined(&_KERNEL)) {
	require 'machine/pmap.ph';
    }
    eval 'sub PMAP_WIRED () {0x10;}' unless defined(&PMAP_WIRED);
    eval 'sub PMAP_CANFAIL () {0x20;}' unless defined(&PMAP_CANFAIL);
    if(defined(&PMAP_ENABLE_PMAP_KMPAGE)) {
	eval 'sub PMAP_KMPAGE () {0x40;}' unless defined(&PMAP_KMPAGE);
    } else {
	eval 'sub PMAP_KMPAGE () {0x;}' unless defined(&PMAP_KMPAGE);
    }
    eval 'sub PMAP_MD_MASK () {0xff000000;}' unless defined(&PMAP_MD_MASK);
    eval 'sub PMAP_PROT_MASK () {0xf;}' unless defined(&PMAP_PROT_MASK);
    unless(defined(&PMAP_EXCLUDE_DECLS)) {
	if(defined(&_KERNEL)) {
	    if(!defined(&pmap_clear_modify)) {
	    }
	    if(!defined(&pmap_clear_reference)) {
	    }
	    if(!defined(&pmap_copy)) {
	    }
	    if(!defined(&pmap_copy_page)) {
	    }
	    if(defined(&PMAP_GROWKERNEL)) {
	    }
	    if(!defined(&pmap_kenter_pa)) {
	    }
	    if(!defined(&pmap_is_modified)) {
	    }
	    if(!defined(&pmap_is_referenced)) {
	    }
	    if(!defined(&pmap_phys_address)) {
	    }
	    if(!defined(&pmap_mmap_flags)) {
		eval 'sub pmap_mmap_flags {
		    my($x) = @_;
    		    eval q(0);
		}' unless defined(&pmap_mmap_flags);
	    }
	    if(!defined(&pmap_reference)) {
	    }
	    if(!defined(&pmap_remove)) {
	    }
	    if(!defined(&pmap_update)) {
	    }
	    if(!defined(&pmap_resident_count)) {
	    }
	    if(!defined(&pmap_wired_count)) {
	    }
	    if(!defined(&pmap_zero_page)) {
	    }
	    if(defined(&PMAP_STEAL_MEMORY)) {
	    }
	    if(defined(&PMAP_FORK)) {
	    }
	    if(defined(&PMAP_DIRECT)) {
	    }
	}
    }
}
1;
