summaryrefslogtreecommitdiff
path: root/hw/xfree86/utils/xorgcfg/loadmod.c
blob: a53bffa010b038a44f8f9f392286abcb1a3df29b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
/*
 * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
 * 
 * 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
 * CONECTIVA LINUX 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 Conectiva Linux shall
 * not be used in advertising or otherwise to promote the sale, use or other
 * dealings in this Software without prior written authorization from
 * Conectiva Linux.
 *
 * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
 *
 * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v 1.14.2.1 2003/03/13 04:10:50 tsi Exp $
 */

#ifdef USE_MODULES
#include <setjmp.h>

#ifndef HAS_GLIBC_SIGSETJMP
#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
    (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
     ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
#define HAS_GLIBC_SIGSETJMP 1
#endif
#endif

#define LOADER_PRIVATE
#include "loader.h"

#define	True		1
#define False		0
#define XtPointer	char*
#define XtMalloc	malloc
#define XtCalloc	calloc
#define XtRealloc	realloc
#define XtFree		free
#define XtNew(t)	malloc(sizeof(t))
#define XtNewString(s)	((s) ? strdup(s) : NULL)

#define	pointer void*

/* XXX beware (or fix it) libc functions called here are the xf86 ones */

static void AddModuleOptions(char*, const OptionInfoRec*);
#if 0
void xf86AddDriver(DriverPtr, void*, int);
Bool xf86ServerIsOnlyDetecting(void);
void xf86AddInputDriver(InputDriverPtr, pointer, int);
void xf86AddModuleInfo(ModuleInfoPtr, void*);
Bool xf86LoaderCheckSymbol(const char*);
void xf86LoaderRefSymLists(const char **, ...);
void xf86LoaderReqSymLists(const char **, ...);
void xf86Msg(int, const char*, ...);
void xf86PrintChipsets(const char*, const char*, SymTabPtr);
void xf86ErrorFVerb(int verb, const char *format, ...);
pciVideoPtr *xf86GetPciVideoInfo(void);
int xf86MatchDevice(const char*, GDevPtr**);
int xf86MatchPciInstances(const char*, int, SymTabPtr, PciChipsets*, GDevPtr*, int, DriverPtr,int**);
int xf86MatchIsaInstances(const char*, SymTabPtr, pointer*, DriverPtr, pointer, GDevPtr*, int, int**);
void *xf86LoadDrvSubModule(DriverPtr drv, const char*);
void xf86DrvMsg(int, int, const char*, ...);
pciConfigPtr *xf86GetPciConfigInfo(void);
Bool xf86IsPrimaryPci(pcVideoPtr*);
#endif

extern char *loaderPath, **loaderList, **ploaderList;
xf86cfgModuleOptions *module_options;
FontModule *font_module;
int numFontModules;

extern int noverify, error_level;

int xf86ShowUnresolved = 1;

LOOKUP miLookupTab[]      = {{0,0}};
LOOKUP dixLookupTab[]     = {{0,0}};
LOOKUP fontLookupTab[]    = {{0,0}};
LOOKUP extLookupTab[]     = {{0,0}};
LOOKUP xfree86LookupTab[] = {
       /* Loader functions */
   SYMFUNC(LoaderDefaultFunc)
   SYMFUNC(LoadSubModule)
   SYMFUNC(DuplicateModule)
   SYMFUNC(LoaderErrorMsg)
   SYMFUNC(LoaderCheckUnresolved)
   SYMFUNC(LoadExtension)
   SYMFUNC(LoadFont)
   SYMFUNC(LoaderReqSymbols)
   SYMFUNC(LoaderReqSymLists)
   SYMFUNC(LoaderRefSymbols)
   SYMFUNC(LoaderRefSymLists)
   SYMFUNC(UnloadSubModule)
   SYMFUNC(LoaderSymbol)
   SYMFUNC(LoaderListDirs)
   SYMFUNC(LoaderFreeDirList)
   SYMFUNC(LoaderGetOS)

   /*
    * these here are our own interfaces to libc functions
    */
   SYMFUNC(xf86abort)
   SYMFUNC(xf86abs)
   SYMFUNC(xf86acos)
   SYMFUNC(xf86asin)
   SYMFUNC(xf86atan)
   SYMFUNC(xf86atan2)
   SYMFUNC(xf86atof)
   SYMFUNC(xf86atoi)
   SYMFUNC(xf86atol)
   SYMFUNC(xf86bsearch)
   SYMFUNC(xf86ceil)
   SYMFUNC(xf86calloc)
   SYMFUNC(xf86clearerr)
   SYMFUNC(xf86close)
   SYMFUNC(xf86cos)
   SYMFUNC(xf86exit)
   SYMFUNC(xf86exp)
   SYMFUNC(xf86fabs)
   SYMFUNC(xf86fclose)
   SYMFUNC(xf86feof)
   SYMFUNC(xf86ferror)
   SYMFUNC(xf86fflush)
   SYMFUNC(xf86fgetc)
   SYMFUNC(xf86fgetpos)
   SYMFUNC(xf86fgets)
   SYMFUNC(xf86finite)
   SYMFUNC(xf86floor)
   SYMFUNC(xf86fmod)
   SYMFUNC(xf86fopen)
   SYMFUNC(xf86fprintf)
   SYMFUNC(xf86fputc)
   SYMFUNC(xf86fputs)
   SYMFUNC(xf86fread)
   SYMFUNC(xf86free)
   SYMFUNC(xf86freopen)
   SYMFUNC(xf86frexp)
   SYMFUNC(xf86fscanf)
   SYMFUNC(xf86fseek)
   SYMFUNC(xf86fsetpos)
   SYMFUNC(xf86ftell)
   SYMFUNC(xf86fwrite)
   SYMFUNC(xf86getc)
   SYMFUNC(xf86getenv)
   SYMFUNC(xf86getpagesize)
   SYMFUNC(xf86hypot)
   SYMFUNC(xf86ioctl)
   SYMFUNC(xf86isalnum)
   SYMFUNC(xf86isalpha)
   SYMFUNC(xf86iscntrl)
   SYMFUNC(xf86isdigit)
   SYMFUNC(xf86isgraph)
   SYMFUNC(xf86islower)
   SYMFUNC(xf86isprint)
   SYMFUNC(xf86ispunct)
   SYMFUNC(xf86isspace)
   SYMFUNC(xf86isupper)
   SYMFUNC(xf86isxdigit)
   SYMFUNC(xf86labs)
   SYMFUNC(xf86ldexp)
   SYMFUNC(xf86log)
   SYMFUNC(xf86log10)
   SYMFUNC(xf86lseek)
   SYMFUNC(xf86malloc)
   SYMFUNC(xf86memchr)
   SYMFUNC(xf86memcmp)
   SYMFUNC(xf86memcpy)
#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__x86_64__)
   /*
    * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle
    * structure copies.  This causes a problem both here and in shared
    * libraries as there is no way to map the name of the call to the
    * correct function.
    */
   SYMFUNC(memcpy)
   /*
    * Some PPC, SPARC, and IA64 compilers generate calls to memset to handle 
    * aggregate initializations.
    */
   SYMFUNC(memset)
#endif
   SYMFUNC(xf86memmove)
   SYMFUNC(xf86memset)
   SYMFUNC(xf86mmap)
   SYMFUNC(xf86modf)
   SYMFUNC(xf86munmap)
   SYMFUNC(xf86open)
   SYMFUNC(xf86perror)
   SYMFUNC(xf86pow)
   SYMFUNC(xf86printf)
   SYMFUNC(xf86qsort)
   SYMFUNC(xf86read)
   SYMFUNC(xf86realloc)
   SYMFUNC(xf86remove)
   SYMFUNC(xf86rename)
   SYMFUNC(xf86rewind)
   SYMFUNC(xf86setbuf)
   SYMFUNC(xf86setvbuf)
   SYMFUNC(xf86sin)
   SYMFUNC(xf86snprintf)
   SYMFUNC(xf86sprintf)
   SYMFUNC(xf86sqrt)
   SYMFUNC(xf86sscanf)
   SYMFUNC(xf86strcat)
   SYMFUNC(xf86strcmp)
   SYMFUNC(xf86strcasecmp)
   SYMFUNC(xf86strcpy)
   SYMFUNC(xf86strcspn)
   SYMFUNC(xf86strerror)
   SYMFUNC(xf86strlen)
   SYMFUNC(xf86strncmp)
   SYMFUNC(xf86strncasecmp)
   SYMFUNC(xf86strncpy)
   SYMFUNC(xf86strpbrk)
   SYMFUNC(xf86strchr)
   SYMFUNC(xf86strrchr)
   SYMFUNC(xf86strspn)
   SYMFUNC(xf86strstr)
   SYMFUNC(xf86strtod)
   SYMFUNC(xf86strtok)
   SYMFUNC(xf86strtol)
   SYMFUNC(xf86strtoul)
   SYMFUNC(xf86tan)
   SYMFUNC(xf86tmpfile)
   SYMFUNC(xf86tolower)
   SYMFUNC(xf86toupper)
   SYMFUNC(xf86ungetc)
   SYMFUNC(xf86vfprintf)
   SYMFUNC(xf86vsnprintf)
   SYMFUNC(xf86vsprintf)
   SYMFUNC(xf86write)
  
/* non-ANSI C functions */
   SYMFUNC(xf86opendir)
   SYMFUNC(xf86closedir)
   SYMFUNC(xf86readdir)
   SYMFUNC(xf86rewinddir)
   SYMFUNC(xf86ffs)
   SYMFUNC(xf86strdup)
   SYMFUNC(xf86bzero)
   SYMFUNC(xf86usleep)
   SYMFUNC(xf86execl)

   SYMFUNC(xf86getsecs)
   SYMFUNC(xf86fpossize)      /* for returning sizeof(fpos_t) */

   SYMFUNC(xf86stat)
   SYMFUNC(xf86fstat)
   SYMFUNC(xf86access)
   SYMFUNC(xf86geteuid)
   SYMFUNC(xf86getegid)
   SYMFUNC(xf86getpid)
   SYMFUNC(xf86mknod)
   SYMFUNC(xf86chmod)
   SYMFUNC(xf86chown)
   SYMFUNC(xf86sleep)
   SYMFUNC(xf86mkdir)
   SYMFUNC(xf86shmget)
   SYMFUNC(xf86shmat)
   SYMFUNC(xf86shmdt)
   SYMFUNC(xf86shmctl)
#ifdef HAS_GLIBC_SIGSETJMP
   SYMFUNC(xf86setjmp)
   SYMFUNC(xf86setjmp0)
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
   SYMFUNCALIAS("xf86setjmp1",__sigsetjmp)
#else
   SYMFUNC(xf86setjmp1)
#endif
#else
   SYMFUNCALIAS("xf86setjmp",setjmp)
   SYMFUNCALIAS("xf86setjmp0",setjmp)
   SYMFUNC(xf86setjmp1)
#endif
   SYMFUNCALIAS("xf86longjmp",longjmp)
   SYMFUNC(xf86getjmptype)
   SYMFUNC(xf86setjmp1_arg2)
   SYMFUNC(xf86setjmperror)

    SYMFUNC(xf86AddDriver)
    SYMFUNC(xf86ServerIsOnlyDetecting)
    SYMFUNC(xf86AddInputDriver)
    SYMFUNC(xf86AddModuleInfo)
    SYMFUNC(xf86LoaderCheckSymbol)

    SYMFUNC(xf86LoaderRefSymLists)
    SYMFUNC(xf86LoaderReqSymLists)
    SYMFUNC(xf86Msg)
    SYMFUNC(ErrorF)
    SYMFUNC(xf86PrintChipsets)
    SYMFUNC(xf86ErrorFVerb)
    SYMFUNC(xf86GetPciVideoInfo)
    SYMFUNC(xf86MatchDevice)
    SYMFUNC(xf86MatchPciInstances)
    SYMFUNC(xf86MatchIsaInstances)
    SYMFUNC(Xfree)
    SYMFUNC(xf86LoadDrvSubModule)
    SYMFUNC(xf86DrvMsg)
    SYMFUNC(xf86GetPciConfigInfo)
    SYMFUNC(xf86IsPrimaryPci)
    {0,0}
};

static DriverPtr driver;
static ModuleInfoPtr info;
static SymTabPtr chips;
static int vendor;
ModuleType module_type = GenericModule;

static void
AddModuleOptions(char *name, const OptionInfoRec *option)
{
    xf86cfgModuleOptions *ptr;
    const OptionInfoRec *tmp;
    SymTabPtr ctmp;
    int count;

    /* XXX If the module is already in the list, then it means that
     * it is now being properly loaded by xf86cfg and the "fake" entry
     * added in xf86cfgLoaderInitList() isn't required anymore.
     * Currently:
     *	ati and vmware are known to fail. */
    for (ptr = module_options; ptr; ptr = ptr->next)
	if (strcmp(name, ptr->name) == 0) {
	    fprintf(stderr, "Module %s already in list!\n", name);
	    return;
	}

    ptr = XtNew(xf86cfgModuleOptions);
    ptr->name = XtNewString(name);
    ptr->type = module_type;
    if (option) {
	for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++)
	    ;
	++count;
	ptr->option = XtCalloc(1, count * sizeof(OptionInfoRec));
	for (count = 0, tmp = option; tmp->name != NULL; count++, tmp++) {
	    memcpy(&ptr->option[count], tmp, sizeof(OptionInfoRec));
	    ptr->option[count].name = XtNewString(tmp->name);
	    if (tmp->type == OPTV_STRING || tmp->type == OPTV_ANYSTR)
		ptr->option[count].value.str = XtNewString(tmp->value.str);
	}
    }
    else
	ptr->option = NULL;
    if (vendor != -1 && chips) {
	ptr->vendor = vendor;
	for (count = 0, ctmp = chips; ctmp->name; ctmp++, count++)
	    ;
	++count;
	ptr->chipsets = XtCalloc(1, count * sizeof(SymTabRec));
	for (count = 0, ctmp = chips; ctmp->name != NULL; count++, ctmp++) {
	    memcpy(&ptr->chipsets[count], ctmp, sizeof(SymTabRec));
	    ptr->chipsets[count].name = XtNewString(ctmp->name);
	}
    }
    else
	ptr->chipsets = NULL;

    ptr->next = module_options;
    module_options = ptr;
}

