summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-03 13:47:49 -0700
committerKeith Packard <keithp@keithp.com>2011-10-03 13:47:49 -0700
commit6e965d8a185087a55b2100b817e18f05b3ce5a00 (patch)
treec1b6bb9e37942152f1ce61a2cd6df3a8b4106d0a
parent466e4b3f174bdd7a69a76eb06e6c3e3344b8adc2 (diff)
parentac5881d6d0bcf4bcc66a5d6ddde4eca950db1a5b (diff)
Merge remote-tracking branch 'koba/reviewed'
-rw-r--r--hw/xfree86/common/xf86Config.c13
-rw-r--r--hw/xfree86/common/xf86Globals.c2
-rw-r--r--hw/xfree86/common/xf86Privstr.h3
-rw-r--r--hw/xfree86/man/xorg.conf.man12
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c2
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c6
-rw-r--r--hw/xfree86/os-support/bsd/bsd_bell.c4
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c51
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c2
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c4
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c2
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h42
-rw-r--r--hw/xfree86/parser/xf86tokens.h2
13 files changed, 28 insertions, 117 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index e6c4d8f9f..d19539960 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -670,7 +670,6 @@ typedef enum {
FLAG_DISABLEVIDMODE,
FLAG_ALLOWNONLOCAL,
FLAG_ALLOWMOUSEOPENFAIL,
- FLAG_VTSYSREQ,
FLAG_SAVER_BLANKTIME,
FLAG_DPMS_STANDBYTIME,
FLAG_DPMS_SUSPENDTIME,
@@ -711,8 +710,6 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_ALLOWMOUSEOPENFAIL, "AllowMouseOpenFail", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN,
- {0}, FALSE },
{ FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER,
{0}, FALSE },
{ FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER,
@@ -850,16 +847,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value))
xf86Info.allowMouseOpenFail = value;
- if (xf86GetOptValBool(FlagOptions, FLAG_VTSYSREQ, &value)) {
-#ifdef USE_VT_SYSREQ
- xf86Info.vtSysreq = value;
- xf86Msg(X_CONFIG, "VTSysReq %s\n", value ? "enabled" : "disabled");
-#else
- if (value)
- xf86Msg(X_WARNING, "VTSysReq is not supported on this OS\n");
-#endif
- }
-
xf86Info.pmFlag = TRUE;
if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value))
xf86Info.pmFlag = !value;
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 93533ec80..e0c3da234 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -96,7 +96,6 @@ InputInfoPtr xf86InputDevs = NULL;
xf86InfoRec xf86Info = {
.consoleFd = -1,
.vtno = -1,
- .vtSysreq = FALSE,
.lastEventTime = -1,
.vtRequestsPending = FALSE,
#ifdef sun
@@ -111,7 +110,6 @@ xf86InfoRec xf86Info = {
.caughtSignal = FALSE,
.currentScreen = NULL,
#ifdef CSRG_BASED
- .screenFd = -1,
.consType = -1,
#endif
.allowMouseOpenFail = FALSE,
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 14cd56a26..79bc8a084 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -57,7 +57,6 @@ typedef enum {
typedef struct {
int consoleFd;
int vtno;
- Bool vtSysreq;
/* event handler part */
int lastEventTime;
@@ -76,8 +75,6 @@ typedef struct {
/* graphics part */
ScreenPtr currentScreen;
#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
- int screenFd; /* fd for memory mapped access to
- * vga card */
int consType; /* Which console driver? */
#endif
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 62c491cb2..7f98851b6 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -560,18 +560,6 @@ drivers to not report failure if the mouse device can't be opened/initialised.
It has no effect on the evdev(__drivermansuffix__) or other drivers.
Default: false.
.TP 7
-.BI "Option \*qVTSysReq\*q \*q" boolean \*q
-enables the SYSV\-style VT switch sequence for non\-SYSV systems
-which support VT switching.
-This sequence is
-.B Alt\-SysRq
-followed by a function key
-.RB ( Fn ).
-This prevents the __xservername__ server trapping the
-keys used for the default VT switch sequence, which means that clients can
-access them.
-Default: off.
-.TP 7
.BI "Option \*qBlankTime\*q \*q" time \*q
sets the inactivity timeout for the
.B blank
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index bb3a5cb47..15eb2a422 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -340,7 +340,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
+ MAP_FLAGS, xf86Info.consoleFd,
(unsigned long)Base + BUS_BASE);
if (base == MAP_FAILED)
{
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 482d53fc3..eb631a7f3 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -213,7 +213,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
+ MAP_FLAGS, xf86Info.consoleFd,
(unsigned long)Base - 0xA0000);
if (base == MAP_FAILED)
{
@@ -306,7 +306,7 @@ checkMapInfo(Bool warn, int Region)
if(!memAccP->Checked)
{
- if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
+ if(ioctl(xf86Info.consoleFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
{
if(warn)
{
@@ -360,7 +360,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
Size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
- xf86Info.screenFd,
+ xf86Info.consoleFd,
(unsigned long)mapInfoP->u.map_info_mmap.map_offset))
== (pointer)-1)
{
diff --git a/hw/xfree86/os-support/bsd/bsd_bell.c b/hw/xfree86/os-support/bsd/bsd_bell.c
index 55eb75231..fb457db71 100644
--- a/hw/xfree86/os-support/bsd/bsd_bell.c
+++ b/hw/xfree86/os-support/bsd/bsd_bell.c
@@ -37,10 +37,6 @@
#include "xf86Priv.h"
#include "xf86_OSlib.h"
-#ifdef WSCONS_SUPPORT
-#define KBD_FD(i) ((i).kbdFd != -1 ? (i).kbdFd : (i).consoleFd)
-#endif
-
void
xf86OSRingBell(int loudness, int pitch, int duration)
{
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 837a2f4d1..844617980 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -41,7 +41,10 @@
#include <errno.h>
static Bool KeepTty = FALSE;
+
+#ifdef PCCONS_SUPPORT
static int devConsoleFd = -1;
+#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
static int VTnum = -1;
static int initialVT = -1;
@@ -207,11 +210,7 @@ xf86OpenConsole()
"%s: No console driver found\n\tSupported drivers: %s\n\t%s",
"xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
}
-#if 0 /* stdin is already closed in OsInit() */
- fclose(stdin);
-#endif
xf86Info.consoleFd = fd;
- xf86Info.screenFd = fd;
switch (xf86Info.consType)
{
@@ -292,13 +291,13 @@ acquire_vt:
{
FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed");
}
- #if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
+#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0)
{
FatalError("xf86OpenConsole: KDENABIO failed (%s)",
strerror(errno));
}
- #endif
+#endif
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
{
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
@@ -370,7 +369,6 @@ xf86OpenSyscons()
int fd = -1;
vtmode_t vtmode;
char vtname[12];
- struct stat status;
long syscons_version;
MessageType from;
@@ -423,20 +421,11 @@ xf86OpenSyscons()
{
/*
* All VTs are in use. If initialVT was found, use it.
- * Otherwise, if stdin is a VT, use that one.
- * XXX stdin is already closed, so this won't work.
*/
if (initialVT != -1)
{
xf86Info.vtno = initialVT;
}
- else if ((fstat(0, &status) >= 0)
- && S_ISCHR(status.st_mode)
- && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
- {
- /* stdin is a VT */
- xf86Info.vtno = minor(status.st_rdev) + 1;
- }
else
{
if (syscons_version >= 0x100)
@@ -457,11 +446,7 @@ xf86OpenSyscons()
}
close(fd);
-#ifndef __OpenBSD__
sprintf(vtname, "/dev/ttyv%01x", xf86Info.vtno - 1);
-#else
- sprintf(vtname, "/dev/ttyC%01x", xf86Info.vtno - 1);
-#endif
if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0)
{
FatalError("xf86OpenSyscons: Cannot open %s (%s)",
@@ -506,7 +491,6 @@ xf86OpenPcvt()
int fd = -1;
vtmode_t vtmode;
char vtname[12], *vtprefix;
- struct stat status;
struct pcvtid pcvt_version;
#ifndef __OpenBSD__
@@ -552,20 +536,11 @@ xf86OpenPcvt()
{
/*
* All VTs are in use. If initialVT was found, use it.
- * Otherwise, if stdin is a VT, use that one.
- * XXX stdin is already closed, so this won't work.
*/
if (initialVT != -1)
{
xf86Info.vtno = initialVT;
}
- else if ((fstat(0, &status) >= 0)
- && S_ISCHR(status.st_mode)
- && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
- {
- /* stdin is a VT */
- xf86Info.vtno = minor(status.st_rdev) + 1;
- }
else
{
FatalError("%s: Cannot find a free VT",
@@ -673,7 +648,7 @@ xf86CloseConsole()
VT.mode = VT_AUTO;
ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */
}
-#if !defined(OpenBSD) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
+#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0)
{
xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
@@ -688,25 +663,17 @@ xf86CloseConsole()
case WSCONS:
{
int mode = WSDISPLAYIO_MODE_EMUL;
- ioctl(xf86Info.screenFd, WSDISPLAYIO_SMODE, &mode);
+ ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode);
break;
}
#endif
}
- if (xf86Info.screenFd != xf86Info.consoleFd)
- {
- close(xf86Info.screenFd);
- close(xf86Info.consoleFd);
- if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
- {
- xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
- strerror(errno));
- }
- }
close(xf86Info.consoleFd);
+#ifdef PCCONS_SUPPORT
if (devConsoleFd >= 0)
close(devConsoleFd);
+#endif
return;
}
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 7aef07901..525bfb607 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -258,7 +258,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
+ MAP_FLAGS, xf86Info.consoleFd,
(unsigned long)Base - 0xA0000
);
if (base == MAP_FAILED)
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 7e3fcdb2c..aeaf18305 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -73,7 +73,7 @@ volatile unsigned char *ioBase = MAP_FAILED;
static pointer
ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
pointer base;
#ifdef DEBUG
xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
@@ -125,7 +125,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
Bool xf86EnableIO()
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
if (ioBase == MAP_FAILED)
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
index c838792b5..a2a30c9d7 100644
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -58,7 +58,7 @@ static pointer
sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
int flags)
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
pointer base;
#ifdef DEBUG
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 24c92fbbc..1d5906084 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -168,11 +168,6 @@
# define POSIX_TTY
# endif /* SVR4 */
-
-# if defined(sun) && defined(HAS_USL_VTS)
-# define USE_VT_SYSREQ
-# endif
-
#endif /* (SYSV || SVR4) */
/**************************************************************************/
@@ -207,7 +202,6 @@
# define LDSMAP PIO_SCRNMAP
# define LDNMAP LDSMAP
# define CLEARDTR_SUPPORT
-# define USE_VT_SYSREQ
# endif
# define POSIX_TTY
@@ -266,35 +260,25 @@
# else /* __bsdi__ */
# ifdef SYSCONS_SUPPORT
# define COMPAT_SYSCONS
-# if defined(__NetBSD__) || defined(__OpenBSD__)
-# include <machine/console.h>
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
+# include <sys/consio.h>
+# include <sys/kbio.h>
+# else
+# include <machine/console.h>
+# endif /* FreeBSD 4.1 RELEASE or lator */
# else
-# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
-# include <sys/consio.h>
-# include <sys/kbio.h>
-# else
-# include <machine/console.h>
-# endif /* FreeBSD 4.1 RELEASE or lator */
-# else
-# include <sys/console.h>
-# endif
+# include <sys/console.h>
# endif
# endif /* SYSCONS_SUPPORT */
-# if defined(PCVT_SUPPORT)
+# if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
# if !defined(SYSCONS_SUPPORT)
/* no syscons, so include pcvt specific header file */
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# include <machine/pcvt_ioctl.h>
# else
-# if defined(__NetBSD__) || defined(__OpenBSD__)
-# if !defined(WSCONS_SUPPORT)
-# include <machine/pcvt_ioctl.h>
-# endif /* WSCONS_SUPPORT */
-# else
-# include <sys/pcvt_ioctl.h>
-# endif /* __NetBSD__ */
-# endif /* __FreeBSD_kernel__ || __OpenBSD__ */
+# include <sys/pcvt_ioctl.h>
+# endif /* __FreeBSD_kernel__ */
# else /* pcvt and syscons: hard-code the ID magic */
# define VGAPCVTID _IOWR('V',113, struct pcvtid)
struct pcvtid {
@@ -353,10 +337,6 @@
# define CLEARDTR_SUPPORT
-# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
-# define USE_VT_SYSREQ
-# endif
-
#endif
/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index abcafcf8e..a9856064e 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -207,8 +207,6 @@ typedef enum {
XKBLAYOUT,
XKBVARIANT,
XKBOPTIONS,
- /* The next two have become ServerFlags options */
- VTSYSREQ,
/* Obsolete keyboard tokens */
SERVERNUM,
LEFTALT,