require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SPARC64_LOCK_H_)) {
    eval 'sub _SPARC64_LOCK_H_ () {1;}' unless defined(&_SPARC64_LOCK_H_);
    require 'machine/atomic.ph';
    require 'machine/ctlreg.ph';
    eval 'sub __SIMPLELOCK_LOCKED () {0xff;}' unless defined(&__SIMPLELOCK_LOCKED);
    eval 'sub __SIMPLELOCK_UNLOCKED () {0x;}' unless defined(&__SIMPLELOCK_UNLOCKED);
    eval 'sub rw_cas {
        my($p, $o, $n) = @_;
	    eval q(( &sparc64_casx($p, $o, $n) != $o));
    }' unless defined(&rw_cas);
}
1;
