summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Banon <mikebdp2@gmail.com>2018-02-23 19:32:15 +0300
committerPatrick Georgi <pgeorgi@google.com>2018-06-07 06:44:35 +0000
commitf8b54b6315af42bed685037f494fd71d825b5e8b (patch)
tree782f3065fa61f2a76442ddeb00a29af69e87a782
parent4bdfebd4d88c1d84662cae3d11de1ee40f9e0017 (diff)
downloadcoreboot-f8b54b6315af42bed685037f494fd71d825b5e8b.tar.xz
tint: make it possible to reboot by pressing 'q' key two times
Earlier it was impossible to exit without pressing the power button. Change-Id: Ia56d639fa8e563047fb3d2723695626a449ead40 Signed-off-by: Mike Banon <mikebdp2@gmail.com> Reviewed-on: https://review.coreboot.org/23853 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--payloads/external/tint/libpayload_tint.patch17
1 files changed, 14 insertions, 3 deletions
diff --git a/payloads/external/tint/libpayload_tint.patch b/payloads/external/tint/libpayload_tint.patch
index b743b2fe21..a21eabf962 100644
--- a/payloads/external/tint/libpayload_tint.patch
+++ b/payloads/external/tint/libpayload_tint.patch
@@ -376,7 +376,7 @@ diff -rupN tint-0.04+nmu1/tint.c tint/tint.c
rand_init (); /* must be called before engine_init () */
engine_init (&engine,score_function); /* must be called before using engine.curshape */
finished = shownext = FALSE;
-@@ -673,11 +692,20 @@ int main (int argc,char *argv[])
+@@ -673,11 +692,31 @@ int main (int argc,char *argv[])
/* Restore console settings and exit */
io_close ();
+#if 0
@@ -389,9 +389,20 @@ diff -rupN tint-0.04+nmu1/tint.c tint/tint.c
savescores (GETSCORE (engine.score));
}
+#endif
-+ printf("Bye.\n");
++ printf("Press 'q' to reboot...\n");
+ refresh();
-+ for(;;); //halt();
++ for (;;) {
++ in_flush ();
++ while ((ch = in_getch ()) == ERR) ; /* Wait for a key to be pressed */
++ if (ch == 'q') { /* reboot */
++ outb(0x6, 0xcf9);
++ for(;;); //halt();
++ }
++ else {
++ in_flush ();
++ }
++ }
++
+#if 0
exit (EXIT_SUCCESS);
+#endif