extern void xf86WrapperInit(void);

void
xf86cfgLoaderInit(void)
{
    LoaderInit();
    xf86WrapperInit();
}

void
xf86cfgLoaderInitList(int type)
{
    static const char *generic[] = {
	".",
	NULL
    };
    static const char *video[] = {
	"drivers",
	NULL
    };
    static const char *input[] = {
	"input",
	NULL
    };
    static const char *font[] = {
	"fonts",
	NULL
    };
    const char **subdirs;

    switch (type) {
	case GenericModule:
	    subdirs = generic;
	    break;
	case VideoModule:
	    subdirs = video;
	    break;
	case InputModule:
	    subdirs = input;
	    break;
	case FontRendererModule:
	    subdirs = font;
	    break;
	default:
	    fprintf(stderr, "Invalid value passed to xf86cfgLoaderInitList.\n");
	    subdirs = generic;
	    break;
    }
    LoaderSetPath(loaderPath);
    loaderList = LoaderListDirs(subdirs, NULL);

    /* XXX Xf86cfg isn't able to provide enough wrapper functions
     * to these drivers. Maybe the drivers could also be changed
     * to work better when being loaded "just for testing" */
    if (type == VideoModule) {
	module_type = VideoModule;
	AddModuleOptions("vmware", NULL);
	AddModuleOptions("ati", NULL);
	module_type = NullModule;
    }
}

