require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_POWERPC_MUTEX_H_)) {
    eval 'sub _POWERPC_MUTEX_H_ () {1;}' unless defined(&_POWERPC_MUTEX_H_);
    eval 'sub MUTEX_INITIALIZER {
        my($ipl) = @_;
	    eval q({ ($ipl), 0,  &NULL });
    }' unless defined(&MUTEX_INITIALIZER);
    eval 'sub MUTEX_ASSERT_LOCKED {
        my($mtx) = @_;
	    eval q( &do {  &if (($mtx)-> &mtx_owner !=  &curcpu())  &panic(\\"mutex %p not held in %s\\", ($mtx),  &__func__); }  &while (0));
    }' unless defined(&MUTEX_ASSERT_LOCKED);
    eval 'sub MUTEX_ASSERT_UNLOCKED {
        my($mtx) = @_;
	    eval q( &do {  &if (($mtx)-> &mtx_owner ==  &curcpu())  &panic(\\"mutex %p held in %s\\", ($mtx),  &__func__); }  &while (0));
    }' unless defined(&MUTEX_ASSERT_UNLOCKED);
    eval 'sub MUTEX_OLDIPL {
        my($mtx) = @_;
	    eval q(($mtx)-> &mtx_oldcpl);
    }' unless defined(&MUTEX_OLDIPL);
}
1;
