require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_PCU_H_)) {
    eval 'sub _SYS_PCU_H_ () {1;}' unless defined(&_SYS_PCU_H_);
    if(!defined(&_KERNEL)  && !defined(&_KMEMUSER)) {
	die("not supposed to be exposed to userland");
    }
    unless(defined(&_KERNEL)) {
	require 'stdbool.ph';
    }
    unless(defined(&PCU_UNIT_COUNT)) {
	eval 'sub PCU_UNIT_COUNT () {0;}' unless defined(&PCU_UNIT_COUNT);
    }
    if((defined(&PCU_UNIT_COUNT) ? &PCU_UNIT_COUNT : undef) > 0) {
	eval 'sub PCU_VALID () {0x1;}' unless defined(&PCU_VALID);
	eval 'sub PCU_REENABLE () {0x2;}' unless defined(&PCU_REENABLE);
    } else {
	eval 'sub pcu_switchpoint {
	    my($l) = @_;
    	    eval q();
	}' unless defined(&pcu_switchpoint);
	eval 'sub pcu_discard_all {
	    my($l) = @_;
    	    eval q();
	}' unless defined(&pcu_discard_all);
	eval 'sub pcu_save_all {
	    my($l) = @_;
    	    eval q();
	}' unless defined(&pcu_save_all);
    }
}
1;