void
xf86cfgLoaderFreeList(void)
{
    LoaderFreeDirList(loaderList);
}

int
xf86cfgCheckModule(void)
{
    int errmaj, errmin;
    ModuleDescPtr module;
    int nfonts;
    FontModule *fonts, *pfont_module;

    driver = NULL;
    chips = NULL;
    info = NULL;
    pfont_module = NULL;
    vendor = -1;
    module_type = GenericModule;

    if ((module = LoadModule(*ploaderList, NULL, NULL, NULL, NULL,
			     NULL, &errmaj, &errmin)) == NULL) {
	LoaderErrorMsg(NULL, *ploaderList, errmaj, errmin);
	return (0);
    }
    else if (driver && driver->AvailableOptions) {
	/* at least fbdev does not call xf86MatchPciInstances in Probe */
	if (driver->Identify)
	    (*driver->Identify)(-1);
	if (driver->Probe)
	    (*driver->Probe)(driver, PROBE_DETECT);
	AddModuleOptions(*ploaderList, (*driver->AvailableOptions)(-1, -1));
    }
    else if (info && info->AvailableOptions)
	AddModuleOptions(*ploaderList, (*info->AvailableOptions)(NULL));

    if (!noverify) {
	XF86ModuleData *initdata = NULL;
	char *p;

	p = XtMalloc(strlen(*ploaderList) + strlen("ModuleData") + 1);
	strcpy(p, *ploaderList);
	strcat(p, "ModuleData");
	initdata = LoaderSymbol(p);
	if (initdata) {
	    XF86ModuleVersionInfo *vers;

	    vers = initdata->vers;
	    if (vers && strcmp(*ploaderList, vers->modname)) {
		/* This was a problem at some time for some video drivers */
		CheckMsg(CHECKER_FILE_MODULE_NAME_MISMATCH,
			 "WARNING file/module name mismatch: \"%s\" \"%s\"\n",
			 *ploaderList, vers->modname);
		++error_level;
	    }
	}
	XtFree(p);
    }

    nfonts = numFontModules;
    numFontModules = 0;
    fonts = FontModuleList;
    if (fonts) {
	while (fonts->name) {
	    if (strcmp(fonts->name, *ploaderList) == 0)
		pfont_module = fonts;
	    ++numFontModules;
	    ++fonts;
	}
    }
    if (pfont_module)
	module_type = FontRendererModule;
    else if (nfonts + 1 <= numFontModules) {
	/* loader.c will flag a warning if -noverify is not set */
	pfont_module = &FontModuleList[nfonts];
	module_type = FontRendererModule;
    }

    if (font_module) {
	XtFree((XtPointer)font_module->name);
	XtFree((XtPointer)font_module);
	font_module = NULL;
    }
    if (pfont_module) {
	font_module = XtNew(FontModule);
	memcpy(font_module, pfont_module, sizeof(FontModule));
	font_module->name = XtNewString(pfont_module->name);
    }

    UnloadModule(module);

    return (1);
}

