summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/Makefile.am5
-rw-r--r--hw/xfree86/common/compiler.h13
-rw-r--r--hw/xfree86/common/xf86.h34
-rw-r--r--hw/xfree86/common/xf86Bus.c340
-rw-r--r--hw/xfree86/common/xf86Bus.h2
-rw-r--r--hw/xfree86/common/xf86Configure.c68
-rw-r--r--hw/xfree86/common/xf86DoProbe.c116
-rw-r--r--hw/xfree86/common/xf86Helper.c219
-rw-r--r--hw/xfree86/common/xf86Init.c73
-rw-r--r--hw/xfree86/common/xf86Priv.h5
-rw-r--r--hw/xfree86/common/xf86isaBus.c141
-rw-r--r--hw/xfree86/common/xf86pciBus.c5
-rw-r--r--hw/xfree86/common/xf86pciBus.h1
-rw-r--r--hw/xfree86/common/xf86str.h17
14 files changed, 122 insertions, 917 deletions
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 06d53c14b..77ab4c386 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -14,7 +14,7 @@ XISOURCES = xf86Xinput.c xisb.c
XISDKINCS = xf86Xinput.h xisb.h
RANDRSOURCES = xf86RandR.c
-BUSSOURCES = xf86isaBus.c xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
+BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
@@ -27,8 +27,7 @@ BUILT_SOURCES = xf86DefModeSet.c
AM_LDFLAGS = -r
libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
xf86Cursor.c xf86DGA.c xf86DPMS.c \
- xf86DoProbe.c xf86Events.c \
- xf86Globals.c xf86AutoConfig.c \
+ xf86Events.c xf86Globals.c xf86AutoConfig.c \
xf86Option.c \
xf86VidMode.c xf86fbman.c xf86cmap.c \
xf86Helper.c xf86PM.c xf86RAC.c xf86Xinput.c xisb.c \
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index f55219b9b..285d9a3f6 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -1541,8 +1541,6 @@ extern void (*xf86WriteMmio32)(int, void *, unsigned long);
extern void (*xf86WriteMmioNB8)(int, void *, unsigned long);
extern void (*xf86WriteMmioNB16)(int, void *, unsigned long);
extern void (*xf86WriteMmioNB32)(int, void *, unsigned long);
-extern void xf86JensenMemToBus(char *, long, long, int);
-extern void xf86JensenBusToMem(char *, char *, unsigned long, int);
extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
@@ -1556,20 +1554,13 @@ extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
# define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset)
# endif
-# if defined (JENSEN_SUPPORT)
-# define MMIO_OUT32(base, offset, val) \
- (*xf86WriteMmio32)((CARD32)(val), base, offset)
-# define MMIO_ONB32(base, offset, val) \
- (*xf86WriteMmioNB32)((CARD32)(val), base, offset)
-# else
-# define MMIO_OUT32(base, offset, val) \
+# define MMIO_OUT32(base, offset, val) \
do { \
write_mem_barrier(); \
*(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \
} while (0)
-# define MMIO_ONB32(base, offset, val) \
+# define MMIO_ONB32(base, offset, val) \
*(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
-# endif
# define MMIO_OUT8(base, offset, val) \
(*xf86WriteMmio8)((CARD8)(val), base, offset)
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 4432c551b..a32aa9bcc 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -66,7 +66,6 @@ extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
extern const unsigned char byte_reversed[256];
extern ScrnInfoPtr xf86CurrentScreen;
extern Bool pciSlotClaimed;
-extern Bool isaSlotClaimed;
extern Bool fbSlotClaimed;
#if defined(__sparc__) || defined(__sparc)
extern Bool sbusSlotClaimed;
@@ -103,16 +102,12 @@ Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
void xf86FormatPciBusNumber(int busnum, char *buffer);
resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
-int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
-int xf86GetIsaInfoForScreen(int scrnIndex);
int xf86GetFbInfoForScreen(int scrnIndex);
-Bool xf86ParseIsaBusString(const char *busID);
int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
void xf86EnableAccess(ScrnInfoPtr pScrn);
void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn);
Bool xf86IsPrimaryPci(struct pci_device * pPci);
-Bool xf86IsPrimaryIsa(void);
/* new RAC */
resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
void xf86FreeResList(resPtr rlist);
@@ -159,8 +154,6 @@ DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
/* xf86Configure.c */
GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
void *busData, int chipset);
-GDevPtr xf86AddDeviceToConfigure( const char *driver,
- struct pci_device * pVideo, int chipset );
/* xf86Cursor.c */
@@ -243,10 +236,6 @@ int xf86MatchPciInstances(const char *driverName, int vendorID,
SymTabPtr chipsets, PciChipsets *PCIchipsets,
GDevPtr *devList, int numDevs, DriverPtr drvp,
int **foundEntities);
-int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
- IsaChipsets *ISAchipsets, DriverPtr drvp,
- FindIsaDevProc FindIsaDevice, GDevPtr *devList,
- int numDevs, int **foundEntities);
void xf86GetClocks(ScrnInfoPtr pScrn, int num,
Bool (*ClockFunc)(ScrnInfoPtr, int),
void (*ProtectRegs)(ScrnInfoPtr, Bool),
@@ -297,11 +286,6 @@ ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
resList res, EntityProc init,
EntityProc enter, EntityProc leave,
pointer private);
-ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag,
- int entityIndex, IsaChipsets *i_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
int entityIndex, EntityProc init,
EntityProc enter, EntityProc leave,
@@ -313,19 +297,10 @@ Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
EntityProc enter, EntityProc leave,
pointer private);
/* Obsolete! don't use */
-Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn,
- int entityIndex, IsaChipsets *i_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
resList res, EntityProc init,
EntityProc enter, EntityProc leave,
pointer private);
-void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
EntityProc enter, EntityProc leave,
pointer private);
@@ -369,13 +344,14 @@ void xf86PruneDriverModes(ScrnInfoPtr scrp);
void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
void xf86PrintModes(ScrnInfoPtr scrp);
void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
-double xf86ModeHSync(DisplayModePtr mode);
-double xf86ModeVRefresh(DisplayModePtr mode);
+double xf86ModeHSync(const DisplayModeRec *mode);
+double xf86ModeVRefresh(const DisplayModeRec *mode);
void xf86SetModeDefaultName(DisplayModePtr mode);
void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
-DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode);
+DisplayModePtr xf86DuplicateMode(const DisplayModeRec *pMode);
DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
-Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2);
+Bool xf86ModesEqual(const DisplayModeRec *pMode1,
+ const DisplayModeRec *pMode2);
void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 758560d14..3236b5a4f 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -25,7 +25,6 @@
* authorization from the copyright holder(s) and author(s).
*/
-#define REDUCER
/*
* This file contains the interfaces to the bus-specific code
*/
@@ -71,10 +70,6 @@ BusRec primaryBus = { BUS_NONE, {{0}}};
static Bool xf86ResAccessEnter = FALSE;
-#ifdef REDUCER
-/* Resources that temporarily conflict with estimated resources */
-static resPtr AccReducers = NULL;
-#endif
/* resource lists */
resPtr Acc = NULL;
@@ -99,10 +94,6 @@ static Bool doFramebufferMode = FALSE;
static StateChangeNotificationPtr StateChangeNotificationList;
static void notifyStateChange(xf86NotifyState state);
-#undef MIN
-#define MIN(x,y) ((x<y)?x:y)
-
-
/*
* Call the bus probes relevant to the architecture.
*
@@ -144,8 +135,6 @@ StringToBusType(const char* busID, const char **retID)
}
if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp"))
ret = BUS_PCI;
- if (!xf86NameCmp(p, "isa"))
- ret = BUS_ISA;
if (!xf86NameCmp(p, "sbus"))
ret = BUS_SBUS;
if (ret != BUS_NONE)
@@ -163,8 +152,6 @@ void
xf86EntityInit(void)
{
int i;
- resPtr *pprev_next;
- resPtr res;
xf86AccessPtr pacc;
for (i = 0; i < xf86NumEntities; i++)
@@ -176,17 +163,6 @@ xf86EntityInit(void)
pacc->AccessEnable(pacc->arg);
xf86Entities[i]->entityInit(i,xf86Entities[i]->private);
pacc->AccessDisable(pacc->arg);
- /* remove init resources after init is processed */
- pprev_next = &Acc;
- res = Acc;
- while (res) {
- if (res->res_type & ResInit && (res->entityIndex == i)) {
- (*pprev_next) = res->next;
- xfree(res);
- } else
- pprev_next = &(res->next);
- res = (*pprev_next);
- }
}
}
@@ -248,8 +224,6 @@ xf86IsEntityPrimary(int entityIndex)
switch (pEnt->busType) {
case BUS_PCI:
return (pEnt->bus.id.pci == primaryBus.id.pci);
- case BUS_ISA:
- return TRUE;
case BUS_SBUS:
return (pEnt->sbusBusId.fbNum == primaryBus.id.sbus.fbNum);
default:
@@ -1000,10 +974,6 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state)
BusType loc = BUS_NONE;
BusType r_loc = BUS_NONE;
- /* Ignore overlapped ranges that have been nullified */
- if ((pRes->res_type & ResOverlap) && (pRes->block_begin > pRes->block_end))
- return FALSE;
-
if ((pRes->res_type & ResTypeMask) != (type & ResTypeMask))
return FALSE;
@@ -1014,10 +984,6 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state)
if (pRes->res_type & type & ResBios)
return FALSE;
- /*If requested, skip over estimated resources */
- if (pRes->res_type & type & ResEstimated)
- return FALSE;
-
if (type & pRes->res_type & ResUnused)
return FALSE;
@@ -1039,33 +1005,10 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state)
if (pRes->entityIndex > -1)
r_loc = xf86Entities[pRes->entityIndex]->busType;
- switch (type & ResAccMask) {
- case ResExclusive:
- switch (pRes->res_type & ResAccMask) {
- case ResExclusive:
- break;
- case ResShared:
- /* ISA buses are only locally exclusive on a PCI system */
- if (loc == BUS_ISA && r_loc == BUS_PCI)
- return FALSE;
- break;
- }
- break;
- case ResShared:
- switch (pRes->res_type & ResAccMask) {
- case ResExclusive:
- /* ISA buses are only locally exclusive on a PCI system */
- if (loc == BUS_PCI && r_loc == BUS_ISA)
- return FALSE;
- break;
- case ResShared:
- return FALSE;
- }
- break;
- case ResAny:
- break;
- }
-
+ if ((type & ResAccMask == ResShared) &&
+ (pRes->res_type & ResAccMask) == ResShared)
+ return FALSE;
+
if (pRes->entityIndex == entityIndex) return FALSE;
if (pRes->entityIndex > -1 &&
@@ -1289,10 +1232,6 @@ xf86PrintResList(int verb, resPtr list)
s = "[?]";
}
xf86ErrorFVerb(verb, "%s", s);
- if (list->res_type & ResEstimated)
- xf86ErrorFVerb(verb, "E");
- if (list->res_type & ResOverlap)
- xf86ErrorFVerb(verb, "O");
if (list->res_type & ResInit)
xf86ErrorFVerb(verb, "t");
if (list->res_type & ResBios)
@@ -1346,117 +1285,10 @@ xf86ResourceBrokerInit(void)
xf86PrintResList(3, Acc);
}
-#define MEM_ALIGN (1024 * 1024)
-
-/*
- * RemoveOverlaps() -- remove overlaps between resources of the
- * same kind.
- * Beware: This function doesn't check for access attributes.
- * At resource broker initialization this is no problem as this
- * only deals with exclusive resources.
- */
-
-void
-RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated)
-{
- resPtr pRes;
- memType size, newsize, adjust;
-
- if (!target)
- return;
-
- if (!(target->res_type & ResEstimated) /* Don't touch sure resources */
- && !(target->res_type & ResOverlap)) /* Unless they may overlap */
- return;
-
- for (pRes = list; pRes; pRes = pRes->next) {
- if (pRes == target
- || ((pRes->res_type & ResTypeMask) !=
- (target->res_type & ResTypeMask))
- || pRes->block_begin > target->block_end
- || pRes->block_end < target->block_begin)
- continue;
-
- if (pRes->block_begin <= target->block_begin) {
- /* Possibly ignore estimated resources */
- if (!useEstimated && (pRes->res_type & ResEstimated))
- continue;
-
- /* Special cases */
- if (pRes->block_end >= target->block_end) {
- /*
- * If pRes fully contains target, don't do anything
- * unless target can overlap.
- */
- if (target->res_type & ResOverlap) {
- /* Nullify range but keep its ResOverlap bit on */
- target->block_end = target->block_begin - 1;
- return;
- } else
- continue;
- } else {
-#if 0 /* Don't trim start address - we trust what we got */
- /*
- * If !pow2Alignment trim start address: !pow2Alingment
- * is only set when estimated OS addresses are handled.
- * In cases where the target and pRes have the same
- * starting address, reduce the size of the target
- * (given it's an estimate).
- */
- if (!pow2Alignment)
- target->block_begin = pRes->block_end + 1;
- else
-#endif
- if (pRes->block_begin == target->block_begin)
- target->block_end = pRes->block_end;
- else
- continue;
- }
- } else {
- /* Trim target to remove the overlap */
- target->block_end = pRes->block_begin - 1;
- }
- if (pow2Alignment) {
- /*
- * Align to a power of two. This requires finding the
- * largest power of two that is smaller than the adjusted
- * size.
- */
- size = target->block_end - target->block_begin + 1;
- newsize = 1UL << (sizeof(memType) * 8 - 1);
- while (!(newsize & size))
- newsize >>= 1;
- target->block_end = target->block_begin + newsize - 1;
- } else if (target->block_end > MEM_ALIGN) {
- /* Align the end to MEM_ALIGN */
- if ((adjust = (target->block_end + 1) % MEM_ALIGN))
- target->block_end -= adjust;
- }
- }
-}
-
/*
* Resource registration
*/
-static resList
-xf86GetResourcesImplicitly(int entityIndex)
-{
- if (entityIndex >= xf86NumEntities) return NULL;
-
- switch (xf86Entities[entityIndex]->bus.type) {
- case BUS_ISA:
- case BUS_NONE:
- case BUS_SBUS:
- return NULL;
- case BUS_PCI:
- return NULL;
- case BUS_last:
- return NULL;
- }
- return NULL;
-}
-
static void
convertRange2Host(int entityIndex, resRange *pRange)
{
@@ -1465,9 +1297,6 @@ convertRange2Host(int entityIndex, resRange *pRange)
case BUS_PCI:
pciConvertRange2Host(entityIndex,pRange);
break;
- case BUS_ISA:
- isaConvertRange2Host(pRange);
- break;
default:
break;
}
@@ -1487,24 +1316,19 @@ xf86ConvertListToHost(int entityIndex, resPtr list)
/*
* xf86RegisterResources() -- attempts to register listed resources.
- * If list is NULL it tries to obtain resources implicitly. Function
- * returns a resPtr listing all resources not successfully registered.
+ * Returns a resPtr listing all resources not successfully registered, by
+ * which we mean, NULL.
*/
_X_EXPORT resPtr
xf86RegisterResources(int entityIndex, resList list, unsigned long access)
{
- resPtr res = NULL;
resRange range;
resList list_f = NULL;
- if (!list) {
- list = xf86GetResourcesImplicitly(entityIndex);
- /* these resources have to be in host address space already */
- if (!list) return NULL;
- list_f = list;
- }
-
+ if (!list)
+ return NULL;
+
while(list->type != ResEnd) {
range = *list;
@@ -1514,15 +1338,7 @@ xf86RegisterResources(int entityIndex, resList list, unsigned long access)
range.type = (range.type & ~ResAccMask) | (access & ResAccMask);
}
range.type &= ~ResEstimated; /* Not allowed for drivers */
-#if !((defined(__alpha__) || (defined(__ia64__))) && defined(linux))
- /* On Alpha Linux, do not check for conflicts, trust the kernel. */
- if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE))
- res = xf86AddResToList(res,&range,entityIndex);
- else
-#endif
- {
- Acc = xf86AddResToList(Acc,&range,entityIndex);
- }
+ Acc = xf86AddResToList(Acc,&range,entityIndex);
list++;
}
if (list_f)
@@ -1532,11 +1348,7 @@ xf86RegisterResources(int entityIndex, resList list, unsigned long access)
xf86MsgVerb(X_INFO, 3,"Resources after driver initialization\n");
xf86PrintResList(3, Acc);
#endif
- if (res) {
- xf86MsgVerb(X_INFO, 3, "Failed to register resources:\n");
- xf86PrintResList(3, res);
- }
- return res;
+ return NULL;
}
@@ -1545,7 +1357,6 @@ busTypeSpecific(EntityPtr pEnt, xf86AccessPtr *acc_mem,
xf86AccessPtr *acc_io, xf86AccessPtr *acc_mem_io)
{
switch (pEnt->bus.type) {
- case BUS_ISA:
case BUS_SBUS:
*acc_mem = *acc_io = *acc_mem_io = &AccessNULL;
break;
@@ -1871,44 +1682,6 @@ xf86SetOperatingState(resList list, int entityIndex, int mask)
/*
* Stage specific code
*/
- /*
- * ProcessEstimatedConflicts() -- Do something about driver-registered
- * resources that conflict with estimated resources. For now, just register
- * them with a logged warning.
- */
-#ifdef REDUCER
-static void
-ProcessEstimatedConflicts(void)
-{
- if (!AccReducers)
- return;
-
- /* Temporary */
- xf86MsgVerb(X_WARNING, 3,
- "Registering the following despite conflicts with estimated"
- " resources:\n");
- xf86PrintResList(3, AccReducers);
- Acc = xf86JoinResLists(Acc, AccReducers);
- AccReducers = NULL;
-}
-#endif
-
-/*
- * xf86ClaimFixedResources() -- This function gets called from the
- * driver Probe() function to claim fixed resources.
- */
-static void
-resError(resList list)
-{
- FatalError("A driver tried to allocate the %s %sresource at \n"
- "0x%lx:0x%lx which conflicted with another resource. Send the\n"
- "output of the server to %s. Please \n"
- "specify your computer hardware as closely as possible.\n",
- ResIsBlock(list)?"Block":"Sparse",
- ResIsMem(list)?"Mem":"Io",
- ResIsBlock(list)?list->rBegin:list->rBase,
- ResIsBlock(list)?list->rEnd:list->rMask,BUILDERADDR);
-}
/*
* xf86ClaimFixedResources() is used to allocate non-relocatable resources.
@@ -1932,20 +1705,7 @@ xf86ClaimFixedResources(resList list, int entityIndex)
case ResExclusive:
if (!xf86ChkConflict(&range, entityIndex)) {
Acc = xf86AddResToList(Acc, &range, entityIndex);
-#ifdef REDUCER
- } else {
- range.type |= ResEstimated;
- if (!xf86ChkConflict(&range, entityIndex) &&
- !checkConflict(&range, AccReducers, entityIndex,
- SETUP, FALSE)) {
- range.type &= ~(ResEstimated | ResBios);
- AccReducers =
- xf86AddResToList(AccReducers, &range, entityIndex);
-#endif
- } else resError(&range); /* no return */
-#ifdef REDUCER
- }
-#endif
+ } else FatalError("xf86ClaimFixedResources conflict\n");
break;
case ResShared:
/* at this stage the resources are just added to the
@@ -1967,9 +1727,6 @@ xf86ClaimFixedResources(resList list, int entityIndex)
xf86MsgVerb(X_INFO, 3,
"resource ranges after xf86ClaimFixedResources() call:\n");
xf86PrintResList(3,Acc);
-#ifdef REDUCER
- ProcessEstimatedConflicts();
-#endif
#ifdef DEBUG
if (ptr) {
xf86MsgVerb(X_INFO, 3, "to be registered later:\n");
@@ -2065,10 +1822,10 @@ xf86PostProbe(void)
{
memType val;
int i,j;
- resPtr resp, acc, tmp, resp_x, *pprev_next;
+ resPtr resp, acc, tmp, resp_x;
if (fbSlotClaimed) {
- if (pciSlotClaimed || isaSlotClaimed
+ if (pciSlotClaimed
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|| sbusSlotClaimed
#endif
@@ -2085,17 +1842,7 @@ xf86PostProbe(void)
return;
}
}
- /* don't compare against ResInit - remove it from clone.*/
acc = tmp = xf86DupResList(Acc);
- pprev_next = &acc;
- while (tmp) {
- if (tmp->res_type & ResInit) {
- (*pprev_next) = tmp->next;
- xfree(tmp);
- } else
- pprev_next = &(tmp->next);
- tmp = (*pprev_next);
- }
for (i=0; i<xf86NumEntities; i++) {
resp = xf86Entities[i]->resources;
@@ -2108,16 +1855,6 @@ xf86PostProbe(void)
resp_x = resp;
resp = resp->next;
resp_x->next = tmp;
-#ifdef REDUCER
- } else {
- resp->res_type |= ResEstimated;
- if (!checkConflict(&resp->val, acc, i, SETUP, FALSE)) {
- resp->res_type &= ~(ResEstimated | ResBios);
- tmp = AccReducers;
- AccReducers = resp;
- resp = resp->next;
- AccReducers->next = tmp;
-#endif
} else {
xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n",val);
resp->res_type &= ~ResEstimated;
@@ -2126,14 +1863,8 @@ xf86PostProbe(void)
resp = resp->next;
xf86Entities[i]->resources->next = tmp;
}
-#ifdef REDUCER
- }
-#endif
}
xf86JoinResLists(Acc,resp_x);
-#ifdef REDUCER
- ProcessEstimatedConflicts();
-#endif
}
xf86FreeResList(acc);
@@ -2630,9 +2361,6 @@ xf86ExtractTypeFromList(resPtr list, unsigned long type)
return ret;
}
-/*------------------------------------------------------------*/
-static void CheckGenericGA(void);
-
/*
* xf86FindPrimaryDevice() - Find the display device which
* was active when the server was started.
@@ -2640,9 +2368,6 @@ static void CheckGenericGA(void);
void
xf86FindPrimaryDevice()
{
- /* if no VGA device is found check for primary PCI device */
- if (primaryBus.type == BUS_NONE && xorgHWAccess)
- CheckGenericGA();
if (primaryBus.type != BUS_NONE) {
char *bus;
char loc[16];
@@ -2656,10 +2381,6 @@ xf86FindPrimaryDevice()
primaryBus.id.pci->dev,
primaryBus.id.pci->func);
break;
- case BUS_ISA:
- bus = "ISA";
- loc[0] = '\0';
- break;
case BUS_SBUS:
bus = "SBUS";
snprintf(loc, sizeof(loc), " %2.2x", primaryBus.id.sbus.fbNum);
@@ -2673,39 +2394,6 @@ xf86FindPrimaryDevice()
}
}
-#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__) && !defined(__m32r__)
-#include "vgaHW.h"
-#include "compiler.h"
-#endif
-
-/*
- * CheckGenericGA() - Check for presence of a VGA device.
- */
-static void
-CheckGenericGA()
-{
-/* This needs to be changed for multiple domains */
-#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__)
- IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
- CARD8 CurrentValue, TestValue;
-
- /* VGA CRTC registers are not used here, so don't bother unlocking them */
-
- /* VGA has one more read/write attribute register than EGA */
- (void) inb(GenericIOBase + VGA_IN_STAT_1_OFFSET); /* Reset flip-flop */
- outb(VGA_ATTR_INDEX, 0x14 | 0x20);
- CurrentValue = inb(VGA_ATTR_DATA_R);
- outb(VGA_ATTR_DATA_W, CurrentValue ^ 0x0F);
- outb(VGA_ATTR_INDEX, 0x14 | 0x20);
- TestValue = inb(VGA_ATTR_DATA_R);
- outb(VGA_ATTR_DATA_W, CurrentValue);
-
- if ((CurrentValue ^ 0x0F) == TestValue) {
- primaryBus.type = BUS_ISA;
- }
-#endif
-}
-
Bool
xf86NoSharedResources(int screenIndex,resType res)
{
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index c5f5dcce7..c2d5bb7d4 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -140,7 +140,5 @@ BusType StringToBusType(const char* busID, const char **retID);
Bool xf86IsSubsetOf(resRange range, resPtr list);
resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
resPtr xf86FindIntersect(resRange Range, resPtr list);
-void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
- Bool useEstimated);
#endif /* _XF86_BUS_H */
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 6680a618e..87004966a 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -115,18 +115,6 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
return NULL;
isPrimary = xf86IsPrimaryPci(pVideo);
break;
- case BUS_ISA:
- /*
- * This needs to be revisited as it doesn't allow for non-PCI
- * multihead.
- */
- if (!xf86IsPrimaryIsa())
- return NULL;
- isPrimary = TRUE;
- for (i = 0; i < nDevToConfig; i++)
- if (!DevToConfig[i].pVideo)
- return NULL;
- break;
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
case BUS_SBUS:
for (i = 0; i < nDevToConfig; i++)
@@ -202,10 +190,6 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
}
break;
- case BUS_ISA:
- NewDevice.GDev.identifier = "ISA Adapter";
- NewDevice.GDev.busID = "ISA";
- break;
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
case BUS_SBUS: {
char *promPath = NULL;
@@ -241,17 +225,6 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
# undef NewDevice
}
-/*
- * Backwards compatibility
- */
-_X_EXPORT GDevPtr
-xf86AddDeviceToConfigure(const char *driver, struct pci_device * pVideo,
- int chipset)
-{
- return xf86AddBusDeviceToConfigure(driver, pVideo ? BUS_PCI : BUS_ISA,
- pVideo, chipset);
-}
-
static XF86ConfInputPtr
configureInputSection (void)
{
@@ -662,12 +635,17 @@ configureDDCMonitorSection (int screennum)
return ptr;
}
+#if !defined(PATH_MAX)
+# define PATH_MAX 1024
+#endif
+
void
-DoConfigure()
+DoConfigure(void)
{
int i,j, screennum = -1;
char *home = NULL;
- char *filename = NULL;
+ char filename[PATH_MAX];
+ char *addslash = "";
XF86ConfigPtr xf86config = NULL;
char **vlist, **vl;
int *dev2screen;
@@ -765,29 +743,21 @@ DoConfigure()
xf86config->conf_input_lst = configureInputSection();
xf86config->conf_layout_lst = configureLayoutSection();
- if (!(home = getenv("HOME")))
+ home = getenv("HOME");
+ if ((home == NULL) || (home[0] == '\0')) {
home = "/";
- {
-#if !defined(PATH_MAX)
-#define PATH_MAX 1024
-#endif
- const char* configfile = XF86CONFIGFILE".new";
- char homebuf[PATH_MAX];
- /* getenv might return R/O memory, as with OS/2 */
- strncpy(homebuf,home,PATH_MAX-1);
- homebuf[PATH_MAX-1] = '\0';
- home = homebuf;
- if (!(filename =
- (char *)xalloc(strlen(home) +
- strlen(configfile) + 3)))
- goto bail;
-
- if (home[0] == '/' && home[1] == '\0')
- home[0] = '\0';
- sprintf(filename, "%s/%s", home,configfile);
-
+ } else {
+ /* Determine if trailing slash is present or needed */
+ int l = strlen(home);
+
+ if (home[l-1] != '/') {
+ addslash = "/";
+ }
}
+ snprintf(filename, sizeof(filename), "%s%s" XF86CONFIGFILE ".new",
+ home, addslash);
+
xf86writeConfigFile(filename, xf86config);
xf86DoConfigurePass1 = FALSE;
diff --git a/hw/xfree86/common/xf86DoProbe.c b/hw/xfree86/common/xf86DoProbe.c
deleted file mode 100644
index bba6ab7e8..000000000
--- a/hw/xfree86/common/xf86DoProbe.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 1999-2002 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).
- */
-
-/*
- * finish setting up the server
- * Load the driver modules and call their probe functions.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <X11/X.h>
-#include <X11/Xmd.h>
-#include "os.h"
-#include "loaderProcs.h"
-#include "xf86Config.h"
-#include "xf86_OSlib.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-void
-DoProbe()
-{
- int i;
- Bool probeResult;
- Bool ioEnableFailed = FALSE;
-
- /* Find the list of video driver modules. */
- char **list = xf86DriverlistFromCompile();
- char **l;
-
- if (list) {
- ErrorF("List of video driver modules:\n");
- for (l = list; *l; l++)
- ErrorF("\t%s\n", *l);
- } else {
- ErrorF("No video driver modules found\n");
- }
-
- /* Load all the drivers that were found. */
- xf86LoadModules(list, NULL);
-
- /* Disable PCI devices */
- xf86AccessInit();
-
- /* Call all of the probe functions, reporting the results. */
- for (i = 0; i < xf86NumDrivers; i++) {
- DriverRec * const drv = xf86DriverList[i];
-
- if (!xorgHWAccess) {
- xorgHWFlags flags;
- if (!drv->driverFunc
- || !drv->driverFunc( NULL, GET_REQUIRED_HW_INTERFACES, &flags )
- || NEED_IO_ENABLED(flags)) {
- if (ioEnableFailed)
- continue;
- if (!xf86EnableIO()) {
- ioEnableFailed = TRUE;
- continue;
- }
- xorgHWAccess = TRUE;
- }
- }
-
-
- xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n", drv->driverName);
-
- probeResult = xf86CallDriverProbe( drv, TRUE );
- if (!probeResult) {
- xf86ErrorF("Probe in driver `%s' returns FALSE\n",
- drv->driverName);
- } else {
- xf86ErrorF("Probe in driver `%s' returns TRUE\n",
- drv->driverName);
-
- /* If we have a result, then call driver's Identify function */
- if (drv->Identify != NULL) {
- const int verbose = xf86SetVerbosity(1);
- (*drv->Identify)(0);
- xf86SetVerbosity(verbose);
- }
- }
- }
-
- OsCleanup(TRUE);
- AbortDDX();
- fflush(stderr);
- exit(0);
-}
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 3e2316408..00df10574 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1683,8 +1683,8 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
if (xf86CheckPciSlot(pPci)) {
GDevPtr pGDev =
- xf86AddDeviceToConfigure(drvp->driverName,
- pPci, -1);
+ xf86AddBusDeviceToConfigure(drvp->driverName,
+ BUS_PCI, pPci, -1);
if (pGDev) {
/* After configure pass 1, chipID and chipRev
* are treated as over-rides, so clobber them
@@ -1953,108 +1953,6 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
return numFound;
}
-_X_EXPORT int
-xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
- IsaChipsets *ISAchipsets, DriverPtr drvp,
- FindIsaDevProc FindIsaDevice, GDevPtr *devList,
- int numDevs, int **foundEntities)
-{
- SymTabRec *c;
- IsaChipsets *Chips;
- int i;
- int numFound = 0;
- int foundChip = -1;
- int *retEntities = NULL;
-
- *foundEntities = NULL;
-
-#if defined(__sparc__) || defined(__powerpc__)
- FindIsaDevice = NULL; /* Temporary */
-#endif
-
- if (xf86DoProbe || (xf86DoConfigure && xf86DoConfigurePass1)) {
- if (FindIsaDevice &&
- ((foundChip = (*FindIsaDevice)(NULL)) != -1)) {
- xf86AddDeviceToConfigure(drvp->driverName, NULL, foundChip);
- return 1;
- }
- return 0;
- }
-
- for (i = 0; i < numDevs; i++) {
- MessageType from = X_CONFIG;
- GDevPtr dev = NULL;
- GDevPtr devBus = NULL;
-
- if (devList[i]->busID && *devList[i]->busID) {
- if (xf86ParseIsaBusString(devList[i]->busID)) {
- if (devBus) xf86MsgVerb(X_WARNING,0,
- "%s: More than one matching Device "
- "section for ISA-Bus found: %s\n",
- driverName,devList[i]->identifier);
- else devBus = devList[i];
- }
- } else {
- if (xf86IsPrimaryIsa()) {
- if (dev) xf86MsgVerb(X_WARNING,0,
- "%s: More than one matching "
- "Device section found: %s\n",
- driverName,devList[i]->identifier);
- else dev = devList[i];
- }
- }
- if (devBus) dev = devBus;
- if (dev) {
- if (dev->chipset) {
- for (c = chipsets; c->token >= 0; c++) {
- if (xf86NameCmp(c->name, dev->chipset) == 0)
- break;
- }
- if (c->token == -1) {
- xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
- "section \"%s\" isn't valid for this driver\n",
- driverName, dev->chipset,
- dev->identifier);
- } else
- foundChip = c->token;
- } else {
- if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev);
- /* Probe it */
- from = X_PROBED;
- }
- }
-
- /* Check if the chip type is listed in the chipset table - for sanity*/
-
- if (foundChip >= 0){
- for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) {
- if (Chips->numChipset == foundChip)
- break;
- }
- if (Chips->numChipset == -1){
- foundChip = -1;
- xf86MsgVerb(X_WARNING,0,
- "%s: Driver detected unknown ISA-Bus Chipset\n",
- driverName);
- }
- }
- if (foundChip != -1) {
- numFound++;
- retEntities = xnfrealloc(retEntities,numFound * sizeof(int));
- retEntities[numFound - 1] =
- xf86ClaimIsaSlot(drvp,foundChip,dev, dev->active ? TRUE : FALSE);
- for (c = chipsets; c->token >= 0; c++) {
- if (c->token == foundChip)
- break;
- }
- xf86Msg(from, "Chipset %s found\n", c->name);
- }
- }
- *foundEntities = retEntities;
-
- return numFound;
-}
-
/*
* xf86GetClocks -- get the dot-clocks via a BIG BAD hack ...
*/
@@ -2094,14 +1992,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
cnt = 0;
sync = 200000;
- /* XXX How critical is this? */
- if (!xf86DisableInterrupts())
- {
- (*ClockFunc)(pScrn, CLK_REG_RESTORE);
- ErrorF("Failed to disable interrupts during clock probe. If\n");
- ErrorF("your OS does not support disabling interrupts, then you\n");
- FatalError("must specify a Clocks line in the XF86Config file.\n");
- }
while ((inb(status) & maskval) == 0x00)
if (sync-- == 0) goto finish;
/* Something appears to be happening, so reset sync count */
@@ -2122,8 +2012,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
}
finish:
- xf86EnableInterrupts();
-
pScrn->clock[i] = cnt ? cnt : -1;
if (BlankScreen)
(*BlankScreen)(pScrn, TRUE);
@@ -2557,49 +2445,6 @@ xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name,
#include "loader/os.c"
/* new RAC */
-/*
- * xf86ConfigIsa/PciEntity() -- These helper functions assign an
- * active entity to a screen, registers its fixed resources, assign
- * special enter/leave functions and their private scratch area to
- * this entity, take the dog for a walk...
- */
-_X_EXPORT ScrnInfoPtr
-xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
- IsaChipsets *i_chip, resList res, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- IsaChipsets *i_id;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return pScrn;
-
- if (!(pEnt->location.type == BUS_ISA)) {
- xfree(pEnt);
- return pScrn;
- }
-
- if (!pEnt->active) {
- xf86ConfigIsaEntityInactive(pEnt, i_chip, res, init, enter,
- leave, private);
- xfree(pEnt);
- return pScrn;
- }
-
- if (!pScrn)
- pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
- xf86AddEntityToScreen(pScrn,entityIndex);
-
- if (i_chip) {
- for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
- if (pEnt->chipset == i_id->numChipset) break;
- }
- xf86ClaimFixedResources(i_id->resList,entityIndex);
- }
- xfree(pEnt);
- xf86ClaimFixedResources(res,entityIndex);
- xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
-
- return pScrn;
-}
_X_EXPORT ScrnInfoPtr
xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
@@ -2675,39 +2520,9 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
/*
*
- * OBSOLETE ! xf86ConfigActiveIsaEntity() and xf86ConfigActivePciEntity()
- * are obsolete functions. They the are likely to be removed
- * Don't use!
+ * OBSOLETE ! xf86ConfigActivePciEntity() is an obsolete functions.
+ * They the are likely to be removed. Don't use!
*/
-_X_EXPORT Bool
-xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
- IsaChipsets *i_chip, resList res, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- IsaChipsets *i_id;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return FALSE;
-
- if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) {
- xfree(pEnt);
- return FALSE;
- }
-
- xf86AddEntityToScreen(pScrn,entityIndex);
-
- if (i_chip) {
- for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
- if (pEnt->chipset == i_id->numChipset) break;
- }
- xf86ClaimFixedResources(i_id->resList,entityIndex);
- }
- xfree(pEnt);
- xf86ClaimFixedResources(res,entityIndex);
- if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
- return FALSE;
-
- return TRUE;
-}
_X_EXPORT Bool
xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
@@ -2740,10 +2555,10 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
}
/*
- * xf86ConfigPci/IsaEntityInactive() -- These functions can be used
+ * xf86ConfigPciEntityInactive() -- This functions can be used
* to configure an inactive entity as well as to reconfigure an
* previously active entity inactive. If the entity has been
- * assigned to a screen before it will be removed. If p_pci(p_isa) is
+ * assigned to a screen before it will be removed. If p_pci is
* non-NULL all static resources listed there will be registered.
*/
_X_EXPORT void
@@ -2768,28 +2583,6 @@ xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
}
-_X_EXPORT void
-xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
- resList res, EntityProc init, EntityProc enter,
- EntityProc leave, pointer private)
-{
- IsaChipsets *i_id;
- ScrnInfoPtr pScrn;
-
- if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
- xf86RemoveEntityFromScreen(pScrn,pEnt->index);
- else if (i_chip) {
- for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
- if (pEnt->chipset == i_id->numChipset) break;
- }
- xf86ClaimFixedResources(i_id->resList,pEnt->index);
- }
- xf86ClaimFixedResources(res,pEnt->index);
- /* shared resources are only needed when entity is active: remove */
- xf86DeallocateResourcesForEntity(pEnt->index, ResShared);
- xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
-}
-
void
xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
EntityProc enter, EntityProc leave, pointer private)
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index c35cb2c38..922e7b35d 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -548,8 +548,8 @@ add_matching_devices_to_configure_list(DriverPtr drvp)
&& ((devices[j].device_class_mask & pPci->device_class)
== devices[j].device_class) ) {
if (xf86CheckPciSlot(pPci)) {
- GDevPtr pGDev =
- xf86AddDeviceToConfigure(drvp->driverName, pPci, -1);
+ GDevPtr pGDev = xf86AddBusDeviceToConfigure(
+ drvp->driverName, BUS_PCI, pPci, -1);
if (pGDev != NULL) {
/* After configure pass 1, chipID and chipRev are
* treated as over-rides, so clobber them here.
@@ -643,6 +643,75 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
return foundScreen;
}
+static void
+DoProbe(void)
+{
+ int i;
+ Bool probeResult;
+ Bool ioEnableFailed = FALSE;
+
+ /* Find the list of video driver modules. */
+ char **list = xf86DriverlistFromCompile();
+ char **l;
+
+ if (list) {
+ ErrorF("List of video driver modules:\n");
+ for (l = list; *l; l++)
+ ErrorF("\t%s\n", *l);
+ } else {
+ ErrorF("No video driver modules found\n");
+ }
+
+ /* Load all the drivers that were found. */
+ xf86LoadModules(list, NULL);
+
+ /* Disable PCI devices */
+ xf86AccessInit();
+
+ /* Call all of the probe functions, reporting the results. */
+ for (i = 0; i < xf86NumDrivers; i++) {
+ DriverRec * const drv = xf86DriverList[i];
+
+ if (!xorgHWAccess) {
+ xorgHWFlags flags;
+ if (!drv->driverFunc
+ || !drv->driverFunc( NULL, GET_REQUIRED_HW_INTERFACES, &flags )
+ || NEED_IO_ENABLED(flags)) {
+ if (ioEnableFailed)
+ continue;
+ if (!xf86EnableIO()) {
+ ioEnableFailed = TRUE;
+ continue;
+ }
+ xorgHWAccess = TRUE;
+ }
+ }
+
+
+ xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n", drv->driverName);
+
+ probeResult = xf86CallDriverProbe( drv, TRUE );
+ if (!probeResult) {
+ xf86ErrorF("Probe in driver `%s' returns FALSE\n",
+ drv->driverName);
+ } else {
+ xf86ErrorF("Probe in driver `%s' returns TRUE\n",
+ drv->driverName);
+
+ /* If we have a result, then call driver's Identify function */
+ if (drv->Identify != NULL) {
+ const int verbose = xf86SetVerbosity(1);
+ (*drv->Identify)(0);
+ xf86SetVerbosity(verbose);
+ }
+ }
+ }
+
+ OsCleanup(TRUE);
+ AbortDDX();
+ fflush(stderr);
+ exit(0);
+}
/*
* InitOutput --
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index f3dfd70d8..5de48ac77 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -150,9 +150,10 @@ Bool xf86PathIsSafe(const char *path);
extern const DisplayModeRec xf86DefaultModes[];
extern const int xf86NumDefaultModes;
-/* xf86DoProbe.c */
-void DoProbe(void);
+/* xf86Configure.c */
void DoConfigure(void);
+
+/* xf86ShowOpts.c */
void DoShowOptions(void);
/* xf86Events.c */
diff --git a/hw/xfree86/common/xf86isaBus.c b/hw/xfree86/common/xf86isaBus.c
deleted file mode 100644
index 3abad38ef..000000000
--- a/hw/xfree86/common/xf86isaBus.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 1997-2000 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).
- */
-
-
-/*
- * This file contains the interfaces to the bus-specific code
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <X11/X.h>
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Resources.h"
-
-#include "xf86Bus.h"
-
-#define XF86_OS_PRIVS
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSproc.h"
-
-#include "xf86RAC.h"
-
-Bool isaSlotClaimed = FALSE;
-
-/*
- * If the slot requested is already in use, return FALSE.
- * Otherwise, claim the slot for the screen requesting it.
- */
-
-_X_EXPORT int
-xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
-{
- EntityPtr p;
- BusAccPtr pbap = xf86BusAccInfo;
- int num;
-
- num = xf86AllocateEntity();
- p = xf86Entities[num];
- p->driver = drvp;
- p->chipset = chipset;
- p->busType = BUS_ISA;
- p->active = active;
- p->inUse = FALSE;
- xf86AddDevToEntity(num, dev);
- p->access = xnfcalloc(1,sizeof(EntityAccessRec));
- p->access->fallback = &AccessNULL;
- p->access->pAccess = &AccessNULL;
- p->busAcc = NULL;
- while (pbap) {
- if (pbap->type == BUS_ISA)
- p->busAcc = pbap;
- pbap = pbap->next;
- }
- isaSlotClaimed = TRUE;
- return num;
-}
-
-/*
- * Get the list of ISA "slots" claimed by a screen
- *
- * Note: The ISA implementation here assumes that only one ISA "slot" type
- * can be claimed by any one screen. That means a return value other than
- * 0 or 1 isn't useful.
- */
-int
-xf86GetIsaInfoForScreen(int scrnIndex)
-{
- int num = 0;
- int i;
- EntityPtr p;
-
- for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) {
- p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]];
- if (p->busType == BUS_ISA) {
- num++;
- }
- }
- return num;
-}
-
-/*
- * Parse a BUS ID string, and return True if it is a ISA bus id.
- */
-
-_X_EXPORT Bool
-xf86ParseIsaBusString(const char *busID)
-{
- /*
- * The format assumed to be "isa" or "isa:"
- */
- return (StringToBusType(busID,NULL) == BUS_ISA);
-}
-
-
-/*
- * xf86IsPrimaryIsa() -- return TRUE if primary device
- * is ISA.
- */
-
-_X_EXPORT Bool
-xf86IsPrimaryIsa(void)
-{
- return ( primaryBus.type == BUS_ISA );
-}
-
-void
-isaConvertRange2Host(resRange *pRange)
-{
- return;
-}
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index d5ae75b3a..b6ec4adbb 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -564,11 +564,6 @@ initPciBusState(void)
pbap->disable_f = pciBusAccessDisable;
savePciBusState(pbap);
break;
- case PCI_SUBCLASS_BRIDGE_ISA:
- case PCI_SUBCLASS_BRIDGE_EISA:
- case PCI_SUBCLASS_BRIDGE_MC:
- pbap->type = BUS_ISA;
- break;
}
pbap->next = xf86BusAccInfo;
xf86BusAccInfo = pbap;
diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h
index 7d08502fc..1cbfa38ea 100644
--- a/hw/xfree86/common/xf86pciBus.h
+++ b/hw/xfree86/common/xf86pciBus.h
@@ -70,6 +70,5 @@ void PciBusStateEnter(void);
void PciStateLeave(void);
void PciBusStateLeave(void);
void pciConvertRange2Host(int entityIndex, resRange *pRange);
-void isaConvertRange2Host(resRange *pRange);
#endif /* _XF86_PCI_BUS_H */
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 8c211234b..904c369a6 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -383,17 +383,12 @@ typedef enum {
struct pci_device;
typedef struct {
- unsigned int dummy;
-} IsaBusId;
-
-typedef struct {
int fbNum;
} SbusBusId;
typedef struct _bus {
BusType type;
union {
- IsaBusId isa;
struct pci_device *pci;
SbusBusId sbus;
} id;
@@ -436,8 +431,6 @@ typedef struct {
int screen; /* For multi-CRTC cards */
} GDevRec, *GDevPtr;
-typedef int (*FindIsaDevProc)(GDevPtr dev);
-
typedef struct {
char * identifier;
char * driver;
@@ -623,9 +616,6 @@ typedef struct _CurrAccRec {
#define ResMem 0x0001
#define ResIo 0x0002
-#define ResIrq 0x0003
-#define ResDma 0x0004
-#define ResPciCfg 0x000e /* PCI Configuration space */
#define ResPhysMask 0x000F
#define ResExclusive 0x0010
@@ -648,7 +638,6 @@ typedef struct _CurrAccRec {
#define ResMiscMask 0x00F000
#define ResBus 0x010000
-#define ResOverlap 0x020000
#if defined(__alpha__) && defined(linux)
# define ResDomain 0x1ff000000ul
@@ -687,7 +676,6 @@ typedef struct _CurrAccRec {
#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock)
#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse)
#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated)
-#define ResCanOverlap(r) (ResIsEstimated(r) || ((r)->type & ResOverlap))
typedef struct {
unsigned long type; /* shared, exclusive, unused etc. */
@@ -722,11 +710,6 @@ typedef struct _resRec {
#define block_end val.rEnd
#define res_type val.type
-typedef struct {
- int numChipset;
- resRange *resList;
-} IsaChipsets;
-
typedef struct _PciChipsets {
/**
* Key used to match this device with its name in an array of