Make -configure work for SBus/UPA devices instead of crashing.

ok matthieu@
This commit is contained in:
kettenis 2008-08-24 21:02:23 +00:00
parent 784ae5753b
commit 2f23f1f1a3
2 changed files with 38 additions and 4 deletions

View File

@ -48,7 +48,7 @@
#include "Configint.h"
#include "vbe.h"
#include "xf86DDC.h"
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
#if defined(__sparc__) || defined(__sparc)
#include "xf86Bus.h"
#include "xf86Sbus.h"
#endif
@ -57,7 +57,7 @@
typedef struct _DevToConfig {
GDevRec GDev;
pciVideoPtr pVideo;
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
#if defined(__sparc__) || defined(__sparc)
sbusDevicePtr sVideo;
#endif
int iDriver;
@ -131,7 +131,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
if (!DevToConfig[i].pVideo)
return NULL;
break;
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
#if defined(__sparc__) || defined(__sparc)
case BUS_SBUS:
for (i = 0; i < nDevToConfig; i++)
if (DevToConfig[i].sVideo &&
@ -210,7 +210,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
NewDevice.GDev.identifier = "ISA Adapter";
NewDevice.GDev.busID = "ISA";
break;
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
#if defined(__sparc__) || defined(__sparc)
case BUS_SBUS: {
char *promPath = NULL;
NewDevice.sVideo = (sbusDevicePtr) busData;

View File

@ -93,6 +93,23 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
*foundEntities = NULL;
if (sbusDevId == sbusInfo.devId) {
if (xf86DoConfigure && xf86DoConfigurePass1) {
GDevPtr pGDev;
pGDev = xf86AddBusDeviceToConfigure(drvp->driverName,
BUS_SBUS,
&sbusInfo, -1);
if (pGDev) {
/*
* XF86Match???Instances() treat
* chipID and chipRev as overrides, so
* clobber them here.
*/
pGDev->chipID = pGDev->chipRev = -1;
}
return 1;
}
sbusInfo.device = devList[0]->identifier;
num = xf86AllocateEntity();
p = xf86Entities[num];
@ -168,3 +185,20 @@ xf86SbusHideOsHwCursor(sbusDevicePtr psdp)
FatalError("%s: could not disable cursor (%s)",
"xf86SbusHideOsHWCursor", strerror(errno));
}
int
sparcPromInit(void)
{
return -1;
}
char *
sparcPromNode2Pathname(sbusPromNodePtr pnode)
{
return NULL;
}
void
sparcPromClose(void)
{
}