void
xf86AddDriver(DriverPtr drv, void *module, int flags)
{
    driver = drv;
    if (driver)
	driver->module = module;
    module_type = VideoModule;
}

Bool
xf86ServerIsOnlyDetecting(void)
{
    return (True);
}

void
xf86AddInputDriver(InputDriverPtr inp, void *module, int flags)
{
    module_type = InputModule;
}

void
xf86AddModuleInfo(ModuleInfoPtr inf, void *module)
{
    info = inf;
}

Bool
xf86LoaderCheckSymbol(const char *symbol)
{
    return LoaderSymbol(symbol) != NULL;
}

void
xf86LoaderRefSymLists(const char **list0, ...)
{
}

void
xf86LoaderReqSymLists(const char **list0, ...)
{
}

#if 0
void xf86Msg(int type, const char *format, ...)
{
}
#endif

/*ARGSUSED*/
void
xf86PrintChipsets(const char *name, const char *msg, SymTabPtr chipsets)
{
    vendor = 0;
    chips = chipsets;
}

pciVideoPtr *
xf86GetPciVideoInfo(void)
{
    static pciVideoRec pci_video;
    static pciVideoPtr pci_video_ptr[2] = { &pci_video };

    memset(&pci_video, 0, sizeof(pciVideoRec));

    return (pci_video_ptr);
}

int
xf86MatchDevice(const char *name, GDevPtr **gdev)
{
    *gdev = NULL;

    return (1);
}

int
xf86MatchPciInstances(const char *name, int VendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets,
		      GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities)
{
    vendor = VendorID;
    if (chips == NULL)
	chips = chipsets;
    *foundEntities = NULL;

    return (0);
}

int
xf86MatchIsaInstances(const char *name, SymTabPtr chipsets, IsaChipsets *ISAchipsets, DriverPtr drvp,
		      FindIsaDevProc FindIsaDevice, GDevPtr *devList, int numDevs, int **foundEntities)
{
    *foundEntities = NULL;

    return (0);
}

/*ARGSUSED*/
void *
xf86LoadDrvSubModule(DriverPtr drv, const char *name)
{
    pointer ret;
    int errmaj = 0, errmin = 0;

    ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL,
			&errmaj, &errmin);
    if (!ret)
	LoaderErrorMsg(NULL, name, errmaj, errmin);
    return (ret);
}

pciConfigPtr *
xf86GetPciConfigInfo(void)
{
    return (NULL);
}

Bool
xf86IsPrimaryPci(pciVideoPtr pPci)
{
    return (True);
}
#endif