xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h

xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c
//bugs.freedesktop.org/show_bug.cgi?id=825) attachment #956
    (https://bugs.freedesktop.org/attachment.cgi?id=956): Fix build
    problems on Linux/SPARC. Patch by Jeremy Huddleston
    <eradicator@gentoo.org>. Approved in the 2005-01-31 Xorg
    release-wranglers phone call.
This commit is contained in:
Roland Mainz 2005-02-02 00:55:21 +00:00
parent 15c555a25d
commit 44e2d91679
3 changed files with 17 additions and 16 deletions

View File

@ -20,13 +20,14 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.5 2002/05/22 21:38:30 herrb Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.3 2001/04/20 17:02:43 tsi Exp $ */
#ifndef _XF86_SBUS_H #ifndef _XF86_SBUS_H
#define _XF86_SBUS_H #define _XF86_SBUS_H
#if defined(linux) #if defined(linux)
#include <asm/types.h> #include <asm/types.h>
#include <linux/fb.h>
#include <asm/fbio.h> #include <asm/fbio.h>
#include <asm/openpromio.h> #include <asm/openpromio.h>
#elif defined(SVR4) #elif defined(SVR4)
@ -35,7 +36,13 @@
#elif defined(__OpenBSD__) && defined(__sparc64__) #elif defined(__OpenBSD__) && defined(__sparc64__)
/* XXX */ /* XXX */
#elif defined(CSRG_BASED) #elif defined(CSRG_BASED)
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/fbio.h>
#include <dev/ofw/openpromio.h>
#else
#include <machine/fbio.h> #include <machine/fbio.h>
#endif
#else #else
#include <sun/fbio.h> #include <sun/fbio.h>
#endif #endif

View File

@ -90,10 +90,9 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
/* don't change, just test */ /* don't change, just test */
kbdrep_s.rate = -1; kbdrep_s.rate = -1;
kbdrep_s.delay = -1; kbdrep_s.delay = -1;
if (ioctl( 0, KDKBDREP, &kbdrep_s )) { if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
return 0; return 0;
} }
/* do the change */ /* do the change */
if (rate == 0) /* switch repeat off */ if (rate == 0) /* switch repeat off */
kbdrep_s.rate = 0; kbdrep_s.rate = 0;
@ -105,7 +104,7 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
if (kbdrep_s.delay < 1) if (kbdrep_s.delay < 1)
kbdrep_s.delay = 1; kbdrep_s.delay = 1;
if (ioctl( 0, KDKBDREP, &kbdrep_s )) { if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
return 0; return 0;
} }
@ -115,6 +114,8 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#endif /* KDKBDREP */ #endif /* KDKBDREP */
} }
#undef rate
static int static int
KIOCSRATE_ioctl_ok(int rate, int delay) { KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE #ifdef KIOCSRATE
@ -130,8 +131,9 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
if (kbdrate_s.rate > 50) if (kbdrate_s.rate > 50)
kbdrate_s.rate = 50; kbdrate_s.rate = 50;
if (ioctl( fd, KIOCSRATE, &kbdrate_s )) if (ioctl( fd, KIOCSRATE, &kbdrate_s )) {
return 0; return 0;
}
close( fd ); close( fd );
@ -141,14 +143,7 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
#endif /* KIOCSRATE */ #endif /* KIOCSRATE */
} }
#undef rate
#if NeedFunctionPrototypes
void xf86SetKbdRepeat(char rad) void xf86SetKbdRepeat(char rad)
#else
void xf86SetKbdRepeat(rad)
char rad;
#endif
{ {
#ifdef __sparc__ #ifdef __sparc__
int rate = 500; /* Default rate */ int rate = 500; /* Default rate */
@ -178,7 +173,6 @@ char rad;
if (xf86Info.kbdDelay >= 0) if (xf86Info.kbdDelay >= 0)
delay = xf86Info.kbdDelay; delay = xf86Info.kbdDelay;
if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */ if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */
return; return;

View File

@ -145,6 +145,8 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#endif /* KDKBDREP */ #endif /* KDKBDREP */
} }
#undef rate
static int static int
KIOCSRATE_ioctl_ok(int rate, int delay) { KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE #ifdef KIOCSRATE
@ -172,8 +174,6 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
#endif /* KIOCSRATE */ #endif /* KIOCSRATE */
} }
#undef rate
static void static void
SetKbdRepeat(InputInfoPtr pInfo, char rad) SetKbdRepeat(InputInfoPtr pInfo, char rad)
{ {