[SeaBIOS] [PATCH 2/3] ps2: Eliminate "etc/ps2-poll-only"; use CONFIG_HARDWARE_IRQ instead

Kevin O'Connor kevin at koconnor.net
Mon Aug 17 17:21:56 CET 2015


The "etc/ps2-poll-only" runtime setting is directly tied to the new
CONFIG_HARDWARE_IRQ setting - use the compile time setting to control
both.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 docs/Runtime_config.md |  1 -
 src/hw/ps2port.c       | 16 ++++++----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/docs/Runtime_config.md b/docs/Runtime_config.md
index 962a8a9..4ac0eae 100644
--- a/docs/Runtime_config.md
+++ b/docs/Runtime_config.md
@@ -180,7 +180,6 @@ There are several additional configuration options available in the
 | boot-fail-wait      | If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found
 | extra-pci-roots     | If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.
 | ps2-keyboard-spinup | Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.
-| ps2-poll-only       | SeaBIOS normally sets up the PS2 port to generate interrupts on keyboard and mouse events. One may set this field to a non-zero value to have SeaBIOS periodically poll the PS2 port for events instead. This may be useful on machines that do not properly route PS2 port interrupts.
 | optionroms-checksum | Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.
 | pci-optionrom-exec  | Controls option ROM execution for roms found on PCI devices (as opposed to roms found in CBFS/fw_cfg).  Valid values are 0: Execute no ROMs, 1: Execute only VGA ROMs, 2: Execute all ROMs. The default is 2 (execute all ROMs).
 | s3-resume-vga-init  | Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.
diff --git a/src/hw/ps2port.c b/src/hw/ps2port.c
index c368afc..d5504f7 100644
--- a/src/hw/ps2port.c
+++ b/src/hw/ps2port.c
@@ -211,7 +211,6 @@ ps2_sendbyte(int aux, u8 command, int timeout)
 }
 
 u8 Ps2ctr VARLOW = I8042_CTR_KBDDIS | I8042_CTR_AUXDIS;
-u8 Ps2poll VARFSEG;
 
 static int
 __ps2_command(int aux, int command, u8 *param)
@@ -345,10 +344,9 @@ ps2_mouse_command(int command, u8 *param)
 
     // Update ps2ctr for mouse enable/disable.
     if (command == PSMOUSE_CMD_ENABLE || command == PSMOUSE_CMD_DISABLE) {
-        u8 ps2poll = GET_GLOBAL(Ps2poll);
         u8 ps2ctr = GET_LOW(Ps2ctr);
         if (command == PSMOUSE_CMD_ENABLE)
-            ps2ctr = ((ps2ctr | (ps2poll ? 0 : I8042_CTR_AUXINT))
+            ps2ctr = ((ps2ctr | (CONFIG_HARDWARE_IRQ ? I8042_CTR_AUXINT : 0))
                       & ~I8042_CTR_AUXDIS);
         else
             ps2ctr = (ps2ctr | I8042_CTR_AUXDIS) & ~I8042_CTR_AUXINT;
@@ -420,10 +418,11 @@ done:
     pic_eoi1();
 }
 
+// Check for ps2 activity on machines without hardware irqs
 void
 ps2_check_event(void)
 {
-    if (! CONFIG_PS2PORT || !GET_GLOBAL(Ps2poll))
+    if (! CONFIG_PS2PORT || CONFIG_HARDWARE_IRQ)
         return;
     u8 ps2ctr = GET_LOW(Ps2ctr);
     if ((ps2ctr & (I8042_CTR_KBDDIS|I8042_CTR_AUXDIS))
@@ -510,7 +509,7 @@ ps2_keyboard_setup(void *data)
 
     // Keyboard Mode: disable mouse, scan code convert, enable kbd IRQ
     Ps2ctr = (I8042_CTR_AUXDIS | I8042_CTR_XLATE
-              | (Ps2poll ? 0 : I8042_CTR_KBDINT));
+              | (CONFIG_HARDWARE_IRQ ? I8042_CTR_KBDINT : 0));
 
     /* Enable keyboard */
     ret = ps2_kbd_command(ATKBD_CMD_ENABLE, NULL);
@@ -528,11 +527,8 @@ ps2port_setup(void)
         return;
     dprintf(3, "init ps2port\n");
 
-    Ps2poll = romfile_loadint("etc/ps2-poll-only", 0);
-    if (!Ps2poll) {
-        enable_hwirq(1, FUNC16(entry_09));
-        enable_hwirq(12, FUNC16(entry_74));
-    }
+    enable_hwirq(1, FUNC16(entry_09));
+    enable_hwirq(12, FUNC16(entry_74));
 
     run_thread(ps2_keyboard_setup, NULL);
 }
-- 
1.9.3




More information about the SeaBIOS mailing list