mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-24 01:40:36 +00:00
<https://bugs.freedesktop.org/attachment.cgi?id=3463> GNU/kFreeBSD Xserver support (Robert Millan)
This commit is contained in:
parent
22b4200b01
commit
6d4b350dee
11 changed files with 111 additions and 77 deletions
|
|
@ -37,7 +37,7 @@
|
|||
#include <sys/param.h>
|
||||
#ifndef __NetBSD__
|
||||
# include <sys/sysctl.h>
|
||||
# ifdef __FreeBSD__
|
||||
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
# include <machine/sysarch.h>
|
||||
# endif
|
||||
# else
|
||||
|
|
@ -399,7 +399,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
|
|||
}
|
||||
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
|
||||
|
||||
extern int ioperm(unsigned long from, unsigned long num, int on);
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ xf86DisableIO()
|
|||
return;
|
||||
}
|
||||
|
||||
#endif /* __FreeBSD__ || __OpenBSD__ */
|
||||
#endif /* __FreeBSD_kernel__ || __OpenBSD__ */
|
||||
|
||||
#ifdef USE_ALPHA_PIO
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset);
|
|||
static void
|
||||
writeSparse32(int Value, pointer Base, register unsigned long Offset);
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
extern int sysarch(int, void *);
|
||||
#endif
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ struct parms {
|
|||
static int
|
||||
sethae(u_int64_t hae)
|
||||
{
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#ifndef ALPHA_SETHAE
|
||||
#define ALPHA_SETHAE 0
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@
|
|||
#include "xf86_OSlib.h"
|
||||
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
static Bool KeepTty = FALSE;
|
||||
static int devConsoleFd = -1;
|
||||
|
|
@ -80,6 +82,10 @@ static int initialVT = -1;
|
|||
#define WSCONS_PCVT_COMPAT_CONSOLE_DEV "/dev/ttyE0"
|
||||
#endif
|
||||
|
||||
#ifdef __GLIBC__
|
||||
#define setpgrp setpgid
|
||||
#endif
|
||||
|
||||
#define CHECK_DRIVER_MSG \
|
||||
"Check your kernel's console driver configuration and /dev entries"
|
||||
|
||||
|
|
@ -239,11 +245,11 @@ xf86OpenConsole()
|
|||
* switching anymore. Here we check for FreeBSD 3.1 and up.
|
||||
* Add cases for other *BSD that behave the same.
|
||||
*/
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
uname (&uts);
|
||||
if (strcmp(uts.sysname, "FreeBSD") == 0) {
|
||||
i = atof(uts.release) * 100;
|
||||
if (i >= 310) goto acquire_vt;
|
||||
}
|
||||
i = atof(uts.release) * 100;
|
||||
if (i >= 310) goto acquire_vt;
|
||||
#endif
|
||||
/* otherwise fall through */
|
||||
case PCVT:
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
|
|
@ -148,7 +149,7 @@ xf86SetKbdRepeat(char rad)
|
|||
}
|
||||
|
||||
#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
|
||||
static struct termio kbdtty;
|
||||
static struct termios kbdtty;
|
||||
#endif
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ static KbdProtocolRec protocols[] = {
|
|||
};
|
||||
|
||||
typedef struct {
|
||||
struct termio kbdtty;
|
||||
struct termios kbdtty;
|
||||
} BsdKbdPrivRec, *BsdKbdPrivPtr;
|
||||
|
||||
static
|
||||
|
|
@ -74,10 +75,16 @@ SetKbdLeds(InputInfoPtr pInfo, int leds)
|
|||
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
|
||||
int real_leds = 0;
|
||||
|
||||
#ifdef LED_CAP
|
||||
if (leds & XLED1) real_leds |= LED_CAP;
|
||||
#endif
|
||||
#ifdef LED_NUM
|
||||
if (leds & XLED2) real_leds |= LED_NUM;
|
||||
#endif
|
||||
#ifdef LED_SCR
|
||||
if (leds & XLED3) real_leds |= LED_SCR;
|
||||
if (leds & XLED4) real_leds |= LED_SCR;
|
||||
#endif
|
||||
|
||||
switch (pKbd->consType) {
|
||||
|
||||
|
|
@ -119,9 +126,15 @@ GetKbdLeds(InputInfoPtr pInfo)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef LED_CAP
|
||||
if (real_leds & LED_CAP) leds |= XLED1;
|
||||
#endif
|
||||
#ifdef LED_NUM
|
||||
if (real_leds & LED_NUM) leds |= XLED2;
|
||||
#endif
|
||||
#ifdef LED_SCR
|
||||
if (real_leds & LED_SCR) leds |= XLED3;
|
||||
#endif
|
||||
|
||||
return(leds);
|
||||
}
|
||||
|
|
@ -311,16 +324,20 @@ Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
|
|||
case KEY_F8:
|
||||
case KEY_F9:
|
||||
case KEY_F10:
|
||||
#ifdef VT_ACTIVATE
|
||||
if (down) {
|
||||
ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
case KEY_F11:
|
||||
case KEY_F12:
|
||||
#ifdef VT_ACTIVATE
|
||||
if (down) {
|
||||
ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
static void usbSigioReadInput (int fd, void *closure);
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
/* These are for FreeBSD */
|
||||
#define DEFAULT_MOUSE_DEV "/dev/mouse"
|
||||
#define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
|
||||
|
|
@ -101,7 +101,7 @@ SupportedInterfaces(void)
|
|||
{
|
||||
#if defined(__NetBSD__)
|
||||
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
|
||||
#elif defined(__FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
|
||||
#else
|
||||
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
|
||||
|
|
@ -124,7 +124,7 @@ static const char *internalNames[] = {
|
|||
* main "mouse" driver.
|
||||
*/
|
||||
static const char *miscNames[] = {
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
"SysMouse",
|
||||
#endif
|
||||
NULL
|
||||
|
|
@ -153,7 +153,7 @@ CheckProtocol(const char *protocol)
|
|||
static const char *
|
||||
DefaultProtocol(void)
|
||||
{
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
return "Auto";
|
||||
#elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
|
||||
return "WSMouse";
|
||||
|
|
@ -162,7 +162,7 @@ DefaultProtocol(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
|
||||
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(MOUSE_PROTO_SYSMOUSE)
|
||||
static struct {
|
||||
int dproto;
|
||||
const char *name;
|
||||
|
|
@ -231,7 +231,7 @@ SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
|
|||
mode.rate = rate > 0 ? rate : -1;
|
||||
mode.resolution = res > 0 ? res : -1;
|
||||
mode.accelfactor = -1;
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
if (pMse->autoProbe ||
|
||||
(protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
|
||||
/*
|
||||
|
|
@ -249,7 +249,7 @@ SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
|
||||
#define MOUSED_PID_FILE "/var/run/moused.pid"
|
||||
|
||||
|
|
@ -773,7 +773,7 @@ xf86OSMouseInit(int flags)
|
|||
p->BuiltinNames = BuiltinNames;
|
||||
p->DefaultProtocol = DefaultProtocol;
|
||||
p->CheckProtocol = CheckProtocol;
|
||||
#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
|
||||
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(MOUSE_PROTO_SYSMOUSE)
|
||||
p->SetupAuto = SetupAuto;
|
||||
p->SetPS2Res = SetSysMouseRes;
|
||||
p->SetBMRes = SetSysMouseRes;
|
||||
|
|
@ -783,7 +783,7 @@ xf86OSMouseInit(int flags)
|
|||
p->SetupAuto = SetupAuto;
|
||||
p->SetMiscRes = SetMouseRes;
|
||||
#endif
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
|
||||
p->FindDevice = FindDevice;
|
||||
#endif
|
||||
p->PreInit = bsdMousePreInit;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@
|
|||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#ifdef HAS_MTRR_SUPPORT
|
||||
#ifndef __NetBSD__
|
||||
#include <sys/types.h>
|
||||
|
|
|
|||
Loading…
Reference in a new issue