require '_h2ph_pre.ph';

no warnings qw(redefine misc);

if(!defined(&_SYS_CPUIO_H_)) {
    eval 'sub _SYS_CPUIO_H_ () {1;}' unless defined(&_SYS_CPUIO_H_);
    require 'sys/types.ph';
    require 'sys/time.ph';
    require 'sys/ioccom.ph';
    unless(defined(&_KERNEL)) {
	require 'limits.ph';
	require 'stdbool.ph';
    }
    eval 'sub IOC_CPU_SETSTATE () { &_IOW(ord(\'c\'), 0,  &cpustate_t);}' unless defined(&IOC_CPU_SETSTATE);
    eval 'sub IOC_CPU_GETSTATE () { &_IOWR(ord(\'c\'), 1,  &cpustate_t);}' unless defined(&IOC_CPU_GETSTATE);
    eval 'sub IOC_CPU_GETCOUNT () { &_IOR(ord(\'c\'), 2, \'int\');}' unless defined(&IOC_CPU_GETCOUNT);
    eval 'sub IOC_CPU_MAPID () { &_IOWR(ord(\'c\'), 3, \'int\');}' unless defined(&IOC_CPU_MAPID);
    eval 'sub IOC_CPU_UCODE_GET_VERSION () { &_IOWR(ord(\'c\'), 6, \'struct cpu_ucode_version\');}' unless defined(&IOC_CPU_UCODE_GET_VERSION);
    if(defined(&__i386__)) {
	eval 'sub IOC_CPU_UCODE_GET_VERSION_64 () { &_IOWR(ord(\'c\'), 6, \'struct cpu_ucode_version_64\');}' unless defined(&IOC_CPU_UCODE_GET_VERSION_64);
    }
    eval 'sub CPU_UCODE_ALL_CPUS () {(-1);}' unless defined(&CPU_UCODE_ALL_CPUS);
    eval 'sub CPU_UCODE_CURRENT_CPU () {(-2);}' unless defined(&CPU_UCODE_CURRENT_CPU);
    eval 'sub IOC_CPU_UCODE_APPLY () { &_IOW(ord(\'c\'), 7, \'struct cpu_ucode\');}' unless defined(&IOC_CPU_UCODE_APPLY);
}
1;
