Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 152655 | Differences between
and this patch

Collapse All | Expand All

(-)xorg-server-1.1.1.bak/configure.ac (+18 lines)
Lines 1072-1077 Link Here
1072
		  *)
1072
		  *)
1073
			;;
1073
			;;
1074
		esac
1074
		esac
1075
1076
    # check whether struct kbd_repeat has the 'period' field.
1077
    # on kernels < 2.5.42 it's called 'rate' instead.
1078
    AC_TRY_COMPILE([
1079
#include <linux/kd.h>
1080
#ifdef __sparc__
1081
#include <asm/param.h>
1082
#endif
1083
],[
1084
int main () { 
1085
	struct kbd_repeat k;
1086
	k.period = 0;
1087
	return 0;
1088
}],
1089
		[period_field="period"],
1090
		[period_field="rate"])
1091
		AC_DEFINE_UNQUOTED(LNX_KBD_PERIOD_NAME, [$period_field],
1092
				[Name of the period field in struct kbd_repeat])
1075
		;;
1093
		;;
1076
	  freebsd*)
1094
	  freebsd*)
1077
	  	XORG_OS="freebsd"
1095
	  	XORG_OS="freebsd"
(-)xorg-server-1.1.1.bak/hw/xfree86/os-support/linux/lnx_io.c (-33 / +5 lines)
Lines 67-91 Link Here
67
	return(leds);
67
	return(leds);
68
}
68
}
69
69
70
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
71
 * from util-linux-2.9t package */
72
73
#include <linux/kd.h>
74
#include <linux/version.h>
75
#ifdef __sparc__
76
#include <asm/param.h>
77
#include <asm/kbio.h>
78
#endif
79
80
/* Deal with spurious kernel header change in struct kbd_repeat.
81
   We undo this define after the routine using that struct is over,
82
   so as not to interfere with other 'rate' elements.  */
83
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
84
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
85
#  define rate period
86
# endif
87
#endif
88
89
static int
70
static int
90
KDKBDREP_ioctl_ok(int rate, int delay) {
71
KDKBDREP_ioctl_ok(int rate, int delay) {
91
#if defined(KDKBDREP) && !defined(__sparc__)
72
#if defined(KDKBDREP) && !defined(__sparc__)
Lines 94-111 Link Here
94
   struct kbd_repeat kbdrep_s;
75
   struct kbd_repeat kbdrep_s;
95
76
96
   /* don't change, just test */
77
   /* don't change, just test */
97
   kbdrep_s.rate = -1;
78
   kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
98
   kbdrep_s.delay = -1;
79
   kbdrep_s.delay = -1;
99
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
80
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
100
       return 0;
81
       return 0;
101
   }
82
   }
102
   /* do the change */
83
   /* do the change */
103
   if (rate == 0)				/* switch repeat off */
84
   if (rate == 0)				/* switch repeat off */
104
     kbdrep_s.rate = 0;
85
     kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
105
   else
86
   else
106
     kbdrep_s.rate  = 10000 / rate;		/* convert cps to msec */
87
     kbdrep_s.LNX_KBD_PERIOD_NAME  = 10000 / rate;		/* convert cps to msec */
107
   if (kbdrep_s.rate < 1)
88
   if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
108
     kbdrep_s.rate = 1;
89
     kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
109
   kbdrep_s.delay = delay;
90
   kbdrep_s.delay = delay;
110
   if (kbdrep_s.delay < 1)
91
   if (kbdrep_s.delay < 1)
111
     kbdrep_s.delay = 1;
92
     kbdrep_s.delay = 1;
Lines 120-134 Link Here
120
#endif /* KDKBDREP */
101
#endif /* KDKBDREP */
121
}
102
}
122
103
123
#undef rate
124
125
/* Undo the earlier define for the struct kbd_repeat problem. */
126
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
127
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
128
#  undef rate
129
# endif
130
#endif
131
132
static int
104
static int
133
KIOCSRATE_ioctl_ok(int rate, int delay) {
105
KIOCSRATE_ioctl_ok(int rate, int delay) {
134
#ifdef KIOCSRATE
106
#ifdef KIOCSRATE
(-)xorg-server-1.1.1.bak/hw/xfree86/os-support/linux/lnx_kbd.c (-33 / +5 lines)
Lines 97-121 Link Here
97
    return(leds);
97
    return(leds);
98
}
98
}
99
99
100
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
101
 * from util-linux-2.9t package */
102
103
#include <linux/kd.h>
104
#include <linux/version.h>
105
#ifdef __sparc__
106
#include <asm/param.h>
107
#include <asm/kbio.h>
108
#endif
109
110
/* Deal with spurious kernel header change in struct kbd_repeat.
111
   We undo this define after the routine using that struct is over,
112
   so as not to interfere with other 'rate' elements.  */
113
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
114
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
115
#  define rate period
116
# endif
117
#endif
118
119
static int
100
static int
120
KDKBDREP_ioctl_ok(int rate, int delay) {
101
KDKBDREP_ioctl_ok(int rate, int delay) {
121
#if defined(KDKBDREP) && !defined(__sparc__)
102
#if defined(KDKBDREP) && !defined(__sparc__)
Lines 124-130 Link Here
124
   struct kbd_repeat kbdrep_s;
105
   struct kbd_repeat kbdrep_s;
125
106
126
   /* don't change, just test */
107
   /* don't change, just test */
127
   kbdrep_s.rate = -1;
108
   kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
128
   kbdrep_s.delay = -1;
109
   kbdrep_s.delay = -1;
129
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
110
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
130
       return 0;
111
       return 0;
Lines 132-142 Link Here
132
113
133
   /* do the change */
114
   /* do the change */
134
   if (rate == 0)				/* switch repeat off */
115
   if (rate == 0)				/* switch repeat off */
135
     kbdrep_s.rate = 0;
116
     kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
136
   else
117
   else
137
     kbdrep_s.rate  = 10000 / rate;		/* convert cps to msec */
118
     kbdrep_s.LNX_KBD_PERIOD_NAME  = 10000 / rate;		/* convert cps to msec */
138
   if (kbdrep_s.rate < 1)
119
   if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
139
     kbdrep_s.rate = 1;
120
     kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
140
   kbdrep_s.delay = delay;
121
   kbdrep_s.delay = delay;
141
   if (kbdrep_s.delay < 1)
122
   if (kbdrep_s.delay < 1)
142
     kbdrep_s.delay = 1;
123
     kbdrep_s.delay = 1;
Lines 151-165 Link Here
151
#endif /* KDKBDREP */
132
#endif /* KDKBDREP */
152
}
133
}
153
134
154
#undef rate
155
156
/* Undo the earlier define for the struct kbd_repeat problem. */
157
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
158
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
159
#  undef rate
160
# endif
161
#endif
162
163
static int
135
static int
164
KIOCSRATE_ioctl_ok(int rate, int delay) {
136
KIOCSRATE_ioctl_ok(int rate, int delay) {
165
#ifdef KIOCSRATE
137
#ifdef KIOCSRATE
(-)xorg-server-1.1.1.bak/include/xorg-config.h.in (+3 lines)
Lines 112-115 Link Here
112
/* Has backtrace support */
112
/* Has backtrace support */
113
#undef HAVE_BACKTRACE
113
#undef HAVE_BACKTRACE
114
114
115
/* Name of the period field in struct kbd_repeat */
116
#undef LNX_KBD_PERIOD_NAME
117
115
#endif /* _XORG_CONFIG_H_ */
118
#endif /* _XORG_CONFIG_H_ */

Return to bug 152655