require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_LOCK_H_)) {
    eval 'sub _LOCK_H_ () {1;}' unless defined(&_LOCK_H_);
    require 'sys/simplelock.ph';
    if(defined( &LOCKDEBUG)) {
    }
    eval 'sub LK_TYPE_MASK () {0xf;}' unless defined(&LK_TYPE_MASK);
    eval 'sub LK_SHARED () {0x1;}' unless defined(&LK_SHARED);
    eval 'sub LK_EXCLUSIVE () {0x2;}' unless defined(&LK_EXCLUSIVE);
    eval 'sub LK_UPGRADE () {0x3;}' unless defined(&LK_UPGRADE);
    eval 'sub LK_DOWNGRADE () {0x5;}' unless defined(&LK_DOWNGRADE);
    eval 'sub LK_RELEASE () {0x6;}' unless defined(&LK_RELEASE);
    eval 'sub LK_DRAIN () {0x7;}' unless defined(&LK_DRAIN);
    eval 'sub LK_EXTFLG_MASK () {0x700070;}' unless defined(&LK_EXTFLG_MASK);
    eval 'sub LK_NOWAIT () {0x10;}' unless defined(&LK_NOWAIT);
    eval 'sub LK_SLEEPFAIL () {0x20;}' unless defined(&LK_SLEEPFAIL);
    eval 'sub LK_CANRECURSE () {0x40;}' unless defined(&LK_CANRECURSE);
    eval 'sub LK_RECURSEFAIL () {0x200000;}' unless defined(&LK_RECURSEFAIL);
    eval 'sub LK_WANT_UPGRADE () {0x1000;}' unless defined(&LK_WANT_UPGRADE);
    eval 'sub LK_WANT_EXCL () {0x2000;}' unless defined(&LK_WANT_EXCL);
    eval 'sub LK_HAVE_EXCL () {0x4000;}' unless defined(&LK_HAVE_EXCL);
    eval 'sub LK_WAITDRAIN () {0x8000;}' unless defined(&LK_WAITDRAIN);
    eval 'sub LK_DRAINING () {0x40000;}' unless defined(&LK_DRAINING);
    eval 'sub LK_DRAINED () {0x80000;}' unless defined(&LK_DRAINED);
    eval 'sub LK_INTERLOCK () {0x10000;}' unless defined(&LK_INTERLOCK);
    eval 'sub LK_RETRY () {0x20000;}' unless defined(&LK_RETRY);
    eval 'sub LK_KERNPROC () {(( &pid_t) -2);}' unless defined(&LK_KERNPROC);
    eval 'sub LK_NOPROC () {(( &pid_t) -1);}' unless defined(&LK_NOPROC);
    eval 'sub LK_NOCPU () {(( &cpuid_t) -1);}' unless defined(&LK_NOCPU);
    if(defined( &LOCKDEBUG)) {
	eval 'sub spinlock_release_all {
	    my($l) = @_;
    	    eval q( &_spinlock_release_all(($l),  &__FILE__,  &__LINE__));
	}' unless defined(&spinlock_release_all);
	eval 'sub spinlock_acquire_count {
	    my($l, $c) = @_;
    	    eval q( &_spinlock_acquire_count(($l), ($c),  &__FILE__,  &__LINE__));
	}' unless defined(&spinlock_acquire_count);
    } else {
    }
    if(defined(&LOCKDEBUG)) {
	eval 'sub LOCK_ASSERT {
	    my($x) = @_;
    	    eval q( &KASSERT($x));
	}' unless defined(&LOCK_ASSERT);
    } else {
	eval 'sub LOCK_ASSERT {
	    my($x) = @_;
    	    eval q();
	}' unless defined(&LOCK_ASSERT);
    }
    if(!defined( &MULTIPROCESSOR)) {
	eval 'sub SIMPLELOCK () { &simplelock;}' unless defined(&SIMPLELOCK);
	eval 'sub SIMPLE_LOCK_INIT () { &simple_lock_init;}' unless defined(&SIMPLE_LOCK_INIT);
	eval 'sub SIMPLE_LOCK () { &simple_lock;}' unless defined(&SIMPLE_LOCK);
	eval 'sub SIMPLE_UNLOCK () { &simple_unlock;}' unless defined(&SIMPLE_UNLOCK);
    }
}
1;
