require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_UVM_UVM_OBJECT_H_)) {
    eval 'sub _UVM_UVM_OBJECT_H_ () {1;}' unless defined(&_UVM_UVM_OBJECT_H_);
    require 'sys/queue.ph';
    require 'sys/radixtree.ph';
    require 'uvm/uvm_pglist.ph';
    eval 'sub UVM_PAGE_DIRTY_TAG () {1;}' unless defined(&UVM_PAGE_DIRTY_TAG);
    eval 'sub UVM_PAGE_WRITEBACK_TAG () {2;}' unless defined(&UVM_PAGE_WRITEBACK_TAG);
    eval 'sub UVM_OBJ_KERN () {(-2);}' unless defined(&UVM_OBJ_KERN);
    eval 'sub UVM_OBJ_IS_KERN_OBJECT {
        my($uobj) = @_;
	    eval q((($uobj)-> &uo_refs ==  &UVM_OBJ_KERN));
    }' unless defined(&UVM_OBJ_IS_KERN_OBJECT);
    if(defined(&_KERNEL)) {
	eval 'sub UVM_OBJ_IS_VNODE {
	    my($uobj) = @_;
    	    eval q((($uobj)-> &pgops ==  &uvm_vnodeops));
	}' unless defined(&UVM_OBJ_IS_VNODE);
	eval 'sub UVM_OBJ_IS_DEVICE {
	    my($uobj) = @_;
    	    eval q((($uobj)-> &pgops ==  &uvm_deviceops));
	}' unless defined(&UVM_OBJ_IS_DEVICE);
	eval 'sub UVM_OBJ_IS_VTEXT {
	    my($uobj) = @_;
    	    eval q(( &UVM_OBJ_IS_VNODE($uobj)  &&  &uvn_text_p($uobj)));
	}' unless defined(&UVM_OBJ_IS_VTEXT);
	eval 'sub UVM_OBJ_IS_CLEAN {
	    my($uobj) = @_;
    	    eval q(( &UVM_OBJ_IS_VNODE($uobj)  &&  &uvm_obj_clean_p($uobj)));
	}' unless defined(&UVM_OBJ_IS_CLEAN);
	eval 'sub UVM_OBJ_NEEDS_WRITEFAULT {
	    my($uobj) = @_;
    	    eval q(( &UVM_OBJ_IS_VNODE($uobj)  &&  &uvm_obj_clean_p($uobj)));
	}' unless defined(&UVM_OBJ_NEEDS_WRITEFAULT);
	eval 'sub UVM_OBJ_IS_AOBJ {
	    my($uobj) = @_;
    	    eval q((($uobj)-> &pgops ==  &aobj_pager));
	}' unless defined(&UVM_OBJ_IS_AOBJ);
    }
}
1;
