require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_AARCH64_LOCK_H_)) {
    eval 'sub _AARCH64_LOCK_H_ () {1;}' unless defined(&_AARCH64_LOCK_H_);
    require 'sys/param.ph';
    if(defined(&__aarch64__)) {
	if(defined(&_HARDKERNEL)) {
	    if(defined(&SPINLOCK_BACKOFF_HOOK)) {
		undef(&SPINLOCK_BACKOFF_HOOK) if defined(&SPINLOCK_BACKOFF_HOOK);
	    }
	    eval 'sub SPINLOCK_BACKOFF_HOOK () { &asm  &volatile("yield" ::: "memory");}' unless defined(&SPINLOCK_BACKOFF_HOOK);
	}
	require 'sys/common_lock.ph';
    }
 elsif(defined(&__arm__)) {
	require 'arm/lock.ph';
    }
}
1;
