diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-09-01 16:58:11 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-09-01 16:59:46 -0700 |
commit | b381542a3f987dfe33cbb635beee214efc2de642 (patch) | |
tree | 31400e64610f6c4a0c3e53b2b0498e5a976b7060 /core/idle.inc | |
parent | 5d32a45d1a7801d15a69a353db2fa8f33806d298 (diff) | |
download | syslinux-b381542a3f987dfe33cbb635beee214efc2de642.tar.gz |
core: pxe: port the PXE idle function to C
Port the PXE idle function to C; make the idle hook a protected-mode
call.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/idle.inc')
-rw-r--r-- | core/idle.inc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/idle.inc b/core/idle.inc index f563def7..966b6e26 100644 --- a/core/idle.inc +++ b/core/idle.inc @@ -23,7 +23,7 @@ reset_idle: ret do_idle: - push ax + push eax push ds push es mov ax,cs @@ -58,18 +58,24 @@ do_idle: sub ax,[IdleTimer] cmp ax,TICKS_TO_IDLE jb .done - call [IdleHook] + + mov eax,[idle_hook_func] + and eax,eax + jz .no_idle_hook + pm_call eax +.no_idle_hook: cmp word [NoHalt],0 jne .done hlt .done: pop es pop ds - pop ax + pop eax .ret: ret section .data16 -IdleHook dw do_idle.ret + global idle_hook_func +idle_hook_func dd 0 NoHalt dw 0 hlt_err db 'ERROR: idle with IF=0', CR, LF, 0 |