summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/os-support')
-rw-r--r--hw/xfree86/os-support/bsd/Makefile.am3
-rw-r--r--hw/xfree86/os-support/bsd/bsd_axp.c4
-rw-r--r--hw/xfree86/os-support/bus/Pci.c7
-rw-r--r--hw/xfree86/os-support/bus/Pci.h18
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c56
-rw-r--r--hw/xfree86/os-support/hurd/Makefile.am1
-rw-r--r--hw/xfree86/os-support/linux/Makefile.am1
-rw-r--r--hw/xfree86/os-support/linux/lnx_axp.c2
-rw-r--r--hw/xfree86/os-support/linux/lnx_font.c2
-rw-r--r--hw/xfree86/os-support/linux/lnx_init.c46
-rw-r--r--hw/xfree86/os-support/misc/BUSmemcpy.c187
-rw-r--r--hw/xfree86/os-support/misc/Delay.c39
-rw-r--r--hw/xfree86/os-support/misc/Makefile.am2
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c52
-rw-r--r--hw/xfree86/os-support/shared/VTsw_noop.c6
-rw-r--r--hw/xfree86/os-support/shared/bios_mmap.c2
-rw-r--r--hw/xfree86/os-support/shared/sigio.c6
-rw-r--r--hw/xfree86/os-support/shared/stdResource.c114
-rw-r--r--hw/xfree86/os-support/solaris/Makefile.am7
-rw-r--r--hw/xfree86/os-support/solaris/sun_VTsw.c110
-rw-r--r--hw/xfree86/os-support/solaris/sun_init.c199
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h25
-rw-r--r--hw/xfree86/os-support/xf86_OSproc.h16
23 files changed, 262 insertions, 643 deletions
diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am
index e52dac13b..b6ecdf1d1 100644
--- a/hw/xfree86/os-support/bsd/Makefile.am
+++ b/hw/xfree86/os-support/bsd/Makefile.am
@@ -17,9 +17,6 @@ else
KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c
endif
-# FIXME: Non-i386/ia64 resource support.
-RES_SOURCES = $(srcdir)/../shared/stdResource.c
-
if AGP
AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c
else
diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c
index cb10a9d40..77c87ce1d 100644
--- a/hw/xfree86/os-support/bsd/bsd_axp.c
+++ b/hw/xfree86/os-support/bsd/bsd_axp.c
@@ -36,7 +36,7 @@ static _AXP axpList[] = {
{"lca",LCA},
{"t2",T2},
{"tsunami",TSUNAMI},
- {NULL,NONE}
+ {NULL,SYS_NONE}
};
axpDevice
@@ -65,7 +65,7 @@ bsdGetAXP(void)
#endif
for (i=0;;i++) {
if (axpList[i].name == NULL)
- return NONE;
+ return SYS_NONE;
if (!strcmp(sysname, axpList[i].name))
return axpList[i].type;
}
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 6a1c6a8f7..b7fa25f71 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -151,13 +151,6 @@ xf86scanpci(void)
success = (pci_system_init() == 0);
- /* XXX */
-#if defined(DEBUGPCI)
- if (DEBUGPCI >= xf86Verbose) {
- xf86Verbose = DEBUGPCI;
- }
-#endif
-
/* choose correct platform/OS specific PCI init routine */
ARCH_PCI_INIT();
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index 79b38f015..b52a6cfae 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -150,24 +150,6 @@
#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
#define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
-/*
- * Debug Macros/Definitions
- */
-/* #define DEBUGPCI 2 */ /* Disable/enable trace in PCI code */
-
-#if defined(DEBUGPCI)
-
-# define PCITRACE(lvl,printfargs) \
- if (lvl > xf86Verbose) { \
- ErrorF printfargs; \
- }
-
-#else /* !defined(DEBUGPCI) */
-
-# define PCITRACE(lvl,printfargs)
-
-#endif /* !defined(DEBUGPCI) */
-
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
defined(__OpenBSD__) || defined(__NetBSD__) || \
defined(__DragonFly__) || defined(__sun) || defined(__GNU__)
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index e210fa1ab..920a14949 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -52,7 +52,6 @@
#include "compiler.h"
#include "xf86.h"
#include "xf86Priv.h"
-#define NEED_OS_RAC_PROTOS
#include "xf86_OSlib.h"
#include "Pci.h"
#include <dirent.h>
@@ -453,58 +452,3 @@ xf86MapLegacyIO(struct pci_device *dev)
return (IOADDRESS)DomainMmappedIO[domain];
}
-resPtr
-xf86AccResFromOS(resPtr pRes)
-{
- struct pci_device *dev;
- struct pci_device_iterator *iter;
- resRange range;
-
- iter = pci_id_match_iterator_create(& match_host_bridge);
- while ((dev = pci_device_next(iter)) != NULL) {
- const int domain = dev->domain;
- const struct pciSizes * const sizes = linuxGetSizesStruct(dev);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so
- * that resources that are (or appear to be) unallocated can be
- * relocated.
- */
- RANGE(range, 0x00000000u, 0x0009ffffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0x000c0000u, 0x000effffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0x000f0000u, 0x000fffffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, (ADDRESS)(sizes->mem_size - 1),
- (ADDRESS)(sizes->mem_size - 1),
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0x00000000u, 0x00000000u,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, (IOADDRESS)(sizes->io_size - 1),
- (IOADDRESS)(sizes->io_size - 1),
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- /* FIXME: The old code reserved domain 0 for a special purpose. The
- * FIXME: new code just uses whatever domains the kernel tells it,
- * FIXME: but there is no way to get a domain < 0. What should
- * FIXME: happen here?
- *
- if (domain <= 0)
- break;
- */
- }
-
- pci_iterator_destroy(iter);
-
- return pRes;
-}
-
diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am
index 9bbe2afaf..3e8224753 100644
--- a/hw/xfree86/os-support/hurd/Makefile.am
+++ b/hw/xfree86/os-support/hurd/Makefile.am
@@ -4,7 +4,6 @@ libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \
hurd_video.c \
$(srcdir)/../shared/VTsw_noop.c \
$(srcdir)/../shared/posix_tty.c \
- $(srcdir)/../shared/stdResource.c \
$(srcdir)/../shared/vidmem.c \
$(srcdir)/../shared/sigiostubs.c \
$(srcdir)/../shared/pm_noop.c \
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 81bd055e3..1239c8f6b 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -32,7 +32,6 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c \
$(srcdir)/../shared/posix_tty.c \
$(srcdir)/../shared/vidmem.c \
$(srcdir)/../shared/sigio.c \
- $(srcdir)/../shared/stdResource.c \
$(ACPI_SRCS) \
$(APM_SRCS) \
$(PLATFORM_PCI_SUPPORT)
diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c
index d25999924..8571c048b 100644
--- a/hw/xfree86/os-support/linux/lnx_axp.c
+++ b/hw/xfree86/os-support/linux/lnx_axp.c
@@ -49,7 +49,7 @@ static AXP axpList[] = {
{"Miata",NULL,NULL,PYXIS_CIA},
{"Ruffian",NULL,NULL,PYXIS_CIA},
{"Nautilus",NULL,NULL,IRONGATE},
- {NULL,NULL,NULL,NONE}
+ {NULL,NULL,NULL,SYS_NONE}
};
diff --git a/hw/xfree86/os-support/linux/lnx_font.c b/hw/xfree86/os-support/linux/lnx_font.c
index 5b2696af5..d6fc283c0 100644
--- a/hw/xfree86/os-support/linux/lnx_font.c
+++ b/hw/xfree86/os-support/linux/lnx_font.c
@@ -168,7 +168,7 @@ lnx_savefont(void)
return FALSE;
}
- size = (width + 7)/8 * 32 * charcount;
+ size = bits_to_bytes(width) * 32 * charcount;
fontdata = (unsigned char *)xnfalloc(size);
if (!fontdata) {
xf86Msg(X_WARNING,
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index a49086b37..5a6db8081 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -74,9 +74,11 @@ saveVtPerms(void)
static void
restoreVtPerms(void)
{
- /* Set the terminal permissions back to before we started. */
- chown("/dev/tty0", vtPermSave[0], vtPermSave[1]);
- chown(vtname, vtPermSave[2], vtPermSave[3]);
+ if (geteuid() == 0) {
+ /* Set the terminal permissions back to before we started. */
+ (void)chown("/dev/tty0", vtPermSave[0], vtPermSave[1]);
+ (void)chown(vtname, vtPermSave[2], vtPermSave[3]);
+ }
}
static void *console_handler;
@@ -184,20 +186,22 @@ xf86OpenConsole(void)
xf86Msg(X_WARNING,
"xf86OpenConsole: Could not save ownership of VT\n");
- /* change ownership of the vt */
- if (chown(vtname, getuid(), getgid()) < 0)
- xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n",
- vtname, strerror(errno));
-
- /*
- * the current VT device we're running on is not "console", we want
- * to grab all consoles too
- *
- * Why is this needed??
- */
- if (chown("/dev/tty0", getuid(), getgid()) < 0)
- xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n",
- strerror(errno));
+ if (geteuid() == 0) {
+ /* change ownership of the vt */
+ if (chown(vtname, getuid(), getgid()) < 0)
+ xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n",
+ vtname, strerror(errno));
+
+ /*
+ * the current VT device we're running on is not
+ * "console", we want to grab all consoles too
+ *
+ * Why is this needed??
+ */
+ if (chown("/dev/tty0", getuid(), getgid()) < 0)
+ xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n",
+ strerror(errno));
+ }
}
/*
@@ -282,9 +286,6 @@ xf86OpenConsole(void)
/* we really should have a InitOSInputDevices() function instead
* of Init?$#*&Device(). So I just place it here */
-
- } else { /* ShareVTs */
- close(xf86Info.consoleFd);
}
} else { /* serverGeneration != 1 */
if (!ShareVTs && VTSwitch)
@@ -313,7 +314,10 @@ xf86CloseConsole(void)
int vtno = -1;
#endif
- if (ShareVTs) return;
+ if (ShareVTs) {
+ close(xf86Info.consoleFd);
+ return;
+ }
if (console_handler) {
xf86RemoveGeneralHandler(console_handler);
diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.c b/hw/xfree86/os-support/misc/BUSmemcpy.c
deleted file mode 100644
index e6ffde97e..000000000
--- a/hw/xfree86/os-support/misc/BUSmemcpy.c
+++ /dev/null
@@ -1,187 +0,0 @@
-
-/****************************************************************************
-
- For Alpha Linux, BusToMem() and MemToBus() can be simply memcpy(), BUT:
- we need to prevent unaligned operations when accessing DENSE space on the BUS,
- as the video memory is mmap'd that way. The below code does this.
-
-NOTE: we could simply use the "memcpy()" from LIBC here, but that, currently, is
- not as fast.
-
-Thanks to Linus Torvalds for contributing this code.
-
-****************************************************************************/
-
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifdef __alpha__
-
-#include "compiler.h"
-
-#define LWORD_CODING (0x60)
-#define SPARSE (7)
-
-static unsigned long __memcpy(unsigned long dest, unsigned long src, int n);
-
-void
-xf86BusToMem(unsigned char *dst, unsigned char *src, int len)
-{
- __memcpy((unsigned long)dst, (unsigned long)src, len);
-}
-void
-xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
-{
- if (len == sizeof(int))
- if (!(((long)src | (long)dst) & 3))
- *((unsigned int*)dst) = *((unsigned int*)(src));
- else {
- int i;
- if (((long)src) & 3)
- i = ldl_u((unsigned int*)src);
- else
- i = *(unsigned int*)src;
- if (((long)dst) & 3)
- stl_u(i,(unsigned int*)dst);
- else
- *(unsigned int*)dst = i;
- }
- else
- __memcpy((unsigned long)dst, (unsigned long)src, len);
-}
-
-/*
- * linux/arch/alpha/lib/memcpy.c
- *
- * Copyright (C) 1995 Linus Torvalds, used with his permission.
- */
-
-/*
- * This is a reasonably optimized memcpy() routine.
- */
-
-/*
- * Note that the C code is written to be optimized into good assembly. However,
- * at this point gcc is unable to sanely compile "if (n >= 0)", resulting in a
- * explicit compare against 0 (instead of just using the proper "blt reg, xx" or
- * "bge reg, xx"). I hope alpha-gcc will be fixed to notice this eventually..
- */
-
-/*
- * This should be done in one go with ldq_u*2/mask/stq_u. Do it
- * with a macro so that we can fix it up later..
- */
-#define ALIGN_DEST_TO8(d,s,n) \
- while (d & 7) { \
- if (n <= 0) return; \
- n--; \
- *(char *) d = *(char *) s; \
- d++; s++; \
- }
-
-/*
- * This should similarly be done with ldq_u*2/mask/stq. The destination
- * is aligned, but we don't fill in a full quad-word
- */
-#define DO_REST(d,s,n) \
- while (n > 0) { \
- n--; \
- *(char *) d = *(char *) s; \
- d++; s++; \
- }
-
-/*
- * This should be done with ldq/mask/stq. The source and destination are
- * aligned, but we don't fill in a full quad-word
- */
-#define DO_REST_ALIGNED(d,s,n) DO_REST(d,s,n)
-
-/*
- * This does unaligned memory copies. We want to avoid storing to
- * an unaligned address, as that would do a read-modify-write cycle.
- * We also want to avoid double-reading the unaligned reads.
- *
- * Note the ordering to try to avoid load (and address generation) latencies.
- */
-static __inline__ void __memcpy_unaligned(unsigned long d, unsigned long s, long n)
-{
- ALIGN_DEST_TO8(d,s,n);
- n -= 8; /* to avoid compare against 8 in the loop */
- if (n >= 0) {
- unsigned long low_word, high_word;
- __asm__("ldq_u %0,%1":"=r" (low_word):"m" (*(unsigned long *) s));
- do {
- unsigned long tmp;
- __asm__("ldq_u %0,%1":"=r" (high_word):"m" (*(unsigned long *)(s+8)));
- n -= 8;
- __asm__("extql %1,%2,%0"
- :"=r" (low_word)
- :"r" (low_word), "r" (s));
- __asm__("extqh %1,%2,%0"
- :"=r" (tmp)
- :"r" (high_word), "r" (s));
- s += 8;
- *(unsigned long *) d = low_word | tmp;
- d += 8;
- low_word = high_word;
- } while (n >= 0);
- }
- n += 8;
- DO_REST(d,s,n);
-}
-
-/*
- * Hmm.. Strange. The __asm__ here is there to make gcc use a integer register
- * for the load-store. I don't know why, but it would seem that using a floating
- * point register for the move seems to slow things down (very small difference,
- * though).
- *
- * Note the ordering to try to avoid load (and address generation) latencies.
- */
-static __inline__ void __memcpy_aligned(unsigned long d, unsigned long s, long n)
-{
- ALIGN_DEST_TO8(d,s,n);
- n -= 8;
- while (n >= 0) {
- unsigned long tmp;
- __asm__("ldq %0,%1":"=r" (tmp):"m" (*(unsigned long *) s));
- n -= 8;
- s += 8;
- *(unsigned long *) d = tmp;
- d += 8;
- }
- n += 8;
- DO_REST_ALIGNED(d,s,n);
-}
-
-static unsigned long __memcpy(unsigned long dest, unsigned long src, int n)
-{
- if (!((dest ^ src) & 7)) {
- __memcpy_aligned(dest, src, n);
- return dest;
- }
- __memcpy_unaligned(dest, src, n);
- return dest;
-}
-
-#else /* __alpha__ */
-
-void
-xf86BusToMem(unsigned char *dst, unsigned char *src, int len)
-{
- memcpy(dst, src, len);
-}
-void
-xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
-{
- memcpy(dst, src, len);
-}
-
-#endif /* __alpha__ */
diff --git a/hw/xfree86/os-support/misc/Delay.c b/hw/xfree86/os-support/misc/Delay.c
deleted file mode 100644
index 35ced8ceb..000000000
--- a/hw/xfree86/os-support/misc/Delay.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include <time.h>
-
-void
-xf86UDelay(long usec)
-{
-#if 0
- struct timeval start, interrupt;
-#else
- int sigio;
-
- sigio = xf86BlockSIGIO();
- usleep(usec);
- xf86UnblockSIGIO(sigio);
-#endif
-
-#if 0
- gettimeofday(&start,NULL);
-
- do {
- usleep(usec);
- gettimeofday(&interrupt,NULL);
-
- if ((usec = usec - (interrupt.tv_sec - start.tv_sec) * 1000000
- - (interrupt.tv_usec - start.tv_usec)) < 0)
- break;
- start = interrupt;
- } while (1);
-#endif
-}
-
diff --git a/hw/xfree86/os-support/misc/Makefile.am b/hw/xfree86/os-support/misc/Makefile.am
index 3d4b8ff0e..4bd3fc3e1 100644
--- a/hw/xfree86/os-support/misc/Makefile.am
+++ b/hw/xfree86/os-support/misc/Makefile.am
@@ -1,7 +1,7 @@
noinst_LTLIBRARIES = libmisc.la
-libmisc_la_SOURCES = Delay.c BUSmemcpy.c SlowBcopy.c
+libmisc_la_SOURCES = SlowBcopy.c
#AM_LDFLAGS = -r
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
index 182a3e6ec..8a5017e52 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -1,15 +1,8 @@
-/*******************************************************************************
- for Alpha Linux
-*******************************************************************************/
-
/*
* Create a dependency that should be immune from the effect of register
* renaming as is commonly seen in superscalar processors. This should
* insert a minimum of 100-ns delays between reads/writes at clock rates
* up to 100 MHz---GGL
- *
- * Slowbcopy(char *src, char *dst, int count)
- *
*/
#ifdef HAVE_XORG_CONFIG_H
@@ -54,48 +47,3 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
while(len--)
*dst++ = *src++;
}
-
-#ifdef __alpha__
-
-#ifdef linux
-
-#define SPARSE (7)
-
-#else
-
-#define SPARSE 0
-
-#endif
-
-void
-xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
-{
- unsigned long addr;
- long result;
-
- addr = (unsigned long) src;
- while( count ){
- result = *(volatile int *) addr;
- result >>= ((addr>>SPARSE) & 3) * 8;
- *dst++ = (unsigned char) (0xffUL & result);
- addr += 1<<SPARSE;
- count--;
- outb(0x80, 0x00);
- }
-}
-
-void
-xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
-{
- unsigned long addr;
-
- addr = (unsigned long) dst;
- while(count) {
- *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
- src++;
- addr += 1<<SPARSE;
- count--;
- outb(0x80, 0x00);
- }
-}
-#endif
diff --git a/hw/xfree86/os-support/shared/VTsw_noop.c b/hw/xfree86/os-support/shared/VTsw_noop.c
index a3cfe40b9..78cbe0e34 100644
--- a/hw/xfree86/os-support/shared/VTsw_noop.c
+++ b/hw/xfree86/os-support/shared/VTsw_noop.c
@@ -36,19 +36,19 @@
*/
Bool
-xf86VTSwitchPending()
+xf86VTSwitchPending(void)
{
return(FALSE);
}
Bool
-xf86VTSwitchAway()
+xf86VTSwitchAway(void)
{
return(FALSE);
}
Bool
-xf86VTSwitchTo()
+xf86VTSwitchTo(void)
{
return(TRUE);
}
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
index 40afd5b8e..a615a1d45 100644
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(-1);
}
- xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
+ xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen);
close(fd);
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 5ba0b7e1c..44136ccfb 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -75,11 +75,11 @@
# define O_ASYNC FASYNC
#endif
-#ifdef MAX_DEVICES
-/* MAX_DEVICES represents the maximimum number of input devices usable
+#ifdef MAXDEVICES
+/* MAXDEVICES represents the maximimum number of input devices usable
* at the same time plus one entry for DRM support.
*/
-# define MAX_FUNCS (MAX_DEVICES + 1)
+# define MAX_FUNCS (MAXDEVICES + 1)
#else
# define MAX_FUNCS 16
#endif
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
deleted file mode 100644
index 9db349bc0..000000000
--- a/hw/xfree86/os-support/shared/stdResource.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER 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.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Standard resource information code */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86Pci.h"
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSlib.h"
-#include "xf86Resources.h"
-
-/* Avoid Imakefile changes */
-#include "bus/Pci.h"
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
- defined(__NetBSD__) || defined(__OpenBSD__) || \
- defined(__DragonFly__) || defined(__sun) || defined(__GNU__)
-#define xf86StdAccResFromOS xf86AccResFromOS
-#endif
-
-resPtr
-xf86StdAccResFromOS(resPtr ret)
-{
- resRange range;
-
- /*
- * Fallback is to claim the following areas:
- *
- * 0x00000000 - 0x0009ffff low 640k host memory
- * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
- * 0x000f0000 - 0x000fffff system BIOS
- * 0x00100000 - 0x3fffffff low 1G - 1MB host memory
- * 0xfec00000 - 0xfecfffff default I/O APIC config space
- * 0xfee00000 - 0xfeefffff default Local APIC config space
- * 0xffe00000 - 0xffffffff high BIOS area (should this be included?)
- *
- * reference: Intel 440BX AGP specs
- *
- * The two APIC spaces appear to be BX-specific and should be dealt with
- * elsewhere.
- */
-
- /* Fallback is to claim 0x0 - 0x9ffff and 0x100000 - 0x7fffffff */
- RANGE(range, 0x00000000, 0x0009ffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x000f0000, 0x000fffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-#if 0
- RANGE(range, 0xfec00000, 0xfecfffff, ResExcMemBlock | ResBios);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xfee00000, 0xfeefffff, ResExcMemBlock | ResBios);
- ret = xf86AddResToList(ret, &range, -1);
- /* airlied - remove BIOS range it shouldn't be here
- this should use E820 - or THE OS */
- RANGE(range, 0xffe00000, 0xffffffff, ResExcMemBlock | ResBios);
- ret = xf86AddResToList(ret, &range, -1);
-#endif
- /*
- * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
- * along with their sparse I/O aliases, but that's too imprecise. Instead
- * claim a bare minimum here.
- */
- RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
-/* RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1); */
- RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* XXX add others */
- return ret;
-}
diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am
index 4496ee122..5163f4423 100644
--- a/hw/xfree86/os-support/solaris/Makefile.am
+++ b/hw/xfree86/os-support/solaris/Makefile.am
@@ -1,5 +1,5 @@
-if SOLARIS_USL_CONSOLE
-VTSW_SRC = $(srcdir)/../shared/VTsw_usl.c
+if SOLARIS_VT
+VTSW_SRC = sun_VTsw.c
else
VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c
endif
@@ -14,7 +14,7 @@ SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S
DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il
solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S
- $(CPP) -P -DINLINE_ASM solaris-@SOLARIS_INOUT_ARCH@.S > $@
+ $(CPP) -P -DINLINE_ASM $(srcdir)/solaris-@SOLARIS_INOUT_ARCH@.S > $@
noinst_LTLIBRARIES = libsolaris.la
libsolaris_la_SOURCES = sun_init.c \
@@ -22,7 +22,6 @@ libsolaris_la_SOURCES = sun_init.c \
$(srcdir)/../shared/kmod_noop.c \
$(srcdir)/../shared/posix_tty.c \
$(srcdir)/../shared/sigio.c \
- $(srcdir)/../shared/stdResource.c \
$(srcdir)/../shared/vidmem.c \
$(VTSW_SRC)
nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC)
diff --git a/hw/xfree86/os-support/solaris/sun_VTsw.c b/hw/xfree86/os-support/solaris/sun_VTsw.c
new file mode 100644
index 000000000..0dc76b8b5
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_VTsw.c
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include <door.h>
+#include <sys/vtdaemon.h>
+
+/*
+ * Handle the VT-switching interface for Solaris/OpenSolaris
+ */
+
+void
+xf86VTRequest(int sig)
+{
+ if (xf86Info.vtPendingNum != -1)
+ {
+ ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
+ xf86Info.vtPendingNum = -1;
+
+ return;
+ }
+
+ xf86Info.vtRequestsPending = TRUE;
+ return;
+}
+
+Bool
+xf86VTSwitchPending(void)
+{
+ return(xf86Info.vtRequestsPending ? TRUE : FALSE);
+}
+
+Bool
+xf86VTSwitchAway(void)
+{
+ int door_fd;
+ vt_cmd_arg_t vt_door_arg;
+ door_arg_t door_arg;
+
+ xf86Info.vtRequestsPending = FALSE;
+
+ vt_door_arg.vt_ev = VT_EV_HOTKEYS;
+ vt_door_arg.vt_num = xf86Info.vtPendingNum;
+ door_arg.data_ptr = (char *)&vt_door_arg;
+ door_arg.data_size = sizeof (vt_cmd_arg_t);
+ door_arg.rbuf = NULL;
+ door_arg.rsize = 0;
+ door_arg.desc_ptr = NULL;
+ door_arg.desc_num = 0;
+
+ if ((door_fd = open(VT_DAEMON_DOOR_FILE, O_RDONLY)) < 0)
+ return (FALSE);
+
+ if (door_call(door_fd, &door_arg) != 0) {
+ close(door_fd);
+ return (FALSE);
+ }
+
+ close(door_fd);
+ return (TRUE);
+}
+
+Bool
+xf86VTSwitchTo(void)
+{
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
+ {
+ return(FALSE);
+ }
+ else
+ {
+ return(TRUE);
+ }
+}
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index 795b0c13c..2c569f02c 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -38,13 +38,15 @@ static Bool Protect0 = FALSE;
#ifdef HAS_USL_VTS
static int VTnum = -1;
static int xf86StartVT = -1;
+static int vtEnabled = 0;
#endif
-#if defined(__SOL8__) || (!defined(__i386__) && !defined(__i386))
-static char fb_dev[PATH_MAX] = "/dev/fb";
-#else
-static char fb_dev[PATH_MAX] = "/dev/console";
-#endif
+/* Device to open as xf86Info.consoleFd */
+static char consoleDev[PATH_MAX] = "/dev/fb";
+
+/* Set by -dev argument on CLI
+ Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
+_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
void
xf86OpenConsole(void)
@@ -93,86 +95,101 @@ xf86OpenConsole(void)
/*
* Setup the virtual terminal manager
*/
- if (VTnum != -1)
+ if ((fd = open("/dev/vt/0",O_RDWR,0)) == -1)
{
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
+ xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n",
+ strerror(errno));
+ vtEnabled = 0;
}
else
{
- if ((fd = open("/dev/vt00",O_RDWR,0)) < 0)
- FatalError("xf86OpenConsole: Cannot open /dev/vt00 (%s)\n",
- strerror(errno));
+ if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0)
+ {
+ xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n",
+ strerror(errno));
+ vtEnabled = 0;
+ }
+ }
+
+ if (vtEnabled == 0)
+ {
+ /* VT not enabled - kernel too old or Sparc platforms
+ without visual_io support */
+ xf86Msg(from, "VT infrastructure is not available\n");
+
+ xf86StartVT = 0;
+ xf86Info.vtno = 0;
+ strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev));
+ }
+ else
+ {
if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
FatalError("xf86OpenConsole: Cannot determine current VT\n");
xf86StartVT = vtinfo.v_active;
- /*
- * There is a SEVERE problem with x86's VT's. The VT_OPENQRY
- * ioctl() will panic the entire system if all 8 (7 VT's+Console)
- * terminals are used. The only other way I've found to determine
- * if there is a free VT is to try activating all the the available
- * VT's and see if they all succeed - if they do, there there is no
- * free VT, and the Xserver cannot continue without panic'ing the
- * system. (It's ugly, but it seems to work.) Note there is a
- * possible race condition here.
- *
- * David Holland 2/23/94
- */
-
- FreeVTslot = 0;
- for (i = 7; (i >= 0) && !FreeVTslot; i--)
- if (ioctl(fd, VT_ACTIVATE, i) != 0)
- FreeVTslot = 1;
+ if (VTnum != -1)
+ {
+ xf86Info.vtno = VTnum;
+ from = X_CMDLINE;
+ }
+ else
+ {
+ if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
+ (xf86Info.vtno == -1)) {
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
+ }
+ }
- if (!FreeVTslot ||
- (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
- (xf86Info.vtno == -1))
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+ snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
+ }
+ if (fd != -1) {
close(fd);
}
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
-
- sprintf(fb_dev, "/dev/vt%02d", xf86Info.vtno); /* Solaris 2.1 x86 */
-
#endif /* HAS_USL_VTS */
if (!KeepTty)
setpgrp();
- if (((xf86Info.consoleFd = open(fb_dev, O_RDWR | O_NDELAY, 0)) < 0))
+ if (((xf86Info.consoleFd = open(consoleDev, O_RDWR | O_NDELAY, 0)) < 0))
FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
- fb_dev, strerror(errno));
+ consoleDev, strerror(errno));
#ifdef HAS_USL_VTS
/* Change ownership of the vt */
- chown(fb_dev, getuid(), getgid());
+ chown(consoleDev, getuid(), getgid());
- /*
- * Now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
+ if (vtEnabled)
+ {
+ /*
+ * Now get the VT
+ */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_GETMODE failed\n");
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
+ OsSignal(SIGUSR1, xf86VTRequest);
- signal(SIGUSR1, xf86VTRequest);
+ VT.mode = VT_PROCESS;
+ VT.relsig = SIGUSR1;
+ VT.acqsig = SIGUSR1;
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
+ if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
+ if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
+ }
#endif
#ifdef KDSETMODE
@@ -180,30 +197,31 @@ xf86OpenConsole(void)
if (i < 0) {
xf86Msg(X_WARNING,
"xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n",
- fb_dev, strerror(errno));
+ consoleDev, strerror(errno));
}
#endif
}
else /* serverGeneration != 1 */
{
#ifdef HAS_USL_VTS
- /*
- * Now re-get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+ if (vtEnabled) {
+ /*
+ * Now re-get the VT
+ */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- /*
- * If the server doesn't have the VT when the reset occurs,
- * this is to make sure we don't continue until the activate
- * signal is received.
- */
- if (!xf86Screens[0]->vtSema)
- sleep(5);
+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+ /*
+ * If the server doesn't have the VT when the reset occurs,
+ * this is to make sure we don't continue until the activate
+ * signal is received.
+ */
+ if (!xf86Screens[0]->vtSema)
+ sleep(5);
+ }
#endif /* HAS_USL_VTS */
}
@@ -218,7 +236,7 @@ xf86CloseConsole(void)
#if !defined(__i386__) && !defined(__i386) && !defined(__x86)
- if (!xf86DoProbe && !xf86DoConfigure) {
+ if (!xf86DoConfigure) {
int fd;
/*
@@ -228,7 +246,7 @@ xf86CloseConsole(void)
* at this point whether this should be done for all framebuffers in
* the system, rather than only the console.
*/
- if ((fd = open("/dev/fb", O_RDWR, 0)) < 0) {
+ if ((fd = open(xf86SolarisFbDev, O_RDWR, 0)) < 0) {
xf86Msg(X_WARNING,
"xf86CloseConsole(): unable to open framebuffer (%s)\n",
strerror(errno));
@@ -267,30 +285,16 @@ xf86CloseConsole(void)
#endif
#ifdef HAS_USL_VTS
+ if (vtEnabled == 1) {
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
+ {
+ VT.mode = VT_AUTO; /* Set default vt handling */
+ ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
+ }
- /*
- * Solaris 2.1 x86 doesn't seem to "switch" back to the console when the VT
- * is relinquished and its mode is reset to auto. Also, Solaris 2.1 seems
- * to associate vt00 with the console so I've opened the "console" back up
- * and made it the active vt again in text mode and then closed it. There
- * must be a better hack for this but I'm not aware of one at this time.
- *
- * Doug Anson 11/6/93
- * danson@lgc.com
- *
- * Fixed - 12/5/93 - David Holland - davidh@dorite.use.com
- * Did the whole thing similarly to the way linux does it
- */
-
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO; /* Set default vt handling */
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
+ /* Activate the VT that X was started on */
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
}
-
- /* Activate the VT that X was started on */
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
-
#endif /* HAS_USL_VTS */
close(xf86Info.consoleFd);
@@ -323,7 +327,7 @@ xf86ProcessArgument(int argc, char **argv, int i)
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
+ if (sscanf(argv[i], "vt%d", &VTnum) == 0)
{
UseMsg();
VTnum = -1;
@@ -337,8 +341,7 @@ xf86ProcessArgument(int argc, char **argv, int i)
if ((i + 1) < argc) {
if (!strcmp(argv[i], "-dev")) {
- strncpy(fb_dev, argv[i+1], PATH_MAX);
- fb_dev[PATH_MAX - 1] = '\0';
+ strlcpy(xf86SolarisFbDev, argv[i+1], sizeof(xf86SolarisFbDev));
return 2;
}
}
@@ -349,7 +352,7 @@ xf86ProcessArgument(int argc, char **argv, int i)
void xf86UseMsg()
{
#ifdef HAS_USL_VTS
- ErrorF("vtXX Use the specified VT number\n");
+ ErrorF("vtX Use the specified VT number\n");
#endif
ErrorF("-dev <fb> Framebuffer device\n");
ErrorF("-keeptty Don't detach controlling tty\n");
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 48d922301..c53fc0dac 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -117,15 +117,9 @@
# include <sys/seg.h>
# endif /* SVR4 && !sun */
/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
-# if defined(sun) && defined (SVR4) /* Solaris? */
-# if defined(__i386__) || defined(__i386) || defined(__x86) /* on x86 or x64? */
-# if !defined(V86SC_IOPL) /* Solaris 7 or later? */
-# include <sys/v86.h> /* Nope */
-# endif
-# endif /* V86SC_IOPL */
-# else
-# include <sys/v86.h> /* Not solaris */
-# endif /* sun && i386 && SVR4 */
+# if !defined(V86SC_IOPL) /* Solaris 7 or later? */
+# include <sys/v86.h> /* Nope */
+# endif
# if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
# include <sys/psw.h>
# endif
@@ -140,7 +134,7 @@
# include <sys/mmap.h> /* MMAP driver header */
# endif
-# if !defined(sun) || (!defined(sparc) && !defined(__SOL8__))
+# if !defined(sun) || defined(HAVE_SYS_VT_H)
# define HAS_USL_VTS
# endif
# if !defined(sun)
@@ -155,10 +149,14 @@
# define LED_NUM NLKED
# define LED_SCR SLKED
# elif defined(HAS_USL_VTS)
-# include <sys/at_ansi.h>
+# if !defined(sun)
+# include <sys/at_ansi.h>
+# endif
# include <sys/kd.h>
# include <sys/vt.h>
-# elif defined(sun)
+# endif
+
+# if defined(sun)
# include <sys/fbio.h>
# include <sys/kbd.h>
# include <sys/kbio.h>
@@ -198,9 +196,8 @@
# endif /* SVR4 */
-# if defined(sun) && (defined (__i386__) || defined(__i386)) && defined (SVR4) && !defined(__SOL8__)
+# if defined(sun) && defined(HAS_USL_VTS)
# define USE_VT_SYSREQ
-# define VT_SYSREQ_DEFAULT TRUE
# endif
#endif /* (SYSV || SVR4) */
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index 507db1862..c1a117334 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -68,10 +68,6 @@
#ifndef _XF86_OSPROC_H
#define _XF86_OSPROC_H
-#ifdef XF86_OS_PRIVS
-#include "xf86Pci.h"
-#endif
-
/*
* The actual prototypes have been pulled into this seperate file so
* that they can can be used without pulling in all of the OS specific
@@ -147,9 +143,6 @@ extern _X_EXPORT void xf86SetTVOut(int);
extern _X_EXPORT void xf86SetRGBOut(void);
#endif
extern _X_EXPORT void xf86OSRingBell(int, int, int);
-extern _X_EXPORT void xf86BusToMem(unsigned char *, unsigned char *, int);
-extern _X_EXPORT void xf86MemToBus(unsigned char *, unsigned char *, int);
-extern _X_EXPORT void xf86UDelay(long usec);
extern _X_EXPORT void xf86SetReallySlowBcopy(void);
extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int);
extern _X_EXPORT int xf86OpenSerial(pointer options);
@@ -214,15 +207,6 @@ extern _X_EXPORT int xf86ProcessArgument(int, char **, int);
extern _X_EXPORT void xf86UseMsg(void);
extern _X_EXPORT PMClose xf86OSPMOpen(void);
-#ifdef NEED_OS_RAC_PROTOS
-/* RAC-related privs */
-/* internal to os-support layer */
-extern _X_EXPORT resPtr xf86StdAccResFromOS(resPtr ret);
-
-/* available to the common layer */
-extern _X_EXPORT resPtr xf86AccResFromOS(resPtr ret);
-#endif /* NEED_OS_RAC_PROTOS */
-
extern _X_EXPORT void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer);
extern _X_EXPORT void xf86InitVidMem(void);