~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to pc-bios/bios-pq/0018-bochs-bios-Make-boot-prompt-optional.patch

  • Committer: Blue Swirl
  • Date: 2009-08-31 15:14:40 UTC
  • Revision ID: git-v1:528e93a9787ccfc59582a44035f5f342caf5b84f
Fix breakage due to __thread

Thread-local storage is not supported on all hosts.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From fff8ffe1c92474ee58ebd6da82fede0ab7929214 Mon Sep 17 00:00:00 2001
 
2
From: Jan Kiszka <jan.kiszka@web.de>
 
3
Date: Thu, 2 Jul 2009 00:11:44 +0200
 
4
Subject: [PATCH 2/2] bochs-bios: Make boot prompt optional
 
5
 
 
6
Check via QEMU's firmware configuration interface if the boot prompt
 
7
should be given. This allows to disable the prompt with its several
 
8
seconds long delay, speeding up the common boot case.
 
9
 
 
10
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
 
11
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
 
12
---
 
13
 bios/rombios.c |   19 +++++++++++++++++++
 
14
 bios/rombios.h |    1 +
 
15
 2 files changed, 20 insertions(+), 0 deletions(-)
 
16
 
 
17
diff --git a/bios/rombios.c b/bios/rombios.c
 
18
index 0f13b53..560e6d5 100644
 
19
--- a/bios/rombios.c
 
20
+++ b/bios/rombios.c
 
21
@@ -2015,6 +2015,21 @@ Bit16u i; ipl_entry_t *e;
 
22
 }
 
23
 
 
24
 #if BX_ELTORITO_BOOT
 
25
+#ifdef BX_QEMU
 
26
+int
 
27
+qemu_cfg_probe_bootkey()
 
28
+{
 
29
+  outw(QEMU_CFG_CTL_PORT, QEMU_CFG_SIGNATURE);
 
30
+  if (inb(QEMU_CFG_DATA_PORT) != 'Q' ||
 
31
+      inb(QEMU_CFG_DATA_PORT) != 'E' ||
 
32
+      inb(QEMU_CFG_DATA_PORT) != 'M' ||
 
33
+      inb(QEMU_CFG_DATA_PORT) != 'U') return 1;
 
34
+
 
35
+  outw(QEMU_CFG_CTL_PORT, QEMU_CFG_BOOT_MENU);
 
36
+  return inb(QEMU_CFG_DATA_PORT);
 
37
+}
 
38
+#endif // BX_QEMU
 
39
+
 
40
   void
 
41
 interactive_bootkey()
 
42
 {
 
43
@@ -2026,6 +2041,10 @@ interactive_bootkey()
 
44
   Bit16u ss = get_SS();
 
45
   Bit16u valid_choice = 0;
 
46
 
 
47
+#ifdef BX_QEMU
 
48
+  if (!qemu_cfg_probe_bootkey()) return;
 
49
+#endif
 
50
+
 
51
   while (check_for_keystroke())
 
52
     get_keystroke();
 
53
 
 
54
diff --git a/bios/rombios.h b/bios/rombios.h
 
55
index 59ce19d..8ece2ee 100644
 
56
--- a/bios/rombios.h
 
57
+++ b/bios/rombios.h
 
58
@@ -64,6 +64,7 @@
 
59
 #define QEMU_CFG_ID               0x01
 
60
 #define QEMU_CFG_UUID             0x02
 
61
 #define QEMU_CFG_NUMA             0x0d
 
62
+#define QEMU_CFG_BOOT_MENU        0x0e
 
63
 #define QEMU_CFG_ARCH_LOCAL       0x8000
 
64
 #define QEMU_CFG_ACPI_TABLES      (QEMU_CFG_ARCH_LOCAL + 0)
 
65
 #define QEMU_CFG_SMBIOS_ENTRIES   (QEMU_CFG_ARCH_LOCAL + 1)
 
66
-- 
 
67
1.6.2.5
 
68