[SYSTEM] Apply patch from Fedora.
authorAlexey Gladkov <legion@altlinux.org>
Sun, 28 Jan 2007 21:19:31 +0000 (00:19 +0300)
committerAlexey Gladkov <legion@altlinux.org>
Sun, 28 Jan 2007 21:19:31 +0000 (00:19 +0300)
Apply kbd-1.12-sparc.patch patch from Fedora distribution.
Patch fix kbdrate for Sparc architecture.

Signed-off-by: Alexey Gladkov <legion@altlinux.org>
man/man8/kbdrate.8
src/kbdrate.c
src/setleds.c

index e0fd890..16d22a3 100644 (file)
@@ -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 interface as on i386 is assumed.
 .I /etc/rc.local
 .br
 .I /dev/port
+.br
+.I /dev/kbd
index 1149309..e3020df 100644 (file)
@@ -77,7 +77,6 @@ beats rebuilding the kernel!
 
 #ifdef __sparc__
 #include <asm/param.h>
-#include <asm/kbio.h>
 #endif
 
 #ifndef KDKBDREP
@@ -106,8 +105,11 @@ static int valid_delays[] = { 250, 500, 750, 1000 };
 
 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. */
+          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. */
        struct kbd_repeat kbdrep_s;
 
        /* don't change, just test */
@@ -152,6 +154,9 @@ KDKBDREP_ioctl_ok(double rate, int delay, int silent) {
                        rate, kbdrep_s.delay );
 
        return 1;                       /* success! */
+#else /* no KDKBDREP or __sparc__ */
+       return 0;
+#endif /* KDKBDREP */
 }
 
 static int
@@ -196,7 +201,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 */
@@ -246,8 +251,9 @@ main( int argc, char **argv ) {
                return 0;
 
 
-       /* 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;
@@ -298,5 +304,7 @@ main( int argc, char **argv ) {
                        valid_rates[value & 0x1f] / 10.0,
                        valid_delays[ (value & 0x60) >> 5 ] );
 
+#endif
+
        return 0;
 }
index ca4cf3b..bb66202 100644 (file)
 #include "nls.h"
 #include "version.h"
 
-#ifdef __sparc__
-#include <asm/kbio.h>
-#endif
-
 static void
 usage(void)
 {