require '_h2ph_pre.ph';

unless(defined(&_LINUX_DELAY_H)) {
    eval 'sub _LINUX_DELAY_H () {1;}' unless defined(&_LINUX_DELAY_H);
    require 'linux/sched.ph';
    require 'asm/delay.ph';
    unless(defined(&MAX_UDELAY_MS)) {
	eval 'sub MAX_UDELAY_MS () {5;}' unless defined(&MAX_UDELAY_MS);
    }
    if(defined(&notdef)) {
	eval 'sub mdelay {
	    local($n) = @_;
    	    eval q(( {\'unsigned long msec\'=($n);  &while ( &msec--)  &udelay(1000);}));
	}' unless defined(&mdelay);
    } else {
	eval 'sub mdelay {
	    local($n) = @_;
    	    eval q(( ( &__builtin_constant_p($n)  && ($n)<= &MAX_UDELAY_MS) ?  &udelay(($n)*1000) : ({\'unsigned long msec\'=($n);  &while ( &msec--)  &udelay(1000);})));
	}' unless defined(&mdelay);
    }
}
1;
