[PATCH xserver 4/8] bsd: Remove old code for FreeBSD < 5.0
Alexandr Shadchin
alexandr.shadchin at gmail.com
Sat Nov 26 12:49:04 PST 2011
I think that no sense have this code, because no one engaged
building (porting) new xserver on FreeBSD < 5.0
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
---
hw/xfree86/os-support/bsd/bsd_init.c | 64 +++++-----------------------------
hw/xfree86/os-support/xf86_OSlib.h | 15 ++------
2 files changed, 12 insertions(+), 67 deletions(-)
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 7079d62..fa7e2c2 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -35,7 +35,6 @@
#include "xf86Priv.h"
#include "xf86_OSlib.h"
-#include <sys/utsname.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <errno.h>
@@ -158,9 +157,6 @@ xf86OpenConsole()
xf86ConsOpen_t *driver;
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
int result;
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- struct utsname uts;
-#endif
vtmode_t vtmode;
#endif
@@ -235,17 +231,6 @@ xf86OpenConsole()
break;
#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- /* as of FreeBSD 2.2.8, syscons driver does not need the #1 vt
- * 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);
- i = atof(uts.release) * 100;
- if (i >= 310) goto acquire_vt;
-#endif
- /* otherwise fall through */
case PCVT:
#if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 200000000))
/*
@@ -263,7 +248,8 @@ xf86OpenConsole()
sleep(1);
}
#endif
-acquire_vt:
+ /* FALLTHROUGH */
+ case SYSCONS:
if (!xf86Info.ShareVTs) {
/*
* now get the VT
@@ -396,26 +382,11 @@ xf86OpenSyscons()
if (xf86Info.vtno == -1)
{
- /*
- * For old syscons versions (<0x100), VT_OPENQRY returns
- * the current VT rather than the next free VT. In this
- * case, the server gets started on the current VT instead
- * of the next free VT.
- */
-
-#if 0
- /* check for the fixed VT_OPENQRY */
- if (syscons_version >= 0x100)
+ if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0)
{
-#endif
- if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0)
- {
- /* No free VTs */
- xf86Info.vtno = -1;
- }
-#if 0
+ /* No free VTs */
+ xf86Info.vtno = -1;
}
-#endif
if (xf86Info.vtno == -1)
{
@@ -428,18 +399,8 @@ xf86OpenSyscons()
}
else
{
- if (syscons_version >= 0x100)
- {
- FatalError("%s: Cannot find a free VT",
- "xf86OpenSyscons");
- }
- /* Should no longer reach here */
- FatalError("%s: %s %s\n\t%s %s",
- "xf86OpenSyscons",
- "syscons versions prior to 1.0 require",
- "either the",
- "server's stdin be a VT",
- "or the use of the vtxx server option");
+ FatalError("%s: Cannot find a free VT",
+ "xf86OpenSyscons");
}
}
from = X_PROBED;
@@ -458,15 +419,8 @@ xf86OpenSyscons()
}
xf86Info.consType = SYSCONS;
xf86Msg(X_PROBED, "Using syscons driver with X support");
- if (syscons_version >= 0x100)
- {
- xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8,
- syscons_version & 0xFF);
- }
- else
- {
- xf86ErrorF(" (version 0.x)\n");
- }
+ xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8,
+ syscons_version & 0xFF);
xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
}
else
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 06fea03..57d057d 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -241,12 +241,8 @@
# ifdef SYSCONS_SUPPORT
# define COMPAT_SYSCONS
# 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 */
+# include <sys/consio.h>
+# include <sys/kbio.h>
# else
# include <sys/console.h>
# endif
@@ -275,12 +271,7 @@
# endif /* WSCONS_SUPPORT */
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
-# include <sys/mouse.h>
-# else
-# undef MOUSE_GETINFO
-# include <machine/mouse.h>
-# endif
+# include <sys/mouse.h>
# endif
/* Include these definitions in case ioctl_pc.h didn't get included */
--
1.7.6
More information about the xorg-devel
mailing list