From 6b726160869063e7ec880af834dd912edf81c8d131899c2b90d3360bbb209db1 Mon Sep 17 00:00:00 2001 From: Steffen Winterfeldt Date: Fri, 21 Mar 2014 12:11:39 +0000 Subject: [PATCH] - fix timeout counter to work more accurate (bnc #691211) OBS-URL: https://build.opensuse.org/package/show/system:install:head/syslinux?expand=0&rev=63 --- syslinux-4.04-timeout.diff | 61 ++++++++++++++++++++++++++++++++++++++ syslinux.changes | 5 ++++ syslinux.spec | 2 ++ 3 files changed, 68 insertions(+) create mode 100644 syslinux-4.04-timeout.diff diff --git a/syslinux-4.04-timeout.diff b/syslinux-4.04-timeout.diff new file mode 100644 index 0000000..b5c7a33 --- /dev/null +++ b/syslinux-4.04-timeout.diff @@ -0,0 +1,61 @@ +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 diff --git a/syslinux.changes b/syslinux.changes index 510c566..295490b 100644 --- a/syslinux.changes +++ b/syslinux.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 21 13:10:04 CET 2014 - snwint@suse.de + +- fix timeout counter to work more accurate (bnc #691211) + ------------------------------------------------------------------- Wed Mar 5 16:23:01 CET 2014 - snwint@suse.de diff --git a/syslinux.spec b/syslinux.spec index 534f705..165b624 100644 --- a/syslinux.spec +++ b/syslinux.spec @@ -48,6 +48,7 @@ Patch10: %{name}-%{version}-isohybrid_mbr.diff Patch11: %{name}-%{version}-localboot.diff Patch12: %{name}-%{version}-geometry.diff Patch13: %{name}-%{version}-nostrip.diff +Patch14: %{name}-%{version}-timeout.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -77,6 +78,7 @@ Authors: %patch11 -p1 %patch12 -p1 %patch13 -p0 +%patch14 -p1 %build cp %{SOURCE2} .