summaryrefslogtreecommitdiff
path: root/source/a/kbd/sources/kbd-1.15-sparc.patch
blob: a858a253a3bc1ae9bf3c143130f4decb4c4c1d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff -up kbd-1.15/man/man8/kbdrate.8_old kbd-1.15/man/man8/kbdrate.8
--- kbd-1.15/man/man8/kbdrate.8_old	2008-12-10 14:20:33.000000000 +0100
+++ kbd-1.15/man/man8/kbdrate.8	2008-12-10 14:41:10.000000000 +0100
@@ -22,7 +22,7 @@ Using
 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.
 
 .SH OPTIONS
 .TP
@@ -69,3 +69,5 @@ When these ioctls fail an ioport interfa
 .I /etc/rc.local
 .br
 .I /dev/port
+.br
+.I /dev/kbd
diff -up kbd-1.15/src/kbdrate.c_old kbd-1.15/src/kbdrate.c
--- kbd-1.15/src/kbdrate.c_old	2008-12-10 14:00:25.000000000 +0100
+++ kbd-1.15/src/kbdrate.c	2008-12-10 14:20:11.000000000 +0100
@@ -77,7 +77,6 @@ beats rebuilding the kernel!
 
 #ifdef __sparc__
 #include <asm/param.h>
-#include <asm/kbio.h>
 #endif
 
 #ifndef KDKBDREP
@@ -109,11 +108,15 @@ static int valid_delays[] = { 250, 500, 
 
 static int
 KDKBDREP_ioctl_ok(double rate, int delay, int silent) {
+#if defined(KDKBDREP) && !defined(__sparc__)
 	/*
 	 * This ioctl is defined in <linux/kd.h> but is not
 	 * implemented anywhere - must be in some m68k patches.
+         * We cannot blindly try unimplemented ioctls on sparc64 -
+         * the 32<->64bit transition layer does not like it.
 	 * Since 2.4.9 also on i386.
-	 */
+         */
+
 	struct my_kbd_repeat kbdrep_s;
 
 	/* don't change, just test */
@@ -177,6 +180,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
 			rate, kbdrep_s.delay );
 
 	return 1;			/* success! */
+#else /* no KDKBDREP or __sparc__ */
+        return 0;
+#endif /* KDKBDREP */
 }
 
 static int
@@ -221,7 +227,7 @@ sigalrmhandler( int sig ) {
 int
 main( int argc, char **argv ) {
 #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 */
@@ -272,7 +278,9 @@ main( int argc, char **argv ) {
 
 
 	/* The ioport way */
+        /* The ioport way - will crash on sparc */
 
+#ifndef __sparc__
 	for (i = 0; i < RATE_COUNT; i++)
 		if (rate * 10 >= valid_rates[i]) {
 			value &= 0x60;
@@ -335,5 +343,7 @@ main( int argc, char **argv ) {
 			valid_rates[value & 0x1f] / 10.0,
 			valid_delays[ (value & 0x60) >> 5 ] );
 
+#endif
+
 	return 0;
 }
diff -up kbd-1.15/src/setleds.c_old kbd-1.15/src/setleds.c
--- kbd-1.15/src/setleds.c_old	2008-12-10 14:00:02.000000000 +0100
+++ kbd-1.15/src/setleds.c	2008-12-10 14:00:16.000000000 +0100
@@ -14,10 +14,6 @@
 #include "nls.h"
 #include "version.h"
 
-#ifdef __sparc__
-#include <asm/kbio.h>
-#endif
-
 static void
 usage(void)
 {