diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 03ea50e46..fbbfc7352 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -130,6 +130,8 @@ void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type); resPtr xf86RegisterResources(int entityIndex, resList list, unsigned long Access); Bool xf86CheckPciMemBase(struct pci_device * pPci, memType base); +void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs, + xf86SetAccessFuncPtr oldFuncs); Bool xf86IsEntityPrimary(int entityIndex); resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes); resPtr xf86SetOperatingState(resList list, int entityIndex, int mask); diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 3030a04ea..758560d14 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -819,6 +819,24 @@ xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn) } } +_X_EXPORT void +xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs, + xf86SetAccessFuncPtr oldFuncs) +{ + AccessFuncPtr rac; + + if (!xf86Entities[pEnt->index]->rac) + xf86Entities[pEnt->index]->rac = xnfcalloc(1,sizeof(AccessFuncRec)); + + rac = xf86Entities[pEnt->index]->rac; + + rac->mem_new = funcs->mem; + rac->io_new = funcs->io; + rac->io_mem_new = funcs->io_mem; + + rac->old = oldFuncs; +} + /* * Conflict checking */ diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 40b9ba4fb..494d2db8d 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -318,6 +318,7 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86GetPciInfoForEntity) SYMFUNC(xf86RegisterResources) SYMFUNC(xf86CheckPciMemBase) + SYMFUNC(xf86SetAccessFuncs) SYMFUNC(xf86IsEntityPrimary) SYMFUNC(xf86SetOperatingState) SYMFUNC(xf86FindScreenForEntity)