Dead code removal
Remove a whole bunch of code that was never built, be it entire files or just dead ifdefs.
This commit is contained in:
parent
0564b5454a
commit
446fe9eecd
|
@ -1070,7 +1070,6 @@ AC_SUBST([VENDOR_RELEASE])
|
|||
AC_SUBST([VENDOR_MAN_VERSION])
|
||||
|
||||
AC_DEFINE(DDXOSINIT, 1, [Use OsVendorInit])
|
||||
AC_DEFINE(SERVER_LOCK, 1, [Use a lock to prevent multiple servers on a display])
|
||||
AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
|
||||
AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
|
||||
|
||||
|
|
6
fb/fb.h
6
fb/fb.h
|
@ -597,9 +597,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
|
|||
}
|
||||
|
||||
extern DevPrivateKey fbGetGCPrivateKey(void);
|
||||
#ifndef FB_NO_WINDOW_PIXMAPS
|
||||
extern DevPrivateKey fbGetWinPrivateKey(void);
|
||||
#endif
|
||||
extern const GCOps fbGCOps;
|
||||
extern const GCFuncs fbGCFuncs;
|
||||
|
||||
|
@ -670,12 +668,8 @@ typedef struct {
|
|||
#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
|
||||
|
||||
#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
|
||||
#ifdef FB_NO_WINDOW_PIXMAPS
|
||||
#define fbGetWindowPixmap(d) fbGetScreenPixmap(((DrawablePtr) (d))->pScreen)
|
||||
#else
|
||||
#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
|
||||
dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey()))
|
||||
#endif
|
||||
|
||||
#ifdef ROOTLESS
|
||||
#define __fbPixDrawableX(pPix) ((pPix)->drawable.x)
|
||||
|
|
|
@ -38,13 +38,11 @@ DevPrivateKey fbGetGCPrivateKey(void)
|
|||
{
|
||||
return fbGCPrivateKey;
|
||||
}
|
||||
#ifndef FB_NO_WINDOW_PIXMAPS
|
||||
static DevPrivateKey fbWinPrivateKey = &fbWinPrivateKey;
|
||||
DevPrivateKey fbGetWinPrivateKey(void)
|
||||
{
|
||||
return fbWinPrivateKey;
|
||||
}
|
||||
#endif
|
||||
|
||||
Bool
|
||||
fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
|
||||
|
|
|
@ -90,11 +90,7 @@ _fbGetWindowPixmap (WindowPtr pWindow)
|
|||
void
|
||||
_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
|
||||
{
|
||||
#ifdef FB_NO_WINDOW_PIXMAPS
|
||||
FatalError ("Attempted to set window pixmap without fb support\n");
|
||||
#else
|
||||
dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(), pPixmap);
|
||||
#endif
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
@ -31,10 +31,8 @@
|
|||
Bool
|
||||
fbCreateWindow(WindowPtr pWin)
|
||||
{
|
||||
#ifndef FB_NO_WINDOW_PIXMAPS
|
||||
dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(),
|
||||
fbGetScreenPixmap(pWin->drawable.pScreen));
|
||||
#endif
|
||||
#ifdef FB_SCREEN_PRIVATE
|
||||
if (pWin->drawable.bitsPerPixel == 32)
|
||||
pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
|
||||
|
|
|
@ -99,8 +99,6 @@ fbdevCardInit (KdCardInfo *card)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#define FBDEV_KLUDGE_FORMAT
|
||||
#ifdef FBDEV_KLUDGE_FORMAT
|
||||
static Pixel
|
||||
fbdevMakeContig (Pixel orig, Pixel others)
|
||||
{
|
||||
|
@ -114,7 +112,6 @@ fbdevMakeContig (Pixel orig, Pixel others)
|
|||
}
|
||||
return orig;
|
||||
}
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
fbdevModeSupported (KdScreenInfo *screen,
|
||||
|
@ -261,7 +258,7 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
|
|||
screen->fb[0].redMask = Mask (priv->var.red.offset, priv->var.red.length);
|
||||
screen->fb[0].greenMask = Mask (priv->var.green.offset, priv->var.green.length);
|
||||
screen->fb[0].blueMask = Mask (priv->var.blue.offset, priv->var.blue.length);
|
||||
#ifdef FBDEV_KLUDGE_FORMAT
|
||||
|
||||
/*
|
||||
* This is a kludge so that Render will work -- fill in the gaps
|
||||
* in the pixel
|
||||
|
@ -278,7 +275,6 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
|
|||
screen->fb[0].redMask|
|
||||
screen->fb[0].greenMask);
|
||||
|
||||
#endif
|
||||
allbits = screen->fb[0].redMask | screen->fb[0].greenMask | screen->fb[0].blueMask;
|
||||
depth = 32;
|
||||
while (depth && !(allbits & (1 << (depth - 1))))
|
||||
|
|
|
@ -35,12 +35,6 @@
|
|||
#define I2C_TIMEOUT(x) /*(x)*/ /* Report timeouts */
|
||||
#define I2C_TRACE(x) /*(x)*/ /* Report progress */
|
||||
|
||||
/* Set which OSs have bad gettimeofday resolution. */
|
||||
#if defined(SVR4) && !defined(sun)
|
||||
#define BAD_GETTIMEOFDAY_RESOLUTION
|
||||
#endif
|
||||
|
||||
|
||||
/* This is the default I2CUDelay function if not supplied by the driver.
|
||||
* High level I2C interfaces implementing the bus protocol in hardware
|
||||
* should supply this function too.
|
||||
|
@ -49,23 +43,6 @@
|
|||
* All values 0 to 1e6 inclusive must be expected.
|
||||
*/
|
||||
|
||||
#ifdef BAD_GETTIMEOFDAY_RESOLUTION
|
||||
/*
|
||||
* This is temporary until a better, portable
|
||||
* way is found. Adjust bogo_usec to match CPU speed.
|
||||
*/
|
||||
static int bogo_usec = 500;
|
||||
|
||||
static void
|
||||
I2CUDelay(I2CBusPtr b, int usec)
|
||||
{
|
||||
volatile long i;
|
||||
|
||||
if (usec > 0)
|
||||
for (i = usec * bogo_usec; i > 0; i--)
|
||||
/* (perhaps hw delay action) */;
|
||||
}
|
||||
#else
|
||||
static void
|
||||
I2CUDelay(I2CBusPtr b, int usec)
|
||||
{
|
||||
|
@ -86,7 +63,6 @@ I2CUDelay(I2CBusPtr b, int usec)
|
|||
} while (diff>=0 && diff< (usec + 1));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Most drivers will register just with GetBits/PutBits functions.
|
||||
* The following functions implement a software I2C protocol
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
|
||||
DIST_SUBDIRS = bsd bus misc linux solaris sysv sco usl hurd
|
||||
DIST_SUBDIRS = bsd bus misc linux solaris sysv sco hurd
|
||||
|
||||
sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h assyntax.h
|
||||
|
||||
|
|
|
@ -1,469 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2003 The XFree86 Project, 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, 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
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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
|
||||
* XFree86 Project.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains the glue necessary for support of Intel's 460GX chipset.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include "460gxPCI.h"
|
||||
#include "xf86.h"
|
||||
#include "Pci.h"
|
||||
|
||||
/* 460GX register definitions */
|
||||
/* SAC at 0:10:0 */
|
||||
#define CBN 0x0040
|
||||
/* SAC at CBN:0:0 */
|
||||
#define DEVNPRES 0x0070
|
||||
/* SAC at CBN:1[0-7]:0 */
|
||||
#define BUSNO 0x0048
|
||||
#define SUBNO 0x0049
|
||||
#define VGASE 0x0080
|
||||
#define PCIS 0x0084
|
||||
#define IOR 0x008C
|
||||
#define IORD 0x008E /* CBN:10:0 only */
|
||||
/* PXB at CBN:1[0-7]:1 */
|
||||
#define ERRCMD 0x0046
|
||||
|
||||
static int cbn_460gx = -1;
|
||||
static CARD32 cbdevs_460gx = 0;
|
||||
static CARD16 iord_460gx;
|
||||
static int busno_460gx[8], subno_460gx[8];
|
||||
static CARD8 pcis_460gx[8], ior_460gx[8];
|
||||
static CARD8 has_err_460gx[8], err_460gx[8];
|
||||
static CARD8 iomap_460gx[16]; /* One for each 4k */
|
||||
static pciBusFuncs_t BusFuncs_460gx;
|
||||
|
||||
static pciConfigPtr
|
||||
Verify460GXBus(int bus)
|
||||
{
|
||||
pciConfigPtr pPCI;
|
||||
|
||||
if ((bus < 0) || (bus >= pciNumBuses) ||
|
||||
!pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
|
||||
(pPCI->busnum != cbn_460gx) || (pPCI->funcnum != 0) ||
|
||||
(pPCI->devnum < 0x10) || (pPCI->devnum > 0x17))
|
||||
return NULL;
|
||||
|
||||
return pPCI;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called to emulate the various settings in a P2P or CardBus
|
||||
* bridge's control register using one of a 460GX's SAC host bridges.
|
||||
*/
|
||||
static CARD16
|
||||
Control460GXBridge(int bus, CARD16 mask, CARD16 value)
|
||||
{
|
||||
pciConfigPtr pPCI;
|
||||
PCITAG tag;
|
||||
CARD16 current = 0;
|
||||
CARD8 tmp;
|
||||
|
||||
if ((pPCI = Verify460GXBus(bus))) {
|
||||
/* Start with VGA enablement */
|
||||
tmp = pciReadByte(pPCI->tag, VGASE);
|
||||
if (tmp & 0x01) {
|
||||
current |= PCI_PCI_BRIDGE_VGA_EN;
|
||||
if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
|
||||
!(value & PCI_PCI_BRIDGE_VGA_EN))
|
||||
pciWriteByte(pPCI->tag, VGASE, tmp & ~0x01);
|
||||
} else {
|
||||
if (mask & value & PCI_PCI_BRIDGE_VGA_EN)
|
||||
pciWriteByte(pPCI->tag, VGASE, tmp | 0x01);
|
||||
}
|
||||
|
||||
/* Move on to master abort failure enablement */
|
||||
if (has_err_460gx[pPCI->devnum - 0x10]) {
|
||||
tag = PCI_MAKE_TAG(pPCI->busnum, pPCI->devnum, pPCI->funcnum + 1);
|
||||
tmp = pciReadByte(tag, ERRCMD);
|
||||
if (tmp & 0x01) {
|
||||
current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN;
|
||||
if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
|
||||
!(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
|
||||
pciWriteByte(tag, ERRCMD, tmp & ~0x01);
|
||||
} else {
|
||||
if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
|
||||
pciWriteByte(tag, ERRCMD, tmp | 0x01);
|
||||
}
|
||||
}
|
||||
|
||||
/* Put emulation of any other P2P bridge control here */
|
||||
}
|
||||
|
||||
return (current & ~mask) | (value & mask);
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve various bus numbers representing the connections provided by 460GX
|
||||
* host bridges.
|
||||
*/
|
||||
static void
|
||||
Get460GXBridgeBuses(int bus, int *primary, int *secondary, int *subordinate)
|
||||
{
|
||||
pciConfigPtr pPCI = Verify460GXBus(bus);
|
||||
int i;
|
||||
|
||||
/* The returned bus numbers are initialised by the caller */
|
||||
|
||||
if (!pPCI)
|
||||
return;
|
||||
|
||||
i = pPCI->devnum - 0x10;
|
||||
|
||||
/* These are not modified, so no need to re-read them */
|
||||
if (primary)
|
||||
*primary = pPCI->busnum;
|
||||
if (secondary)
|
||||
*secondary = busno_460gx[i];
|
||||
if (subordinate)
|
||||
*subordinate = subno_460gx[i];
|
||||
}
|
||||
|
||||
/* Retrieves a list of the resources routed to a host bridge's secondary bus */
|
||||
static void
|
||||
Get460GXBridgeResources(int bus,
|
||||
pointer *ppIoRes,
|
||||
pointer *ppMemRes,
|
||||
pointer *ppPmemRes)
|
||||
{
|
||||
pciConfigPtr pPCI = Verify460GXBus(bus);
|
||||
resRange range;
|
||||
unsigned int i, j;
|
||||
|
||||
if (ppIoRes) {
|
||||
xf86FreeResList(*ppIoRes);
|
||||
*ppIoRes = NULL;
|
||||
|
||||
if (pPCI) {
|
||||
for (i = 0; i <= 0x0F; i++) {
|
||||
if (iomap_460gx[i] != pPCI->devnum)
|
||||
continue;
|
||||
|
||||
RANGE(range, i << 12, ((i + 1) << 12) - 1,
|
||||
RANGE_TYPE(ResExcIoBlock, 0));
|
||||
*ppIoRes = xf86AddResToList(*ppIoRes, &range, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ppMemRes) {
|
||||
xf86FreeResList(*ppMemRes);
|
||||
*ppMemRes = NULL;
|
||||
|
||||
if (pPCI) {
|
||||
if (!(i = (pPCI->devnum - 0x10)))
|
||||
j = 127; /* (4GB - 32M) / 32M */
|
||||
else
|
||||
j = pcis_460gx[i - 1] & 0x7F;
|
||||
|
||||
i = pcis_460gx[i] & 0x7F;
|
||||
if (i < j) {
|
||||
RANGE(range, i << 25, (j << 25) - 1,
|
||||
RANGE_TYPE(ResExcMemBlock, 0));
|
||||
*ppMemRes = xf86AddResToList(*ppMemRes, &range, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ppPmemRes) {
|
||||
xf86FreeResList(*ppPmemRes);
|
||||
*ppPmemRes = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This checks for, and validates, the presence of the 460GX chipset, and sets
|
||||
* cbn_460gx to a positive value accordingly. This function returns TRUE if
|
||||
* the chipset scan is to be stopped, or FALSE if the scan is to move on to the
|
||||
* next chipset.
|
||||
*/
|
||||
|
||||
Bool
|
||||
xorgProbe460GX(scanpciWrapperOpt flags)
|
||||
{
|
||||
pciBusInfo_t *pBusInfo;
|
||||
PCITAG tag;
|
||||
|
||||
/* Bus zero should already be set up */
|
||||
if (!(pBusInfo = pciBusInfo[0])) {
|
||||
cbn_460gx = -1;
|
||||
return FALSE;
|
||||
}
|
||||
/* First look for a 460GX's primary host bridge */
|
||||
tag = PCI_MAKE_TAG(0, 0x10, 0);
|
||||
if (pciReadLong(tag, PCI_ID_REG) == DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
cbn_460gx = -1;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
xf86PreScan460GX(void)
|
||||
{
|
||||
pciBusInfo_t *pBusInfo;
|
||||
PCITAG tag;
|
||||
CARD32 tmp;
|
||||
int i, devno;
|
||||
|
||||
if (!(pBusInfo = pciBusInfo[0]))
|
||||
return;
|
||||
|
||||
/* Get CBN (Chipset bus number) */
|
||||
tag = PCI_MAKE_TAG(0, 0x10, 0);
|
||||
if (!(cbn_460gx = (unsigned int)pciReadByte(tag, CBN))) {
|
||||
/* Sanity check failed */
|
||||
cbn_460gx = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (pciNumBuses <= cbn_460gx)
|
||||
pciNumBuses = cbn_460gx + 1;
|
||||
|
||||
/* Set up bus CBN */
|
||||
if (!pciBusInfo[cbn_460gx]) {
|
||||
pciBusInfo[cbn_460gx] = xnfalloc(sizeof(pciBusInfo_t));
|
||||
*pciBusInfo[cbn_460gx] = *pBusInfo;
|
||||
}
|
||||
|
||||
tag = PCI_MAKE_TAG(cbn_460gx, 0, 0);
|
||||
if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
|
||||
/* Sanity check failed */
|
||||
cbn_460gx = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find out which CBN devices the firmware thinks are present. Of these,
|
||||
* we are only interested in devices 0x10 through 0x17.
|
||||
*/
|
||||
cbdevs_460gx = pciReadLong(tag, DEVNPRES);
|
||||
|
||||
for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
|
||||
tag = PCI_MAKE_TAG(cbn_460gx, devno, 0);
|
||||
if (pciReadLong(tag, PCI_ID_REG) !=
|
||||
DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
|
||||
/* Sanity check failed */
|
||||
cbn_460gx = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (devno == 0x10)
|
||||
iord_460gx = pciReadWord(tag, IORD);
|
||||
|
||||
busno_460gx[i] = (unsigned int)pciReadByte(tag, BUSNO);
|
||||
subno_460gx[i] = (unsigned int)pciReadByte(tag, SUBNO);
|
||||
pcis_460gx[i] = pciReadByte(tag, PCIS);
|
||||
ior_460gx[i] = pciReadByte(tag, IOR);
|
||||
|
||||
has_err_460gx[i] = err_460gx[i] = 0; /* Insurance */
|
||||
|
||||
tag = PCI_MAKE_TAG(cbn_460gx, devno, 1);
|
||||
tmp = pciReadLong(tag, PCI_ID_REG);
|
||||
switch (tmp) {
|
||||
case DEVID(VENDOR_INTEL, CHIP_460GX_PXB):
|
||||
case DEVID(VENDOR_INTEL, CHIP_460GX_WXB):
|
||||
if (cbdevs_460gx & (1 << devno)) {
|
||||
/* Sanity check failed */
|
||||
cbn_460gx = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX I don't have WXB docs, but PCI register dumps indicate that
|
||||
* the registers we are interested in are consistent with those of
|
||||
* the PXB.
|
||||
*/
|
||||
err_460gx[i] = pciReadByte(tag, ERRCMD);
|
||||
has_err_460gx[i] = 1;
|
||||
break;
|
||||
|
||||
case DEVID(VENDOR_INTEL, CHIP_460GX_GXB_1):
|
||||
if (cbdevs_460gx & (1 << devno)) {
|
||||
/* Sanity check failed */
|
||||
cbn_460gx = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX GXB isn't documented to have an ERRCMD register, nor any
|
||||
* other means of failing master aborts. For now, assume master
|
||||
* aborts are always allowed to complete normally.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
if (((CARD16)(tmp + 1U) <= (CARD16)1U) &&
|
||||
(cbdevs_460gx & (1U << devno)))
|
||||
break;
|
||||
/* Sanity check failed */
|
||||
cbn_460gx = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allow master aborts to complete normally */
|
||||
for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
|
||||
if (!(err_460gx[i] & 0x01))
|
||||
continue;
|
||||
|
||||
pciWriteByte(PCI_MAKE_TAG(cbn_460gx, devno, 1),
|
||||
ERRCMD, err_460gx[i] & ~0x01);
|
||||
}
|
||||
|
||||
/*
|
||||
* The 460GX spec says that any access to buses higher than CBN will be
|
||||
* master-aborted. It seems possible however that this is not the case in
|
||||
* all 460GX implementations. For now, limit the bus scan to CBN, unless
|
||||
* we have already found a higher bus number.
|
||||
*/
|
||||
for (i = 0; subno_460gx[i] < cbn_460gx; ) {
|
||||
if (++i < 8)
|
||||
continue;
|
||||
|
||||
pciMaxBusNum = cbn_460gx + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* This does some 460GX-related processing after the PCI bus scan */
|
||||
void
|
||||
xf86PostScan460GX(void)
|
||||
{
|
||||
pciConfigPtr pPCI, *ppPCI;
|
||||
pciBusInfo_t *pBusInfo;
|
||||
int i, j, devno;
|
||||
|
||||
if (cbn_460gx <= 0)
|
||||
return;
|
||||
|
||||
/* Set up our extra bus functions */
|
||||
BusFuncs_460gx = *(pciBusInfo[0]->funcs);
|
||||
BusFuncs_460gx.pciControlBridge = Control460GXBridge;
|
||||
BusFuncs_460gx.pciGetBridgeBuses = Get460GXBridgeBuses;
|
||||
BusFuncs_460gx.pciGetBridgeResources = Get460GXBridgeResources;
|
||||
|
||||
/*
|
||||
* Mark all host bridges so that they are ignored by the upper-level
|
||||
* xf86GetPciBridgeInfo() function. This marking is later clobbered by the
|
||||
* tail end of xf86scanpci() for those bridges that actually have bus
|
||||
* segments associated with them.
|
||||
*/
|
||||
ppPCI = xf86scanpci(0); /* Recursion is only apparent */
|
||||
while ((pPCI = *ppPCI++)) {
|
||||
if ((pPCI->pci_base_class == PCI_CLASS_BRIDGE) &&
|
||||
(pPCI->pci_sub_class == PCI_SUBCLASS_BRIDGE_HOST))
|
||||
pPCI->businfo = HOST_NO_BUS;
|
||||
}
|
||||
|
||||
ppPCI = xf86scanpci(0); /* Recursion is only apparent */
|
||||
j = 0;
|
||||
|
||||
/*
|
||||
* Fix up CBN bus linkage. This is somewhat arbitrary. The bridge chosen
|
||||
* for this must be a CBN device so that bus CBN can be recognised as the
|
||||
* root segment. It also cannot be any of the bus expanders (devices
|
||||
* CBN:0x10:0 through CBN:0x17:0 nor any of their functions). For now, we
|
||||
* chose the SAC host bridge at CBN:0:0.
|
||||
*/
|
||||
pBusInfo = pciBusInfo[cbn_460gx];
|
||||
pBusInfo->bridge = pciBusInfo[0]->bridge; /* Just in case */
|
||||
while ((pPCI = *ppPCI++)) {
|
||||
if (pPCI->busnum < cbn_460gx)
|
||||
continue;
|
||||
if (pPCI->busnum > cbn_460gx)
|
||||
break;
|
||||
if (pPCI->devnum < 0)
|
||||
continue;
|
||||
if (pPCI->devnum > 0)
|
||||
break;
|
||||
if (pPCI->funcnum < 0)
|
||||
continue;
|
||||
if (pPCI->funcnum > 0)
|
||||
break;
|
||||
|
||||
pBusInfo->bridge = pPCI;
|
||||
pBusInfo->secondary = FALSE;
|
||||
pBusInfo->primary_bus = cbn_460gx;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
|
||||
/* Restore ERRCMD registers */
|
||||
if (err_460gx[i] & 0x01)
|
||||
pciWriteByte(PCI_MAKE_TAG(cbn_460gx, devno, 1),
|
||||
ERRCMD, err_460gx[i]);
|
||||
|
||||
if (!(cbdevs_460gx & (1 << devno))) {
|
||||
while ((pPCI = *ppPCI++)) {
|
||||
if (pPCI->busnum < cbn_460gx)
|
||||
continue;
|
||||
if (pPCI->busnum > cbn_460gx)
|
||||
break;
|
||||
if (pPCI->devnum < devno)
|
||||
continue;
|
||||
if (pPCI->devnum > devno)
|
||||
break;
|
||||
if (pPCI->funcnum < 0)
|
||||
continue;
|
||||
if (pPCI->funcnum > 0)
|
||||
break;
|
||||
|
||||
if ((pBusInfo == pciBusInfo[busno_460gx[i]]))
|
||||
break;
|
||||
|
||||
/* Fix bus linkage */
|
||||
pBusInfo->bridge = pPCI;
|
||||
pBusInfo->secondary = TRUE;
|
||||
pBusInfo->primary_bus = cbn_460gx;
|
||||
|
||||
/* Plug in chipset routines */
|
||||
pBusInfo->funcs = &BusFuncs_460gx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Decode IOR registers */
|
||||
for(; j <= (ior_460gx[i] & 0x0F); j++)
|
||||
iomap_460gx[j] = devno;
|
||||
}
|
||||
|
||||
/* The bottom 4k of I/O space is always routed to PCI0a */
|
||||
iomap_460gx[0] = 0x10;
|
||||
|
||||
/* Decode IORD register */
|
||||
for (j = 1; j <= 0x0F; j++)
|
||||
if (iord_460gx & (1 << j))
|
||||
iomap_460gx[j] = 0x10;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2003 The XFree86 Project, 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, 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
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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
|
||||
* XFree86 Project.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef PCI_460GX_H
|
||||
#define PCI_460GX_H 1
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include <Pci.h>
|
||||
|
||||
Bool xorgProbe460GX(scanpciWrapperOpt flags);
|
||||
void xf86PreScan460GX(void);
|
||||
void xf86PostScan460GX(void);
|
||||
|
||||
#endif
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* This file contains the glue necessary for support of SGI's Altix chipset.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "altixPCI.h"
|
||||
#include "xf86.h"
|
||||
#include "Pci.h"
|
||||
|
||||
void xf86PreScanAltix(void)
|
||||
{
|
||||
/* Nothing to see here... */
|
||||
}
|
||||
|
||||
void xf86PostScanAltix(void)
|
||||
{
|
||||
pciConfigPtr *pdev;
|
||||
int idx, free_idx;
|
||||
|
||||
/*
|
||||
* Some altix pci chipsets do not expose themselves as host
|
||||
* bridges.
|
||||
*
|
||||
* Walk the devices looking for buses for which there is not a
|
||||
* corresponding pciDevice entry (ie. pciBusInfo[]->bridge is NULL).
|
||||
*
|
||||
* It is assumed that this indicates a root bridge for which we will
|
||||
* construct a fake pci host bridge device.
|
||||
*/
|
||||
|
||||
pdev = xf86scanpci(0);
|
||||
for (idx = 0; pdev[idx] != NULL; idx++)
|
||||
;
|
||||
|
||||
free_idx = idx;
|
||||
|
||||
for (idx = 0; idx < free_idx; idx++) {
|
||||
pciConfigPtr dev, fakedev;
|
||||
pciBusInfo_t *businfo;
|
||||
|
||||
dev = pdev[idx];
|
||||
businfo = pciBusInfo[dev->busnum];
|
||||
|
||||
if (! businfo) {
|
||||
/* device has no bus ... should this be an error? */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (businfo->bridge) {
|
||||
/* bus has a device ... no need for fixup */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (free_idx >= MAX_PCI_DEVICES)
|
||||
FatalError("SN: No room for fake root bridge device\n");
|
||||
|
||||
/*
|
||||
* Construct a fake device and stick it at the end of the
|
||||
* pdev array. Make it look like a host bridge.
|
||||
*/
|
||||
fakedev = xnfcalloc(1, sizeof(pciDevice));
|
||||
fakedev->tag = PCI_MAKE_TAG(dev->busnum, 0, 0);;
|
||||
fakedev->busnum = dev->busnum;
|
||||
fakedev->devnum = 0;
|
||||
fakedev->funcnum = 0;
|
||||
fakedev->fakeDevice = 1;
|
||||
/* should figure out a better DEVID */
|
||||
fakedev->pci_device_vendor = DEVID(VENDOR_GENERIC, CHIP_VGA);
|
||||
fakedev->pci_base_class = PCI_CLASS_BRIDGE;
|
||||
|
||||
businfo->secondary = 0;
|
||||
businfo->primary_bus = dev->busnum;
|
||||
businfo->bridge = fakedev;
|
||||
|
||||
fakedev->businfo = businfo;
|
||||
|
||||
pdev[free_idx++] = fakedev;
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef PCI_ALTIX_H
|
||||
#define PCI_ALTIX_H 1
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include <Pci.h>
|
||||
|
||||
Bool xorgProbeAltix(scanpciWrapperOpt flags);
|
||||
void xf86PreScanAltix(void);
|
||||
void xf86PostScanAltix(void);
|
||||
|
||||
/* Some defines for PCI */
|
||||
#define VENDOR_SGI 0x10A9
|
||||
#define CHIP_TIO_CA 0x1010
|
||||
#define CHIP_PIC_PCI 0x1011
|
||||
|
||||
#endif
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2003 The XFree86 Project, 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, 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
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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
|
||||
* XFree86 Project.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains the glue necessary for support of Intel's E8870 chipset.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include "e8870PCI.h"
|
||||
#include "xf86.h"
|
||||
#include "Pci.h"
|
||||
|
||||
Bool
|
||||
xorgProbeE8870(scanpciWrapperOpt flags)
|
||||
{
|
||||
PCITAG tag;
|
||||
|
||||
/* Look for an E8870's Hub interface */
|
||||
tag = PCI_MAKE_TAG(0, 0x1E, 0);
|
||||
if (pciReadLong(tag, PCI_ID_REG) == DEVID(VENDOR_INTEL, CHIP_82801_P2P))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
xf86PreScanE8870(void)
|
||||
{
|
||||
/* XXX Fill me in... */
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
xf86PostScanE8870(void)
|
||||
{
|
||||
/* XXX Fill me in... */
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2003 The XFree86 Project, 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, 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
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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
|
||||
* XFree86 Project.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef PCI_E8870_H
|
||||
#define PCI_E8870_H 1
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include <Pci.h>
|
||||
|
||||
Bool xorgProbeE8870(scanpciWrapperOpt flags);
|
||||
void xf86PreScanE8870(void);
|
||||
void xf86PostScanE8870(void);
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2003 The XFree86 Project, 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, 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
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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
|
||||
* XFree86 Project.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef PCI_ZX1_H
|
||||
#define PCI_ZX1_H 1
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
|
||||
void xf86PreScanZX1(void);
|
||||
void xf86PostScanZX1(void);
|
||||
|
||||
#endif
|
|
@ -75,19 +75,9 @@ extern int iopl(int __level);
|
|||
|
||||
#ifdef __alpha__
|
||||
|
||||
# ifdef LIBC_IS_FIXED
|
||||
extern void sethae(unsigned long hae);
|
||||
# else
|
||||
# include <unistd.h>
|
||||
# define sethae(x) syscall(301,x);
|
||||
# endif
|
||||
|
||||
/* define to test the Sparse addressing on a non-Jensen */
|
||||
# ifdef TEST_JENSEN_CODE
|
||||
# define isJensen (1)
|
||||
# else
|
||||
# define isJensen (axpSystem == JENSEN)
|
||||
# endif
|
||||
|
||||
# define BUS_BASE bus_base
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
EXTRA_DIST = \
|
||||
usl_init.c \
|
||||
usl_iop.c \
|
||||
usl_mouse.c \
|
||||
usl_video.c \
|
||||
usl_vtsw.c
|
|
@ -1,357 +0,0 @@
|
|||
/*
|
||||
* Copyright 2001-2005 by Kean Johnston <jkj@sco.com>
|
||||
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
|
||||
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the names of Thomas Roell, David Wexelblat
|
||||
* and Kean Johnston not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Thomas Roell, David Wexelblat and Kean Johnston make no representations
|
||||
* about the suitability of this software for any purpose. It is provided
|
||||
* "as is" without express or implied warranty.
|
||||
*
|
||||
* THOMAS ROELL, DAVID WEXELBLAT AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT
|
||||
* OR KEAN JOHNSTON BE LIABLE FOR 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "X.h"
|
||||
#include "Xmd.h"
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86_OSlib.h"
|
||||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
static Bool KeepTty = FALSE;
|
||||
static Bool Protect0 = FALSE;
|
||||
static Bool CRTSpecified = FALSE;
|
||||
static int VTnum = -1;
|
||||
static char vtdevice[48];
|
||||
|
||||
int usl_is_osr6 = -1;
|
||||
|
||||
static Bool
|
||||
IsConsoleDevice(const char *dev)
|
||||
{
|
||||
if ((!strcmp (dev, "/dev/console")) ||
|
||||
(!strcmp (dev, "/dev/syscon")) ||
|
||||
(!strcmp (dev, "/dev/systty")))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
is_osr6 (void)
|
||||
{
|
||||
struct utsname uts;
|
||||
|
||||
if (usl_is_osr6 == -1) {
|
||||
if (uname (&uts) < 0) {
|
||||
FatalError ("get_usl_ver: Failed to determine UNIX name (%s)\n",
|
||||
strerror (errno));
|
||||
}
|
||||
|
||||
if (uts.version[0] == '6')
|
||||
usl_is_osr6 = 1;
|
||||
else
|
||||
usl_is_osr6 = 0;
|
||||
}
|
||||
|
||||
return usl_is_osr6;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
xf86OpenConsole(void)
|
||||
{
|
||||
int fd, i, ioctl_ret;
|
||||
struct vt_mode VT;
|
||||
struct vt_stat vts;
|
||||
MessageType from = X_PROBED;
|
||||
struct sigaction sigvtsw;
|
||||
char *ttn;
|
||||
|
||||
if (serverGeneration == 1) {
|
||||
int isconsole = 0, consdev = 0;
|
||||
|
||||
/* check if we're run with euid==0 */
|
||||
if (geteuid() != 0) {
|
||||
FatalError("xf86OpenConsole: Server must be suid root\n");
|
||||
}
|
||||
|
||||
/* If we are run in the background we will get SIGTTOU. Ignore it. */
|
||||
OsSignal (SIGTTOU, SIG_IGN);
|
||||
|
||||
/* Protect page 0 to help find NULL dereferencing */
|
||||
/* mprotect() doesn't seem to work */
|
||||
if (Protect0) {
|
||||
int fd = -1;
|
||||
|
||||
if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0) {
|
||||
xf86Msg(X_WARNING, "xf86OpenConsole: cannot open /dev/zero (%s)\n",
|
||||
strerror(errno));
|
||||
} else {
|
||||
if ((int)mmap(0, 0x1000, PROT_NONE,
|
||||
MAP_FIXED | MAP_SHARED, fd, 0) == -1) {
|
||||
xf86Msg(X_WARNING, "xf86OpenConsole: failed to protect page 0 (%s)\n",
|
||||
strerror(errno));
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* setup the virtual terminal manager
|
||||
*/
|
||||
if (VTnum == -1) {
|
||||
/*
|
||||
* No device was specified. We need to query the kernel to see which
|
||||
* console device we are on (and in fact if we are on a console at all).
|
||||
*/
|
||||
if (ioctl (0, VT_GETSTATE, &vts) < 0) {
|
||||
FatalError("xf86OpenConsole: Could not query active VT: %s\n",
|
||||
strerror(errno));
|
||||
}
|
||||
VTnum = vts.v_active;
|
||||
if (is_osr6())
|
||||
snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum + 1);
|
||||
else
|
||||
snprintf (vtdevice, sizeof(vtdevice), "/dev/vt%02d", VTnum);
|
||||
} else {
|
||||
from = X_CMDLINE;
|
||||
if (is_osr6())
|
||||
snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum + 1);
|
||||
else
|
||||
snprintf (vtdevice, sizeof(vtdevice), "/dev/vt%02d", VTnum);
|
||||
}
|
||||
|
||||
if (IsConsoleDevice(vtdevice)) {
|
||||
isconsole = 1;
|
||||
CRTSpecified = FALSE; /* Dont honour -crt /dev/console */
|
||||
}
|
||||
|
||||
if (ioctl (0, KIOCINFO, 0) >= 0)
|
||||
consdev = 1 + isconsole;
|
||||
|
||||
if ((!CRTSpecified) && (isconsole || (!consdev))) {
|
||||
/*
|
||||
* Need to find a free VT
|
||||
*/
|
||||
if ((fd = open ("/dev/console", O_WRONLY | O_NOCTTY)) < 0) {
|
||||
FatalError ("xf86OpenConsole: Could not open /dev/console: %s\n",
|
||||
strerror (errno));
|
||||
}
|
||||
|
||||
if (ioctl (fd, VT_OPENQRY, &VTnum) < 0) {
|
||||
FatalError ("xf86OpenConsole: Cannot find a free VT: %s\n",
|
||||
strerror(errno));
|
||||
}
|
||||
close (fd);
|
||||
if (usl_is_osr6)
|
||||
snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum + 1);
|
||||
else
|
||||
snprintf (vtdevice, sizeof(vtdevice), "/dev/vt%02d", VTnum);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we can dispose of stdin/stdout
|
||||
*/
|
||||
fclose (stdin);
|
||||
fclose (stdout);
|
||||
|
||||
if (CRTSpecified || isconsole || consdev != 1) {
|
||||
if (!KeepTty) {
|
||||
setpgrp();
|
||||
}
|
||||
}
|
||||
|
||||
if ((xf86Info.consoleFd = open(vtdevice, O_RDWR | O_NONBLOCK, 0)) < 0) {
|
||||
FatalError("xf86OpenConsole: Cannot open %s: %s\n", vtdevice,
|
||||
strerror(errno));
|
||||
}
|
||||
|
||||
xf86Msg (from, "using VT number %d (%s)\n\n", VTnum, vtdevice);
|
||||
xf86Info.vtno = VTnum;
|
||||
|
||||
/* change ownership of the vt */
|
||||
chown(vtdevice, getuid(), getgid());
|
||||
|
||||
/*
|
||||
* now get the VT
|
||||
*/
|
||||
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) {
|
||||
FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n",
|
||||
strerror(errno));
|
||||
}
|
||||
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0) {
|
||||
FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",strerror(errno));
|
||||
}
|
||||
|
||||
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) {
|
||||
FatalError("xf86OpenConsole: VT_GETMODE failed: %s\n", strerror(errno));
|
||||
}
|
||||
|
||||
sigvtsw.sa_handler = xf86VTRequest;
|
||||
sigfillset(&sigvtsw.sa_mask);
|
||||
sigvtsw.sa_flags = 0;
|
||||
sigaction(SIGUSR1, &sigvtsw, NULL);
|
||||
|
||||
VT.mode = VT_PROCESS;
|
||||
VT.relsig = SIGUSR1;
|
||||
VT.acqsig = SIGUSR1;
|
||||
|
||||
ioctl_ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
|
||||
if (ioctl_ret < 0) {
|
||||
FatalError("xf86OpenConsole: VT_SETMODE failed: %s\n", strerror(errno));
|
||||
}
|
||||
|
||||
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
|
||||
FatalError("xf86OpenConsole: KD_GRAPHICS failed: %s\n", strerror(errno));
|
||||
}
|
||||
} else { /* serverGeneration != 1 */
|
||||
/*
|
||||
* now get the VT
|
||||
*/
|
||||
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) {
|
||||
FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", strerror(errno));
|
||||
}
|
||||
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0) {
|
||||
FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",strerror(errno));
|
||||
}
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
xf86CloseConsole(void)
|
||||
{
|
||||
struct vt_mode VT;
|
||||
struct sigaction sigvtsw;
|
||||
|
||||
ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */
|
||||
|
||||
sigvtsw.sa_handler = SIG_DFL;
|
||||
sigfillset(&sigvtsw.sa_mask);
|
||||
sigvtsw.sa_flags = 0;
|
||||
sigaction(SIGUSR1, &sigvtsw, NULL);
|
||||
|
||||
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) {
|
||||
VT.mode = VT_AUTO;
|
||||
VT.waitv = 0;
|
||||
ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */
|
||||
}
|
||||
close(xf86Info.consoleFd); /* make the vt-manager happy */
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
xf86ProcessArgument(int argc, char *argv[], int i)
|
||||
{
|
||||
/*
|
||||
* Keep server from detaching from controlling tty. This is useful
|
||||
* when debugging (so the server can receive keyboard signals.
|
||||
*/
|
||||
if (!strcmp(argv[i], "-keeptty")) {
|
||||
KeepTty = TRUE;
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Undocumented flag to protect page 0 from read/write to help
|
||||
* catch NULL pointer dereferences. This is purely a debugging
|
||||
* flag.
|
||||
*/
|
||||
if (!strcmp(argv[i], "-protect0")) {
|
||||
Protect0 = TRUE;
|
||||
return(1);
|
||||
}
|
||||
|
||||
if ((argv[i][0] == 'v') && (argv[i][1] == 't')) {
|
||||
if (sscanf(argv[i], "vt%2d", &VTnum) == 0) {
|
||||
UseMsg();
|
||||
VTnum = -1;
|
||||
return(0);
|
||||
}
|
||||
VTnum -= is_osr6();
|
||||
CRTSpecified = TRUE;
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Use a device the user specifies.
|
||||
*/
|
||||
if (!strcmp(argv[i], "-crt")) {
|
||||
if (++i > argc) {
|
||||
UseMsg();
|
||||
VTnum = -1;
|
||||
return(0);
|
||||
} else {
|
||||
char *mytty = ttyname(0);
|
||||
char *arg = argv[i];
|
||||
|
||||
if (!mytty)
|
||||
mytty = "\1";
|
||||
if (!arg[0])
|
||||
arg = "\2"; /* Prevent idiots from using -crt "" */
|
||||
|
||||
if (strcmp (mytty, arg) != 0) {
|
||||
char *fmt;
|
||||
|
||||
if (is_osr6())
|
||||
fmt = "/dev/tty%02d";
|
||||
else
|
||||
fmt = "/dev/vt%02d";
|
||||
|
||||
if (sscanf(arg, fmt, &VTnum) == 0) {
|
||||
UseMsg();
|
||||
VTnum = -1;
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* OSR6 devices start names at 1, UW7 starts at 0 */
|
||||
VTnum -= is_osr6();
|
||||
CRTSpecified = TRUE;
|
||||
}
|
||||
return(2);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void
|
||||
xf86UseMsg(void)
|
||||
{
|
||||
if (is_osr6()) {
|
||||
ErrorF("-crt /dev/ttyXX use the specified VT device\n");
|
||||
ErrorF("vtXX use the specified VT number (01-16)\n");
|
||||
} else {
|
||||
ErrorF("-crt /dev/vtXX use the specified VT device\n");
|
||||
ErrorF("vtXX use the specified VT number (00-15)\n");
|
||||
}
|
||||
|
||||
ErrorF("-keeptty ");
|
||||
ErrorF("don't detach controlling tty (for debugging only)\n");
|
||||
return;
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
/*
|
||||
* Copyright 2001,2005 by Kean Johnston <jkj@sco.com>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name Kean Johnston not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Kean Johnston makes no
|
||||
* representations about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEAN JOHNSTON BE LIABLE FOR 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.
|
||||
*/
|
||||
|
||||
|
||||
#include "X.h"
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
#define _NEED_SYSI86
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86OSpriv.h"
|
||||
#include "xf86_OSlib.h"
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* I/O Permissions section */
|
||||
/***************************************************************************/
|
||||
|
||||
static Bool IOEnabled = FALSE;
|
||||
|
||||
_X_EXPORT Bool
|
||||
xf86EnableIO(void)
|
||||
{
|
||||
if (IOEnabled)
|
||||
return TRUE;
|
||||
|
||||
if (sysi86(SI86IOPL, 3) < 0)
|
||||
FatalError("Failed to set IOPL for extended I/O\n");
|
||||
IOEnabled = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
xf86DisableIO(void)
|
||||
{
|
||||
if (!IOEnabled)
|
||||
return;
|
||||
|
||||
sysi86(SI86IOPL, 0);
|
||||
IOEnabled = FALSE;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
/* Interrupt Handling section */
|
||||
/***************************************************************************/
|
||||
|
||||
_X_EXPORT Bool
|
||||
xf86DisableInterrupts(void)
|
||||
{
|
||||
if (!IOEnabled) {
|
||||
if (sysi86(SI86IOPL, 3) < 0)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
__asm__ __volatile__("cli");
|
||||
#else
|
||||
asm("cli");
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
if (!IOEnabled) {
|
||||
sysi86(SI86IOPL, 0);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
xf86EnableInterrupts(void)
|
||||
{
|
||||
if (!IOEnabled) {
|
||||
if (sysi86(SI86IOPL, 3) < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
__asm__ __volatile__("sti");
|
||||
#else
|
||||
asm("sti");
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
if (!IOEnabled) {
|
||||
sysi86(SI86IOPL, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
/*
|
||||
* Copyrught 2005 Kean Johnston <jkj@sco.com>
|
||||
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
|
||||
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the names of Thomas Roell, David Dawes
|
||||
* and Kean Johnston not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Thomas Roell, David Dawes and Kean Johnston make no representations
|
||||
* about the suitability of this software for any purpose. It is provided
|
||||
* "as is" without express or implied warranty.
|
||||
*
|
||||
* THOMAS ROELL, DAVID DAWES AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT
|
||||
* OR KEAN JOHNSTON BE LIABLE FOR 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "X.h"
|
||||
|
||||
#define _NEED_SYSI86
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86_OSlib.h"
|
||||
#include "xf86OSpriv.h"
|
||||
|
||||
#ifndef MAP_FAILED
|
||||
#define MAP_FAILED ((void *)-1)
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
linearVidMem(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static pointer
|
||||
mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
|
||||
{
|
||||
pointer base;
|
||||
int fd;
|
||||
|
||||
fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
|
||||
if (fd < 0) {
|
||||
FatalError("xf86MapVidMem: failed to open %s (%s)\n",
|
||||
DEV_MEM, strerror(errno));
|
||||
}
|
||||
base = mmap((caddr_t)0, Size, (flags & VIDMEM_READONLY) ?
|
||||
PROT_READ : (PROT_READ | PROT_WRITE),
|
||||
MAP_SHARED, fd, (off_t)Base);
|
||||
close(fd);
|
||||
|
||||
if (base == MAP_FAILED) {
|
||||
FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n",
|
||||
"xf86MapVidMem", Size, Base, strerror(errno));
|
||||
}
|
||||
return(base);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
|
||||
{
|
||||
munmap(Base, Size);
|
||||
}
|
||||
|
||||
/*
|
||||
* For some SVR4 versions, a 32-bit read is done for the first location
|
||||
* in each page when the page is first mapped. If this is done while
|
||||
* memory access is enabled for regions that have read side-effects,
|
||||
* this can cause unexpected results, including lockups on some hardware.
|
||||
* This function is called to make sure each page is mapped while it is
|
||||
* safe to do so.
|
||||
*/
|
||||
|
||||
#define X_PAGE_SIZE 4096
|
||||
|
||||
static void
|
||||
readSideEffects(int ScreenNum, pointer Base, unsigned long Size)
|
||||
{
|
||||
unsigned long base, end, addr;
|
||||
CARD32 val;
|
||||
|
||||
base = (unsigned long)Base;
|
||||
end = base + Size;
|
||||
|
||||
for (addr = base; addr < end; addr += X_PAGE_SIZE)
|
||||
val = *(volatile CARD32 *)addr;
|
||||
}
|
||||
|
||||
void
|
||||
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
|
||||
{
|
||||
pVidMem->linearSupported = linearVidMem();
|
||||
pVidMem->mapMem = mapVidMem;
|
||||
pVidMem->unmapMem = unmapVidMem;
|
||||
pVidMem->readSideEffects = readSideEffects;
|
||||
pVidMem->initialised = TRUE;
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* Copyright 2005 by Kean Johnston <jkj@sco.com>
|
||||
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
|
||||
* Copyright 1993 by David McCullough <davidm@stallion.oz.au>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of David Wexelblat not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. David Wexelblat makes no representations
|
||||
* about the suitability of this software for any purpose. It is provided
|
||||
* "as is" without express or implied warranty.
|
||||
*
|
||||
* DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "X.h"
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86_OSlib.h"
|
||||
|
||||
/*
|
||||
* Handle the VT-switching interface for SCO UnixWare / OpenServer 6
|
||||
*/
|
||||
|
||||
/*
|
||||
* This function is the signal handler for the VT-switching signal. It
|
||||
* is only referenced inside the OS-support layer. NOTE: we do NOT need
|
||||
* to re-arm the signal here, since we used sigaction() to set the signal
|
||||
* disposition in usl_init.c. If we had used signal(), we would need to
|
||||
* re-arm the signal here. All we need to do now is record the fact that
|
||||
* we got the signal. XFree86 handles the rest.
|
||||
*/
|
||||
void
|
||||
xf86VTRequest(int sig)
|
||||
{
|
||||
xf86Info.vtRequestsPending = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
Bool
|
||||
xf86VTSwitchPending(void)
|
||||
{
|
||||
return(xf86Info.vtRequestsPending ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
static int usl_ledstatus = -1;
|
||||
static unsigned int usl_ledstate = 0;
|
||||
|
||||
Bool
|
||||
xf86VTSwitchAway(void)
|
||||
{
|
||||
usl_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &usl_ledstate);
|
||||
|
||||
xf86Info.vtRequestsPending = FALSE;
|
||||
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) {
|
||||
return(FALSE);
|
||||
} else {
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
xf86VTSwitchTo(void)
|
||||
{
|
||||
xf86Info.vtRequestsPending = FALSE;
|
||||
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
|
||||
return(FALSE);
|
||||
} else {
|
||||
if (usl_ledstatus >= 0) {
|
||||
ioctl (xf86Info.consoleFd, KDSETLED, usl_ledstate);
|
||||
}
|
||||
usl_ledstatus = -1;
|
||||
|
||||
/*
|
||||
* Convince the console driver this screen is in graphics mode,
|
||||
* otherwise it assumes it can do more to the screen than it should.
|
||||
*/
|
||||
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
|
||||
ErrorF("Failed to set graphics mode (%s)\n", strerror(errno));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
|
@ -214,12 +214,6 @@
|
|||
# define VT_SYSREQ_DEFAULT TRUE
|
||||
# endif
|
||||
|
||||
# ifdef SYSV
|
||||
# if !defined(ISC) || defined(ISC202) || defined(ISC22)
|
||||
# define NEED_STRERROR
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* (SYSV || SVR4) && !DGUX */
|
||||
|
||||
|
||||
|
@ -578,15 +572,14 @@
|
|||
# define MAXHOSTNAMELEN 32
|
||||
#endif /* !MAXHOSTNAMELEN */
|
||||
|
||||
#if !defined(X_NOT_POSIX)
|
||||
# if defined(_POSIX_SOURCE)
|
||||
# include <limits.h>
|
||||
# else
|
||||
# define _POSIX_SOURCE
|
||||
# include <limits.h>
|
||||
# undef _POSIX_SOURCE
|
||||
# endif /* _POSIX_SOURCE */
|
||||
#endif /* !X_NOT_POSIX */
|
||||
#if defined(_POSIX_SOURCE)
|
||||
# include <limits.h>
|
||||
#else
|
||||
# define _POSIX_SOURCE
|
||||
# include <limits.h>
|
||||
# undef _POSIX_SOURCE
|
||||
#endif /* _POSIX_SOURCE */
|
||||
|
||||
#if !defined(PATH_MAX)
|
||||
# if defined(MAXPATHLEN)
|
||||
# define PATH_MAX MAXPATHLEN
|
||||
|
@ -595,15 +588,6 @@
|
|||
# endif /* MAXPATHLEN */
|
||||
#endif /* !PATH_MAX */
|
||||
|
||||
#ifdef NEED_STRERROR
|
||||
# ifndef strerror
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
# define strerror(n) \
|
||||
((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error"
|
||||
# endif /* !strerror */
|
||||
#endif /* NEED_STRERROR */
|
||||
|
||||
#if defined(ISC)
|
||||
#define rint(x) RInt(x)
|
||||
double RInt(
|
||||
|
|
|
@ -32,8 +32,7 @@ EXTRA_DIST = \
|
|||
configProcs.h \
|
||||
xf86Optrec.h \
|
||||
xf86Parser.h \
|
||||
xf86tokens.h \
|
||||
cpconfig.c
|
||||
xf86tokens.h
|
||||
|
||||
sdk_HEADERS = \
|
||||
$(LIBHEADERS) \
|
||||
|
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 1997 Metro Link Incorporated
|
||||
*
|
||||
* 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 X CONSORTIUM 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 Metro Link shall not be
|
||||
* used in advertising or otherwise to promote the sale, use or other dealings
|
||||
* in this Software without prior written authorization from Metro Link.
|
||||
*
|
||||
*/
|
||||
|
||||
/* View/edit this file with tab stops set to 4 */
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include "xf86Parser.h"
|
||||
#include "configProcs.h"
|
||||
|
||||
#ifdef MALLOC_FUNCTIONS
|
||||
void
|
||||
xfree (void *p)
|
||||
{
|
||||
free (p);
|
||||
return;
|
||||
}
|
||||
|
||||
void *
|
||||
xalloc (int size)
|
||||
{
|
||||
return malloc (size);
|
||||
}
|
||||
|
||||
void *
|
||||
xrealloc (void *p, int size)
|
||||
{
|
||||
return realloc (p, size);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define CONFPATH "%A,%R,/etc/X11/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F," \
|
||||
"%P/etc/X11/%F,/etc/X11/%X,/etc/%X,%P/etc/X11/%X.%H," \
|
||||
"%P/etc/X11/%X,%P/lib/X11/%X.%H,%P/lib/X11/%X"
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
const char *filename;
|
||||
char *cmdline = NULL;
|
||||
XF86ConfigPtr conf;
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
cmdline = argv[1];
|
||||
}
|
||||
if ((filename = xf86openConfigFile (CONFPATH, cmdline, NULL)))
|
||||
{
|
||||
fprintf (stderr, "Opened %s for the config file\n", filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "Unable to open config file\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if ((conf = xf86readConfigFile ()) == NULL)
|
||||
{
|
||||
fprintf (stderr, "Problem when parsing config file\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "Config file parsed OK\n");
|
||||
}
|
||||
xf86closeConfigFile ();
|
||||
|
||||
if (argc > 2) {
|
||||
fprintf(stderr, "Writing config file to `%s'\n", argv[2]);
|
||||
xf86writeConfigFile (argv[2], conf);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Functions that the parser requires */
|
||||
|
||||
_X_EXPORT void
|
||||
VErrorF(const char *f, va_list args)
|
||||
{
|
||||
vfprintf(stderr, f, args);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
ErrorF(const char *f, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, f);
|
||||
vfprintf(stderr, f, args);
|
||||
va_end(args);
|
||||
}
|
|
@ -66,7 +66,6 @@
|
|||
#include <stdarg.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#if !defined(X_NOT_POSIX)
|
||||
#if defined(_POSIX_SOURCE)
|
||||
#include <limits.h>
|
||||
#else
|
||||
|
@ -74,7 +73,7 @@
|
|||
#include <limits.h>
|
||||
#undef _POSIX_SOURCE
|
||||
#endif /* _POSIX_SOURCE */
|
||||
#endif /* !X_NOT_POSIX */
|
||||
|
||||
#if !defined(PATH_MAX)
|
||||
#if defined(MAXPATHLEN)
|
||||
#define PATH_MAX MAXPATHLEN
|
||||
|
|
|
@ -68,15 +68,6 @@
|
|||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if ((defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
|
||||
#ifndef strerror
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
#define strerror(n) \
|
||||
(((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#define HAS_SAVED_IDS_AND_SETEUID
|
||||
#endif
|
||||
|
|
|
@ -294,9 +294,6 @@
|
|||
/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */
|
||||
#undef SECURE_RPC
|
||||
|
||||
/* Use a lock to prevent multiple servers on a display */
|
||||
#undef SERVER_LOCK
|
||||
|
||||
/* Support SHAPE extension */
|
||||
#undef SHAPE
|
||||
|
||||
|
|
|
@ -245,10 +245,8 @@ extern OsSigHandlerPtr OsSignal(int /* sig */, OsSigHandlerPtr /* handler */);
|
|||
|
||||
extern int auditTrailLevel;
|
||||
|
||||
#ifdef SERVER_LOCK
|
||||
extern void LockServer(void);
|
||||
extern void UnlockServer(void);
|
||||
#endif
|
||||
|
||||
extern int OsLookupColor(
|
||||
int /*screen*/,
|
||||
|
|
|
@ -131,31 +131,6 @@ extern RegDataRec miBrokenData;
|
|||
#define REGION_BREAK(_pScreen, _pReg) \
|
||||
miRegionBreak(_pReg)
|
||||
|
||||
#ifdef DONT_INLINE_REGION_OPS
|
||||
|
||||
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
|
||||
miRegionInit(_pReg, _rect, _size)
|
||||
|
||||
#define REGION_UNINIT(_pScreen, _pReg) \
|
||||
miRegionUninit(_pReg)
|
||||
|
||||
#define REGION_RESET(_pScreen, _pReg, _pBox) \
|
||||
miRegionReset(_pReg, _pBox)
|
||||
|
||||
#define REGION_NOTEMPTY(_pScreen, _pReg) \
|
||||
miRegionNotEmpty(_pReg)
|
||||
|
||||
#define REGION_BROKEN(_pScreen, _pReg) \
|
||||
miRegionBroken(_pReg)
|
||||
|
||||
#define REGION_EMPTY(_pScreen, _pReg) \
|
||||
miRegionEmpty(_pReg)
|
||||
|
||||
#define REGION_EXTENTS(_pScreen, _pReg) \
|
||||
miRegionExtents(_pReg)
|
||||
|
||||
#else /* inline certain simple region ops for performance */
|
||||
|
||||
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
|
||||
{ \
|
||||
if ((_rect) != NULL) \
|
||||
|
@ -216,8 +191,6 @@ extern RegDataRec miBrokenData;
|
|||
(_pReg)->data = &miEmptyData; \
|
||||
}
|
||||
|
||||
#endif /* DONT_INLINE_REGION_OPS */
|
||||
|
||||
#ifndef REGION_NULL
|
||||
#define REGION_NULL(_pScreen, _pReg) \
|
||||
REGION_INIT(_pScreen, _pReg, NullBox, 1)
|
||||
|
|
|
@ -68,14 +68,6 @@ SOFTWARE.
|
|||
* GLYPHPADBYTES is used.
|
||||
*/
|
||||
|
||||
#ifdef vax
|
||||
|
||||
#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */
|
||||
#define BITMAP_BIT_ORDER LSBFirst
|
||||
#define GLYPHPADBYTES 1
|
||||
|
||||
#endif /* vax */
|
||||
|
||||
#ifdef __avr32__
|
||||
|
||||
#define IMAGE_BYTE_ORDER MSBFirst
|
||||
|
@ -87,17 +79,7 @@ SOFTWARE.
|
|||
#ifdef __arm32__
|
||||
|
||||
#define IMAGE_BYTE_ORDER LSBFirst
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
|
||||
# define BITMAP_BIT_ORDER MSBFirst
|
||||
# else
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# endif
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16)
|
||||
# define BITMAP_SCANLINE_UNIT 8
|
||||
# endif
|
||||
|
||||
#define BITMAP_BIT_ORDER LSBFirst
|
||||
#define GLYPHPADBYTES 4
|
||||
|
||||
#endif /* __arm32__ */
|
||||
|
@ -193,22 +175,6 @@ SOFTWARE.
|
|||
|
||||
#endif /* ibm */
|
||||
|
||||
#if defined (M4310) || defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330)
|
||||
|
||||
#define IMAGE_BYTE_ORDER MSBFirst /* Values for Pegasus only */
|
||||
#define BITMAP_BIT_ORDER MSBFirst
|
||||
#define GLYPHPADBYTES 4
|
||||
|
||||
#endif /* tektronix */
|
||||
|
||||
#ifdef macII
|
||||
|
||||
#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MacII only */
|
||||
#define BITMAP_BIT_ORDER MSBFirst
|
||||
#define GLYPHPADBYTES 4
|
||||
|
||||
#endif /* macII */
|
||||
|
||||
#if (defined(mips) || defined(__mips)) && !defined(sgi)
|
||||
|
||||
#if defined(MIPSEL) || defined(__MIPSEL__)
|
||||
|
@ -223,19 +189,9 @@ SOFTWARE.
|
|||
|
||||
#endif /* mips */
|
||||
|
||||
#if defined(__alpha) || defined(__alpha__) || defined(__alphaCross)
|
||||
#if defined(__alpha) || defined(__alpha__)
|
||||
# define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
|
||||
# define BITMAP_BIT_ORDER MSBFirst
|
||||
# else
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# endif
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16)
|
||||
# define BITMAP_SCANLINE_UNIT 8
|
||||
# endif
|
||||
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# define GLYPHPADBYTES 4
|
||||
|
||||
#endif /* alpha */
|
||||
|
@ -264,60 +220,20 @@ SOFTWARE.
|
|||
|
||||
|
||||
#if defined(__ia64__) || defined(ia64)
|
||||
|
||||
# define IMAGE_BYTE_ORDER LSBFirst
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
|
||||
# define BITMAP_BIT_ORDER MSBFirst
|
||||
# else
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# endif
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16)
|
||||
# define BITMAP_SCANLINE_UNIT 8
|
||||
# endif
|
||||
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# define GLYPHPADBYTES 4
|
||||
|
||||
#endif /* ia64 */
|
||||
|
||||
#if defined(__amd64__) || defined(amd64) || defined(__amd64)
|
||||
# define IMAGE_BYTE_ORDER LSBFirst
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
|
||||
# define BITMAP_BIT_ORDER MSBFirst
|
||||
# else
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# endif
|
||||
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16)
|
||||
# define BITMAP_SCANLINE_UNIT 8
|
||||
# endif
|
||||
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# define GLYPHPADBYTES 4
|
||||
/* ???? */
|
||||
#endif /* AMD64 */
|
||||
|
||||
#ifdef stellar
|
||||
|
||||
#define IMAGE_BYTE_ORDER MSBFirst /* Values for the stellar only*/
|
||||
#define BITMAP_BIT_ORDER MSBFirst
|
||||
#define GLYPHPADBYTES 4
|
||||
#define IMAGE_BUFSIZE (64*1024)
|
||||
/*
|
||||
* Use SysV random number generator.
|
||||
*/
|
||||
#define random rand
|
||||
|
||||
#endif /* stellar */
|
||||
|
||||
#ifdef luna
|
||||
|
||||
#define IMAGE_BYTE_ORDER MSBFirst /* Values for the OMRON only*/
|
||||
#define BITMAP_BIT_ORDER MSBFirst
|
||||
#define GLYPHPADBYTES 4
|
||||
|
||||
#endif /* luna */
|
||||
|
||||
#if (defined(SVR4) && (defined(__i386__) || (defined(__i386)))) || \
|
||||
defined(__alpha__) || defined(__alpha) || \
|
||||
defined(__i386__) || defined(__QNX__) || \
|
||||
|
@ -328,28 +244,13 @@ SOFTWARE.
|
|||
#endif
|
||||
|
||||
#ifndef BITMAP_BIT_ORDER
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
|
||||
# define BITMAP_BIT_ORDER MSBFirst
|
||||
# else
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef BITMAP_SCANLINE_UNIT
|
||||
# if defined(XF86MONOVGA) || defined(XF86VGA16)
|
||||
# define BITMAP_SCANLINE_UNIT 8
|
||||
# endif
|
||||
# define BITMAP_BIT_ORDER LSBFirst
|
||||
#endif
|
||||
|
||||
#ifndef GLYPHPADBYTES
|
||||
#define GLYPHPADBYTES 4
|
||||
#endif
|
||||
|
||||
#ifdef XSVGA
|
||||
#define AVOID_GLYPHBLT
|
||||
#define NO_ONE_RECT
|
||||
#endif
|
||||
|
||||
#endif /* SVR4 / BSD / i386 */
|
||||
|
||||
#if defined (linux) && defined (__mc68000__)
|
||||
|
@ -368,7 +269,7 @@ SOFTWARE.
|
|||
|
||||
#endif
|
||||
|
||||
/* linux on the Compaq Itsy */
|
||||
/* linux on ARM */
|
||||
#if defined(linux) && defined(__arm__)
|
||||
#define IMAGE_BYTE_ORDER LSBFirst
|
||||
#define BITMAP_BIT_ORDER LSBFirst
|
||||
|
@ -383,8 +284,8 @@ SOFTWARE.
|
|||
#endif /* linux/s390 */
|
||||
|
||||
/* size of buffer to use with GetImage, measured in bytes. There's obviously
|
||||
* a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
|
||||
* you) used and the number of times the ddx routine has to be called.
|
||||
* a trade-off between the amount of heap used and the number of times the
|
||||
* ddx routine has to be called.
|
||||
*/
|
||||
#ifndef IMAGE_BUFSIZE
|
||||
#define IMAGE_BUFSIZE (64*1024)
|
||||
|
|
|
@ -70,9 +70,6 @@
|
|||
/* Support MIT-SCREEN-SAVER extension */
|
||||
#undef SCREENSAVER
|
||||
|
||||
/* Use a lock to prevent multiple servers on a display */
|
||||
#undef SERVER_LOCK
|
||||
|
||||
/* Support SHAPE extension */
|
||||
#undef SHAPE
|
||||
|
||||
|
|
167
os/access.c
167
os/access.c
|
@ -95,20 +95,6 @@ SOFTWARE.
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(DGUX)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/stream.h>
|
||||
#include <sys/stropts.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sockio.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(hpux) || defined(QNX4)
|
||||
# include <sys/utsname.h>
|
||||
# ifdef HAS_IFREQ
|
||||
|
@ -304,7 +290,7 @@ AccessUsingXdmcp (void)
|
|||
}
|
||||
|
||||
|
||||
#if ((defined(SVR4) && !defined(DGUX) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
|
||||
#if ((defined(SVR4) && !defined(SCO325) && !defined(sun)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
|
||||
|
||||
/* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
|
||||
|
||||
|
@ -353,9 +339,9 @@ ifioctl (int fd, int cmd, char *arg)
|
|||
#endif
|
||||
return(ret);
|
||||
}
|
||||
#else /* Case DGUX, sun, SCO325 NCR and others */
|
||||
#else /* Case sun, SCO325 and others */
|
||||
#define ifioctl ioctl
|
||||
#endif /* ((SVR4 && !DGUX !sun !SCO325 !NCR) || ISC) && SIOCGIFCONF */
|
||||
#endif /* ((SVR4 && !sun !SCO325) || ISC) && SIOCGIFCONF */
|
||||
|
||||
/*
|
||||
* DefineSelf (fd):
|
||||
|
@ -364,152 +350,6 @@ ifioctl (int fd, int cmd, char *arg)
|
|||
* for this fd and add them to the selfhosts list.
|
||||
*/
|
||||
|
||||
#ifdef WINTCP /* NCR Wollongong based TCP */
|
||||
|
||||
#include <sys/un.h>
|
||||
#include <stropts.h>
|
||||
#include <tiuser.h>
|
||||
|
||||
#include <sys/stream.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/ip_var.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_var.h>
|
||||
|
||||
void
|
||||
DefineSelf (int fd)
|
||||
{
|
||||
/*
|
||||
* The Wolongong drivers used by NCR SVR4/MP-RAS don't understand the
|
||||
* socket IO calls that most other drivers seem to like. Because of
|
||||
* this, this routine must be special cased for NCR. Eventually,
|
||||
* this will be cleared up.
|
||||
*/
|
||||
|
||||
struct ipb ifnet;
|
||||
struct in_ifaddr ifaddr;
|
||||
struct strioctl str;
|
||||
unsigned char *addr;
|
||||
register HOST *host;
|
||||
int family, len;
|
||||
|
||||
if ((fd = open ("/dev/ip", O_RDWR, 0 )) < 0)
|
||||
Error ("Getting interface configuration (1)");
|
||||
|
||||
/* Indicate that we want to start at the begining */
|
||||
ifnet.ib_next = (struct ipb *) 1;
|
||||
|
||||
while (ifnet.ib_next)
|
||||
{
|
||||
str.ic_cmd = IPIOC_GETIPB;
|
||||
str.ic_timout = 0;
|
||||
str.ic_len = sizeof (struct ipb);
|
||||
str.ic_dp = (char *) &ifnet;
|
||||
|
||||
if (ioctl (fd, (int) I_STR, (char *) &str) < 0)
|
||||
{
|
||||
close (fd);
|
||||
Error ("Getting interface configuration (2)");
|
||||
}
|
||||
|
||||
ifaddr.ia_next = (struct in_ifaddr *) ifnet.if_addrlist;
|
||||
str.ic_cmd = IPIOC_GETINADDR;
|
||||
str.ic_timout = 0;
|
||||
str.ic_len = sizeof (struct in_ifaddr);
|
||||
str.ic_dp = (char *) &ifaddr;
|
||||
|
||||
if (ioctl (fd, (int) I_STR, (char *) &str) < 0)
|
||||
{
|
||||
close (fd);
|
||||
Error ("Getting interface configuration (3)");
|
||||
}
|
||||
|
||||
len = sizeof(struct sockaddr_in);
|
||||
family = ConvertAddr (IA_SIN(&ifaddr), &len, (pointer *)&addr);
|
||||
if (family == -1 || family == FamilyLocal)
|
||||
continue;
|
||||
for (host = selfhosts;
|
||||
host && !addrEqual (family, addr, len, host);
|
||||
host = host->next)
|
||||
;
|
||||
if (host)
|
||||
continue;
|
||||
MakeHost(host,len)
|
||||
if (host)
|
||||
{
|
||||
host->family = family;
|
||||
host->len = len;
|
||||
acopy(addr, host->addr, len);
|
||||
host->next = selfhosts;
|
||||
selfhosts = host;
|
||||
}
|
||||
#ifdef XDMCP
|
||||
{
|
||||
struct sockaddr broad_addr;
|
||||
|
||||
/*
|
||||
* If this isn't an Internet Address, don't register it.
|
||||
*/
|
||||
if (family != FamilyInternet)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Ignore 'localhost' entries as they're not useful
|
||||
* on the other end of the wire.
|
||||
*/
|
||||
if (len == 4 &&
|
||||
addr[0] == 127 && addr[1] == 0 &&
|
||||
addr[2] == 0 && addr[3] == 1)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Ignore '0.0.0.0' entries as they are
|
||||
* returned by some OSes for unconfigured NICs but they are
|
||||
* not useful on the other end of the wire.
|
||||
*/
|
||||
if (len == 4 &&
|
||||
addr[0] == 0 && addr[1] == 0 &&
|
||||
addr[2] == 0 && addr[3] == 0)
|
||||
continue;
|
||||
|
||||
XdmcpRegisterConnection (family, (char *)addr, len);
|
||||
|
||||
|
||||
#define IA_BROADADDR(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_broadaddr))
|
||||
|
||||
XdmcpRegisterBroadcastAddress (
|
||||
(struct sockaddr_in *) IA_BROADADDR(&ifaddr));
|
||||
|
||||
#undef IA_BROADADDR
|
||||
}
|
||||
#endif /* XDMCP */
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
/*
|
||||
* add something of FamilyLocalHost
|
||||
*/
|
||||
for (host = selfhosts;
|
||||
host && !addrEqual(FamilyLocalHost, "", 0, host);
|
||||
host = host->next);
|
||||
if (!host)
|
||||
{
|
||||
MakeHost(host, 0);
|
||||
if (host)
|
||||
{
|
||||
host->family = FamilyLocalHost;
|
||||
host->len = 0;
|
||||
acopy("", host->addr, 0);
|
||||
host->next = selfhosts;
|
||||
selfhosts = host;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else /* WINTCP */
|
||||
|
||||
#if !defined(SIOCGIFCONF) || (defined (hpux) && ! defined (HAS_IFREQ)) || defined(QNX4)
|
||||
void
|
||||
DefineSelf (int fd)
|
||||
|
@ -1089,7 +929,6 @@ DefineSelf (int fd)
|
|||
}
|
||||
}
|
||||
#endif /* hpux && !HAS_IFREQ */
|
||||
#endif /* WINTCP */
|
||||
|
||||
#ifdef XDMCP
|
||||
void
|
||||
|
|
|
@ -90,18 +90,6 @@ SOFTWARE.
|
|||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#if defined(DGUX)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef AIXV3
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
@ -134,11 +122,7 @@ SOFTWARE.
|
|||
#include "dixstruct.h"
|
||||
#include "xace.h"
|
||||
|
||||
#ifdef X_NOT_POSIX
|
||||
#define Pid_t int
|
||||
#else
|
||||
#define Pid_t pid_t
|
||||
#endif
|
||||
|
||||
#ifdef DNETCONN
|
||||
#include <netdnet/dn.h>
|
||||
|
|
8
os/io.c
8
os/io.c
|
@ -92,15 +92,7 @@ static ConnectionOutputPtr AllocateOutputBuffer(void);
|
|||
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
|
||||
*/
|
||||
#ifndef WIN32
|
||||
#if defined(EAGAIN) && defined(EWOULDBLOCK)
|
||||
#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
|
||||
#else
|
||||
#ifdef EAGAIN
|
||||
#define ETEST(err) (err == EAGAIN)
|
||||
#else
|
||||
#define ETEST(err) (err == EWOULDBLOCK)
|
||||
#endif
|
||||
#endif
|
||||
#else /* WIN32 The socket errorcodes differ from the normal errors*/
|
||||
#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
|
||||
#endif
|
||||
|
|
18
os/log.c
18
os/log.c
|
@ -527,9 +527,6 @@ FatalError(const char *f, ...)
|
|||
#ifdef DDXOSFATALERROR
|
||||
if (!beenhere)
|
||||
OsVendorFatalError();
|
||||
#endif
|
||||
#ifdef ABORTONFATALERROR
|
||||
abort();
|
||||
#endif
|
||||
if (!beenhere) {
|
||||
beenhere = TRUE;
|
||||
|
@ -564,21 +561,6 @@ ErrorF(const char * f, ...)
|
|||
|
||||
/* A perror() workalike. */
|
||||
|
||||
#ifndef NEED_STRERROR
|
||||
#ifdef SYSV
|
||||
#if !defined(ISC) || defined(ISC202) || defined(ISC22)
|
||||
#define NEED_STRERROR
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_STRERROR) && !defined(strerror)
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
#define strerror(n) \
|
||||
((n) >= 0 && (n) < sys_nerr) ? sys_errlist[(n)] : "unknown error"
|
||||
#endif
|
||||
|
||||
_X_EXPORT void
|
||||
Error(char *str)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include <X11/Xdmcp.h>
|
||||
|
||||
#ifndef sgi /* SGI defines OPEN_MAX in a useless way */
|
||||
#ifndef X_NOT_POSIX
|
||||
#ifdef _POSIX_SOURCE
|
||||
#include <limits.h>
|
||||
#else
|
||||
|
@ -67,13 +66,6 @@ SOFTWARE.
|
|||
#include <limits.h>
|
||||
#undef _POSIX_SOURCE
|
||||
#endif
|
||||
#else /* X_NOT_POSIX */
|
||||
#ifdef WIN32
|
||||
#define _POSIX_
|
||||
#include <limits.h>
|
||||
#undef _POSIX_
|
||||
#endif
|
||||
#endif /* X_NOT_POSIX */
|
||||
#endif
|
||||
|
||||
#ifdef __QNX__
|
||||
|
|
11
os/osinit.c
11
os/osinit.c
|
@ -141,15 +141,8 @@ OsInit(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifndef X_NOT_POSIX
|
||||
if (getpgrp () == 0)
|
||||
setpgid (0, 0);
|
||||
#else
|
||||
#if !defined(SYSV) && !defined(WIN32)
|
||||
if (getpgrp (0) == 0)
|
||||
setpgrp (0, getpid ());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef RLIMIT_DATA
|
||||
if (limitDataSpace >= 0)
|
||||
|
@ -196,9 +189,7 @@ OsInit(void)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef SERVER_LOCK
|
||||
LockServer();
|
||||
#endif
|
||||
been_here = TRUE;
|
||||
}
|
||||
TimerInit();
|
||||
|
@ -221,10 +212,8 @@ OsInit(void)
|
|||
void
|
||||
OsCleanup(Bool terminating)
|
||||
{
|
||||
#ifdef SERVER_LOCK
|
||||
if (terminating)
|
||||
{
|
||||
UnlockServer();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
10
os/rpcauth.c
10
os/rpcauth.c
|
@ -52,16 +52,6 @@ from The Open Group.
|
|||
extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
|
||||
#endif
|
||||
|
||||
#if defined(DGUX)
|
||||
#include <time.h>
|
||||
#include <rpc/auth_des.h>
|
||||
#endif /* DGUX */
|
||||
|
||||
#ifdef ultrix
|
||||
#include <time.h>
|
||||
#include <rpc/auth_des.h>
|
||||
#endif
|
||||
|
||||
static enum auth_stat why;
|
||||
|
||||
static char *
|
||||
|
|
35
os/utils.c
35
os/utils.c
|
@ -83,7 +83,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <signal.h>
|
||||
#undef _POSIX_C_SOURCE
|
||||
#else
|
||||
#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
|
||||
#if defined(_POSIX_SOURCE)
|
||||
#include <signal.h>
|
||||
#else
|
||||
#define _POSIX_SOURCE
|
||||
|
@ -101,11 +101,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <ctype.h> /* for isspace */
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined(DGUX)
|
||||
#include <sys/resource.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h> /* for malloc() */
|
||||
|
||||
#if defined(TCPCONN) || defined(STREAMSCONN)
|
||||
|
@ -261,9 +256,6 @@ OsSignal(sig, handler)
|
|||
int sig;
|
||||
OsSigHandlerPtr handler;
|
||||
{
|
||||
#ifdef X_NOT_POSIX
|
||||
return signal(sig, handler);
|
||||
#else
|
||||
struct sigaction act, oact;
|
||||
|
||||
sigemptyset(&act.sa_mask);
|
||||
|
@ -274,10 +266,8 @@ OsSignal(sig, handler)
|
|||
if (sigaction(sig, &act, &oact))
|
||||
perror("sigaction");
|
||||
return oact.sa_handler;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SERVER_LOCK
|
||||
|
||||
/*
|
||||
* Explicit support for a server lock file like the ones used for UUCP.
|
||||
* For architectures with virtual terminals that can run more than one
|
||||
|
@ -289,11 +279,6 @@ OsSignal(sig, handler)
|
|||
#define LOCK_PREFIX "/.X"
|
||||
#define LOCK_SUFFIX "-lock"
|
||||
|
||||
#if defined(DGUX)
|
||||
#include <limits.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#include <sys/param.h>
|
||||
#ifndef PATH_MAX
|
||||
|
@ -369,11 +354,7 @@ LockServer(void)
|
|||
FatalError("Could not create lock file in %s\n", tmp);
|
||||
(void) sprintf(pid_str, "%10ld\n", (long)getpid());
|
||||
(void) write(lfd, pid_str, 11);
|
||||
#ifndef USE_CHMOD
|
||||
(void) fchmod(lfd, 0444);
|
||||
#else
|
||||
(void) chmod(tmp, 0444);
|
||||
#endif
|
||||
(void) close(lfd);
|
||||
|
||||
/*
|
||||
|
@ -455,7 +436,6 @@ UnlockServer(void)
|
|||
(void) unlink(LockFile);
|
||||
}
|
||||
}
|
||||
#endif /* SERVER_LOCK */
|
||||
|
||||
/* Force connections to close on SIGHUP from init */
|
||||
|
||||
|
@ -467,13 +447,6 @@ AutoResetServer (int sig)
|
|||
|
||||
dispatchException |= DE_RESET;
|
||||
isItTimeToYield = TRUE;
|
||||
#ifdef GPROF
|
||||
chdir ("/tmp");
|
||||
exit (0);
|
||||
#endif
|
||||
#if defined(SYSV) && defined(X_NOT_POSIX)
|
||||
OsSignal (SIGHUP, AutoResetServer);
|
||||
#endif
|
||||
errno = olderrno;
|
||||
}
|
||||
|
||||
|
@ -487,10 +460,6 @@ GiveUp(int sig)
|
|||
|
||||
dispatchException |= DE_TERMINATE;
|
||||
isItTimeToYield = TRUE;
|
||||
#if defined(SYSV) && defined(X_NOT_POSIX)
|
||||
if (sig)
|
||||
OsSignal(sig, SIG_IGN);
|
||||
#endif
|
||||
errno = olderrno;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,11 +42,6 @@
|
|||
#include "opaque.h"
|
||||
#include "site.h"
|
||||
|
||||
#if defined(DGUX)
|
||||
#include <net/net_ioctl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef STREAMSCONN
|
||||
#include <tiuser.h>
|
||||
#include <netconfig.h>
|
||||
|
|
|
@ -62,7 +62,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#define PHYS_LEDS 0x7f
|
||||
#define LED_COMPOSE 8
|
||||
#else
|
||||
#if defined(ultrix) || defined(__osf__) || defined(__alpha) || defined(__alpha__)
|
||||
#if defined(__osf__) || defined(__alpha) || defined(__alpha__)
|
||||
#define LED_COMPOSE 2
|
||||
#define LED_CAPS 3
|
||||
#define LED_SCROLL 4
|
||||
|
|
Loading…
Reference in New Issue