Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37405551
en ru br
Репозитории ALT
S:4.04-alt19
D:3.61-alt1
5.1: 3.63-alt4
4.1: 3.36-alt2
4.0: 3.36-alt2
3.0: 2.11-alt1
www.altlinux.org/Changes

Группа :: Система/Ядро и оборудование
Пакет: syslinux

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: syslinux-4.04-timeout.diff
Скачать


diff --git a/core/ui.inc b/core/ui.inc
index 0a4bb56..97945c9 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -529,30 +529,36 @@ kernel_corrupt: mov si,err_notkernel
 ; which can be adjusted by the caller based on the corresponding
 ; master variables; on return they're updated.
 ;
-; This cheats.  If we say "no timeout" we actually get a timeout of
-; 7.5 years.
-;
 getchar_timeout:
 		call vgashowcursor
 		call reset_idle
 
 .loop:
-		push word [__jiffies]
+		push dword [__jiffies]
 		call pollchar
 		jnz .got_char
 		call do_idle
-		pop ax
-		cmp ax,[__jiffies]		; Has the timer advanced?
+		pop eax
+		sub eax,[__jiffies]		; Has the timer advanced?
 		je .loop
 
-		dec dword [ThisKbdTo]
-		jz .timeout
-		dec dword [ThisTotalTo]
-		jnz .loop
+		; more than one tick may have passed, keep the diff in eax
+		neg eax
+
+		cmp dword [ThisKbdTo],0
+		jz .chk_total
+		sub [ThisKbdTo],eax
+		jbe .timeout
+
+.chk_total:
+		cmp dword [ThisTotalTo],0
+		jz .loop
+		sub [ThisTotalTo],eax
+		ja .loop
 
 .timeout:
 		; Timeout!!!!
-		pop cx				; Discard return address
+		pop ecx				; Discard return address
 		call vgahidecursor
 		mov si,Ontimeout		; Copy ontimeout command
 		mov di,command_line
@@ -561,7 +567,7 @@ getchar_timeout:
 		jmp command_done
 
 .got_char:
-		pop cx				; Discard
+		pop ecx				; Discard
 		call getchar
 		call vgahidecursor
 		ret
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin