require '_h2ph_pre.ph';

unless(defined(&_POWERPC_CPU_H_)) {
    eval 'sub _POWERPC_CPU_H_ () {1;}' unless defined(&_POWERPC_CPU_H_);
    require 'machine/frame.ph';
    require 'machine/psl.ph';
    eval 'sub CLKF_USERMODE {
        local($frame) = @_;
	    eval q(((($frame)-> &srr1 &  &PSL_PR) != 0));
    }' unless defined(&CLKF_USERMODE);
    eval 'sub CLKF_PC {
        local($frame) = @_;
	    eval q((($frame)-> &srr0));
    }' unless defined(&CLKF_PC);
    eval 'sub CLKF_INTR {
        local($frame) = @_;
	    eval q((($frame)-> &depth != 0));
    }' unless defined(&CLKF_INTR);
    eval 'sub cpu_swapout {
        local($p) = @_;
	    eval q();
    }' unless defined(&cpu_swapout);
    eval 'sub cpu_wait {
        local($p) = @_;
	    eval q();
    }' unless defined(&cpu_wait);
    eval 'sub DELAY {
        local($n) = @_;
	    eval q( &delay($n));
    }' unless defined(&DELAY);
    eval 'sub need_resched () {
        eval q(( &want_resched = 1,  &astpending = 1));
    }' unless defined(&need_resched);
    eval 'sub need_proftick {
        local($p) = @_;
	    eval q((($p)-> &p_flag |=  &P_OWEUPC,  &astpending = 1));
    }' unless defined(&need_proftick);
    eval 'sub signotify {
        local($p) = @_;
	    eval q(( &astpending = 1));
    }' unless defined(&signotify);
    unless(defined(&CACHELINESIZE)) {
	eval 'sub CACHELINESIZE () {32;}' unless defined(&CACHELINESIZE);
    }
}
1;
