require '_h2ph_pre.ph';

unless(defined(&__LINUX_SMP_H)) {
    eval 'sub __LINUX_SMP_H () {1;}' unless defined(&__LINUX_SMP_H);
    require 'linux/config.ph';
    if(defined(&CONFIG_SMP)) {
	require 'linux/kernel.ph';
	require 'asm/smp.ph';
	eval 'sub MSG_ALL_BUT_SELF () {0x8000;}' unless defined(&MSG_ALL_BUT_SELF);
	eval 'sub MSG_ALL () {0x8001;}' unless defined(&MSG_ALL);
	eval 'sub MSG_INVALIDATE_TLB () {0x1;}' unless defined(&MSG_INVALIDATE_TLB);
	eval 'sub MSG_STOP_CPU () {0x2;}' unless defined(&MSG_STOP_CPU);
	eval 'sub MSG_RESCHEDULE () {0x3;}' unless defined(&MSG_RESCHEDULE);
	eval 'sub MSG_CALL_FUNCTION () {0x4;}' unless defined(&MSG_CALL_FUNCTION);
    } else {
	eval 'sub NR_CPUS () {1;}' unless defined(&NR_CPUS);
	eval 'sub smp_num_cpus () {1;}' unless defined(&smp_num_cpus);
	eval 'sub smp_processor_id () {
	    eval q(0);
	}' unless defined(&smp_processor_id);
	eval 'sub hard_smp_processor_id () {
	    eval q(0);
	}' unless defined(&hard_smp_processor_id);
	eval 'sub smp_threads_ready () {1;}' unless defined(&smp_threads_ready);
	eval 'sub kernel_lock () {
	    eval q();
	}' unless defined(&kernel_lock);
	eval 'sub cpu_logical_map {
	    local($cpu) = @_;
    	    eval q(0);
	}' unless defined(&cpu_logical_map);
	eval 'sub cpu_number_map {
	    local($cpu) = @_;
    	    eval q(0);
	}' unless defined(&cpu_number_map);
	eval 'sub smp_call_function {
	    local($func,$info,$retry,$wait) = @_;
    	    eval q(({ 0; }));
	}' unless defined(&smp_call_function);
	eval 'sub cpu_online_map () {1;}' unless defined(&cpu_online_map);
    }
}
1;
