require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_POOL_H_)) {
    eval 'sub _SYS_POOL_H_ () {1;}' unless defined(&_SYS_POOL_H_);
    eval 'sub KERN_POOL_NPOOLS () {1;}' unless defined(&KERN_POOL_NPOOLS);
    eval 'sub KERN_POOL_NAME () {2;}' unless defined(&KERN_POOL_NAME);
    eval 'sub KERN_POOL_POOL () {3;}' unless defined(&KERN_POOL_POOL);
    require 'sys/lock.ph';
    require 'sys/queue.ph';
    require 'sys/time.ph';
    require 'sys/tree.ph';
    eval 'sub PA_INITIALIZED () {0x1;}' unless defined(&PA_INITIALIZED);
    eval 'sub PA_WANT () {0x2;}' unless defined(&PA_WANT);
    eval 'sub PR_MALLOCOK () {0x1;}' unless defined(&PR_MALLOCOK);
    eval 'sub PR_NOWAIT () {0x;}' unless defined(&PR_NOWAIT);
    eval 'sub PR_WAITOK () {0x2;}' unless defined(&PR_WAITOK);
    eval 'sub PR_WANTED () {0x4;}' unless defined(&PR_WANTED);
    eval 'sub PR_PHINPAGE () {0x8;}' unless defined(&PR_PHINPAGE);
    eval 'sub PR_LOGGING () {0x10;}' unless defined(&PR_LOGGING);
    eval 'sub PR_LIMITFAIL () {0x20;}' unless defined(&PR_LIMITFAIL);
    eval 'sub PR_DEBUG () {0x40;}' unless defined(&PR_DEBUG);
    if(defined(&_KERNEL)) {
	if(defined(&POOL_DIAGNOSTIC)) {
	    eval 'sub pool_get {
	        my($h, $f) = @_;
    		eval q( &_pool_get(($h), ($f),  &__FILE__,  &__LINE__));
	    }' unless defined(&pool_get);
	    eval 'sub pool_put {
	        my($h, $v) = @_;
    		eval q( &_pool_put(($h), ($v),  &__FILE__,  &__LINE__));
	    }' unless defined(&pool_put);
	    eval 'sub pool_reclaim {
	        my($h) = @_;
    		eval q( &_pool_reclaim(($h),  &__FILE__,  &__LINE__));
	    }' unless defined(&pool_reclaim);
	}
	if(defined(&DDB)) {
	}
    }
}
1;
