Index: cir_driver.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-cirrus/src/cir_driver.c,v retrieving revision 1.7 diff -u -r1.7 cir_driver.c --- cir_driver.c 7 Apr 2006 18:57:40 -0000 1.7 +++ cir_driver.c 31 May 2006 18:49:49 -0000 @@ -118,16 +118,29 @@ * unresolved symbols that are not required. */ +typedef enum {AvailableOptions, Probe} SubSymbolIdx; +typedef ScrnInfoPtr (*subFunctionPtr)(int); + static const char *alpSymbols[] = { "AlpAvailableOptions", "AlpProbe", NULL }; +subFunctionPtr alpRefs[] = { + NULL, + NULL, + NULL +}; static const char *lgSymbols[] = { "LgAvailableOptions", "LgProbe", NULL }; +subFunctionPtr lgRefs[] = { + NULL, + NULL, + NULL +}; static const char *vbeSymbols[] = { "VBEInit", @@ -199,13 +212,13 @@ case PCI_CHIP_GD5464BD: case PCI_CHIP_GD5465: if (lg_loaded) - return LgAvailableOptions(chipid); + return (*lgRefs[AvailableOptions])(chipid); else return NULL; default: if (alp_loaded) - return AlpAvailableOptions(chipid); + return (*alpRefs[AvailableOptions])(chipid); else return NULL; } @@ -214,7 +227,7 @@ static Bool CIRProbe(DriverPtr drv, int flags) { - int i; + int i, symidx; GDevPtr *devSections; pciVideoPtr pPci; int *usedChips; @@ -237,12 +250,18 @@ if (!lg_loaded) { if (xf86LoadDrvSubModule(drv, "cirrus_laguna")) { xf86LoaderReqSymLists(lgSymbols, NULL); + for (symidx=0; lgSymbols[symidx]!=NULL; symidx++) { + lgRefs[symidx]=(subFunctionPtr)LoaderSymbol(lgSymbols[symidx]); + } lg_loaded = TRUE; } } if (!alp_loaded) { if (xf86LoadDrvSubModule(drv, "cirrus_alpine")) { xf86LoaderReqSymLists(alpSymbols, NULL); + for (symidx=0; alpSymbols[symidx]!=NULL; symidx++) { + alpRefs[symidx]=(subFunctionPtr)LoaderSymbol(alpSymbols[symidx]); + } alp_loaded = TRUE; } } @@ -287,17 +306,23 @@ if (!xf86LoadDrvSubModule(drv, "cirrus_laguna")) continue; xf86LoaderReqSymLists(lgSymbols, NULL); + for (symidx=0; lgSymbols[symidx]!=NULL; symidx++) { + lgRefs[symidx]=(subFunctionPtr)LoaderSymbol(lgSymbols[symidx]); + } lg_loaded = TRUE; } - pScrn = LgProbe(usedChips[i]); + pScrn = (*lgRefs[Probe])(usedChips[i]); } else { if (!alp_loaded) { if (!xf86LoadDrvSubModule(drv, "cirrus_alpine")) continue; xf86LoaderReqSymLists(alpSymbols, NULL); + for (symidx=0; alpSymbols[symidx]!=NULL; symidx++) { + alpRefs[symidx]=(subFunctionPtr)LoaderSymbol(alpSymbols[symidx]); + } alp_loaded = TRUE; } - pScrn = AlpProbe(usedChips[i]); + pScrn = (*alpRefs[Probe])(usedChips[i]); } if (pScrn) {