require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_UVM_UVM_OBJECT_H_)) {
    eval 'sub _UVM_UVM_OBJECT_H_ () {1;}' unless defined(&_UVM_UVM_OBJECT_H_);
    eval 'sub UVM_OBJ_KERN () {(-2);}' unless defined(&UVM_OBJ_KERN);
    eval 'sub UVM_OBJ_KERN_INTRSAFE () {(-3);}' unless defined(&UVM_OBJ_KERN_INTRSAFE);
    eval 'sub UVM_OBJ_IS_KERN_OBJECT {
        my($uobj) = @_;
	    eval q((($uobj)-> &uo_refs ==  &UVM_OBJ_KERN || ($uobj)-> &uo_refs ==  &UVM_OBJ_KERN_INTRSAFE));
    }' unless defined(&UVM_OBJ_IS_KERN_OBJECT);
    eval 'sub UVM_OBJ_IS_INTRSAFE_OBJECT {
        my($uobj) = @_;
	    eval q((($uobj)-> &uo_refs ==  &UVM_OBJ_KERN_INTRSAFE));
    }' unless defined(&UVM_OBJ_IS_INTRSAFE_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((($uobj)-> &pgops ==  &uvm_vnodeops  && ($uobj)-> &v_flag &  &VTEXT));
	}' unless defined(&UVM_OBJ_IS_VTEXT);
    }
}
1;
