require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SIMPLELOCK_H_)) {
    eval 'sub _SIMPLELOCK_H_ () {1;}' unless defined(&_SIMPLELOCK_H_);
    if(defined(&MULTIPROCESSOR)) {
	require 'machine/lock.ph';
    }
    if(defined(&MULTIPROCESSOR)) {
    } else {
    }
    if(defined(&_KERNEL)) {
	if(defined( &MULTIPROCESSOR)  && defined( &LOCKDEBUG)) {
	    undef(&LOCKDEBUG) if defined(&LOCKDEBUG);
	}
	if(!defined( &MULTIPROCESSOR) || 1) {
	    eval 'sub SLOCK_LOCKED () {1;}' unless defined(&SLOCK_LOCKED);
	    eval 'sub SLOCK_UNLOCKED () {0;}' unless defined(&SLOCK_UNLOCKED);
	    unless(defined(&LOCKDEBUG)) {
		eval 'sub simple_lock {
		    my($lkp) = @_;
    		    eval q();
		}' unless defined(&simple_lock);
		eval 'sub simple_lock_try {
		    my($lkp) = @_;
    		    eval q((1));
		}' unless defined(&simple_lock_try);
		eval 'sub simple_unlock {
		    my($lkp) = @_;
    		    eval q();
		}' unless defined(&simple_unlock);
		eval 'sub simple_lock_assert {
		    my($lkp) = @_;
    		    eval q();
		}' unless defined(&simple_lock_assert);
		eval 'sub simple_lock_init {
		    my($lkp) = @_;
    		    eval q({  ($lkp->{lock_data}) =  &SLOCK_UNLOCKED; });
		}' unless defined(&simple_lock_init);
	    } else {
		eval 'sub simple_unlock {
		    my($lkp) = @_;
    		    eval q( &_simple_unlock($lkp,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_unlock);
		eval 'sub simple_lock_try {
		    my($lkp) = @_;
    		    eval q( &_simple_lock_try($lkp,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_lock_try);
		eval 'sub simple_lock {
		    my($lkp) = @_;
    		    eval q( &_simple_lock($lkp,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_lock);
		eval 'sub simple_lock_assert {
		    my($lkp, $state) = @_;
    		    eval q( &_simple_lock_assert($lkp, $state,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_lock_assert);
	    }
	} else {
	    eval 'sub simple_lock {
	        my($lkp) = @_;
    		eval q({  &__cpu_simple_lock( ($lkp->{lock_data})); });
	    }' unless defined(&simple_lock);
	    eval 'sub simple_lock_try {
	        my($lkp) = @_;
    		eval q({ ( &__cpu_simple_lock_try( ($lkp->{lock_data}))); });
	    }' unless defined(&simple_lock_try);
	    eval 'sub simple_unlock {
	        my($lkp) = @_;
    		eval q({  &__cpu_simple_unlock( ($lkp->{lock_data})); });
	    }' unless defined(&simple_unlock);
	}
    }
}
1;
