kbd/kbd-1.15-sparc.patch

63 lines
2.0 KiB
Diff
Raw Permalink Normal View History

2020-02-10 10:24:21 +00:00
diff -up kbd-2.1.0/docs/man/man8/kbdrate.8.orig kbd-2.1.0/docs/man/man8/kbdrate.8
--- kbd-2.1.0/docs/man/man8/kbdrate.8.orig 2019-06-21 10:08:17.000000000 +0200
+++ kbd-2.1.0/docs/man/man8/kbdrate.8 2019-07-17 10:36:19.876499648 +0200
@@ -19,7 +19,7 @@ Using
2009-01-08 14:46:00 +00:00
without any options will reset the repeat rate to 10.9 characters per second (cps)
and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
-to 5 cps and the delay to 200 ms.
+to 20 cps and the delay to 200 ms.
2009-01-08 14:46:00 +00:00
.SH OPTIONS
.TP
2020-02-10 10:24:21 +00:00
diff -up kbd-2.1.0/src/kbdrate.c.orig kbd-2.1.0/src/kbdrate.c
--- kbd-2.1.0/src/kbdrate.c.orig 2019-07-02 17:44:57.000000000 +0200
+++ kbd-2.1.0/src/kbdrate.c 2019-07-17 11:07:04.732486323 +0200
@@ -114,9 +114,12 @@ static int print_only = 0;
static int
2017-01-11 13:03:59 +00:00
KDKBDREP_ioctl_ok(double rate, int delay, int silent)
{
+#if defined(KDKBDREP) && !defined(__sparc__)
2009-01-08 14:46:00 +00:00
/*
* This ioctl is defined in <linux/kd.h> but is not
* implemented anywhere - must be in some m68k patches.
2011-01-05 13:40:22 +00:00
+ * We cannot blindly try unimplemented ioctls on sparc64 -
+ * the 32<->64bit transition layer does not like it.
2009-01-08 14:46:00 +00:00
* Since 2.4.9 also on i386.
2011-01-05 13:40:22 +00:00
*/
2009-01-08 14:46:00 +00:00
struct my_kbd_repeat kbdrep_s;
2020-02-10 10:24:21 +00:00
@@ -181,6 +184,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
}
2017-01-11 13:03:59 +00:00
return 1; /* success! */
+#else /* no KDKBDREP or __sparc__ */
2011-01-05 13:40:22 +00:00
+ return 0;
+#endif /* KDKBDREP */
}
2020-02-10 10:24:21 +00:00
#ifdef KIOCSRATE
@@ -251,6 +257,9 @@ ioport_set(double rate, int delay, int s
2020-02-10 10:24:21 +00:00
/* https://wiki.osdev.org/PS/2_Keyboard */
2020-02-10 10:24:21 +00:00
+ /* The ioport way - will crash on sparc */
+
+#ifndef __sparc__
2020-02-10 10:24:21 +00:00
for (i = 0; i < (int) RATE_COUNT; i++)
if (rate * 10 >= valid_rates[i]) {
value &= 0x60;
2020-02-10 10:24:21 +00:00
@@ -304,11 +313,12 @@ ioport_set(double rate, int delay, int s
2017-01-11 13:03:59 +00:00
valid_rates[value & 0x1f] / 10.0,
valid_delays[(value & 0x60) >> 5]);
+#endif
2020-02-10 10:24:21 +00:00
return 1;
}
2020-02-10 10:24:21 +00:00
#ifdef __sparc__
-double rate = 5.0; /* Default rate */
+double rate = 20.0; /* Default rate */
int delay = 200; /* Default delay */
#else
double rate = 10.9; /* Default rate */