[syslinux] proper way to sleep
H. Peter Anvin
hpa at zytor.com
Tue Aug 21 11:26:09 PDT 2007
Erwan Velu wrote:
> I had the same problem in my com32 modules.. It could be nice to add a
> sleep(unsigned int msec) function.
>
> Can't we use such code ?
>
> unsigned char sleep(unsigned int msec)
> {
> unsigned long micro = 1000*msec;
> com32sys_t inreg,outreg;
> REG_AH(inreg) = 0x86;
> REG_CX(inreg) = (micro >> 16);
> REG_DX(inreg) = (micro & 0xFFFF);
> __intcall(0x15,&inreg,&outreg);
> return REG_AH(outreg);
> }
No, please spin on syslinux_idle(), at least for anything other than a
trivial delay. Especially PXELINUX tends to need to perform tasks while
spinning.
-hpa
More information about the Syslinux
mailing list