Blame SOURCES/kbd-1.15-sparc.patch

ce9fa7
diff -up kbd-1.15.2/man/man8/kbdrate.8.orig kbd-1.15.2/man/man8/kbdrate.8
ce9fa7
--- kbd-1.15.2/man/man8/kbdrate.8.orig	2009-06-07 21:48:42.000000000 +0200
ce9fa7
+++ kbd-1.15.2/man/man8/kbdrate.8	2011-01-05 12:58:34.579706016 +0100
ce9fa7
@@ -22,7 +22,7 @@ Using
ce9fa7
 without any options will reset the repeat rate to 10.9 characters per second (cps)
ce9fa7
 and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
ce9fa7
 These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
ce9fa7
-to 5 cps and the delay to 200 ms.
ce9fa7
+to 20 cps and the delay to 200 ms.
ce9fa7
 
ce9fa7
 .SH OPTIONS
ce9fa7
 .TP
ce9fa7
@@ -69,3 +69,5 @@ When these ioctls fail an ioport interfa
ce9fa7
 .I /etc/rc.local
ce9fa7
 .br
ce9fa7
 .I /dev/port
ce9fa7
+.br
ce9fa7
+.I /dev/kbd
ce9fa7
diff -up kbd-1.15.2/src/kbdrate.c.orig kbd-1.15.2/src/kbdrate.c
ce9fa7
--- kbd-1.15.2/src/kbdrate.c.orig	2011-01-05 12:53:45.186575833 +0100
ce9fa7
+++ kbd-1.15.2/src/kbdrate.c	2011-01-05 12:57:37.746753646 +0100
ce9fa7
@@ -108,9 +108,12 @@ static int valid_delays[] = { 250, 500, 
ce9fa7
 
ce9fa7
 static int
ce9fa7
 KDKBDREP_ioctl_ok(double rate, int delay, int silent) {
ce9fa7
+#if defined(KDKBDREP) && !defined(__sparc__)
ce9fa7
 	/*
ce9fa7
 	 * This ioctl is defined in <linux/kd.h> but is not
ce9fa7
 	 * implemented anywhere - must be in some m68k patches.
ce9fa7
+	 * We cannot blindly try unimplemented ioctls on sparc64 -
ce9fa7
+	 * the 32<->64bit transition layer does not like it.
ce9fa7
 	 * Since 2.4.9 also on i386.
ce9fa7
 	 */
ce9fa7
 	struct my_kbd_repeat kbdrep_s;
ce9fa7
@@ -176,6 +179,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
ce9fa7
 			rate, kbdrep_s.delay );
ce9fa7
 
ce9fa7
 	return 1;			/* success! */
ce9fa7
+#else /* no KDKBDREP or __sparc__ */
ce9fa7
+	return 0;
ce9fa7
+#endif /* KDKBDREP */
ce9fa7
 }
ce9fa7
 
ce9fa7
 #ifndef KIOCSRATE
ce9fa7
@@ -226,7 +232,7 @@ sigalrmhandler( attr_unused int sig ) {
ce9fa7
 int
ce9fa7
 main( int argc, char **argv ) {
ce9fa7
 #ifdef __sparc__
ce9fa7
-	double      rate = 5.0;      /* Default rate */
ce9fa7
+	double      rate = 20.0;     /* Default rate */
ce9fa7
 	int         delay = 200;     /* Default delay */
ce9fa7
 #else
ce9fa7
 	double      rate = 10.9;     /* Default rate */
ce9fa7
@@ -277,7 +283,9 @@ main( int argc, char **argv ) {
ce9fa7
 
ce9fa7
 
ce9fa7
 	/* The ioport way */
ce9fa7
+	/* The ioport way - will crash on sparc */
ce9fa7
 
ce9fa7
+#ifndef __sparc__
ce9fa7
 	for (i = 0; i < RATE_COUNT; i++)
ce9fa7
 		if (rate * 10 >= valid_rates[i]) {
ce9fa7
 			value &= 0x60;
ce9fa7
@@ -340,5 +348,7 @@ main( int argc, char **argv ) {
ce9fa7
 			valid_rates[value & 0x1f] / 10.0,
ce9fa7
 			valid_delays[ (value & 0x60) >> 5 ] );
ce9fa7
 
ce9fa7
+#endif
ce9fa7
+
ce9fa7
 	return 0;
ce9fa7
 }