1
Two chunks of jbarne's nohwaccess patch got taken upstream; this patch
2
contains just the remainder, which implements a -nohwaccess option.
4
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
5
index 7f40857..cf58c01 100644
6
--- a/hw/xfree86/os-support/linux/lnx_init.c
7
+++ b/hw/xfree86/os-support/linux/lnx_init.c
8
@@ -49,6 +49,7 @@ static Bool KeepTty = FALSE;
10
static Bool VTSwitch = TRUE;
11
static Bool ShareVTs = FALSE;
12
+Bool NoHwAccess = FALSE;
13
static int activeVT = -1;
15
static int vtPermSave[4];
16
@@ -433,6 +438,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
20
+ if (!strcmp(argv[i], "-nohwaccess"))
25
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
27
if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
28
@@ -454,5 +464,6 @@ xf86UseMsg()
29
ErrorF("don't detach controlling tty (for debugging only)\n");
30
ErrorF("-novtswitch don't immediately switch to new VT\n");
31
ErrorF("-sharevts share VTs with another X server\n");
32
+ ErrorF("-nohwaccess don't access hardware ports directly\n");
35
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
36
index 688106a..34a845b 100644
37
--- a/hw/xfree86/os-support/linux/lnx_video.c
38
+++ b/hw/xfree86/os-support/linux/lnx_video.c
40
#define MAP_FAILED ((void *)-1)
43
+extern Bool NoHwAccess;
44
static Bool ExtendedEnabled = FALSE;
47
@@ -509,6 +510,9 @@ xf86EnableIO(void)
49
unsigned int ioBase_phys;