xref: /OK3568_Linux_fs/external/xserver/hw/xfree86/loader/loaderProcs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright 1995-1998 by Metro Link, Inc.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Permission to use, copy, modify, distribute, and sell this software and its
5*4882a593Smuzhiyun  * documentation for any purpose is hereby granted without fee, provided that
6*4882a593Smuzhiyun  * the above copyright notice appear in all copies and that both that
7*4882a593Smuzhiyun  * copyright notice and this permission notice appear in supporting
8*4882a593Smuzhiyun  * documentation, and that the name of Metro Link, Inc. not be used in
9*4882a593Smuzhiyun  * advertising or publicity pertaining to distribution of the software without
10*4882a593Smuzhiyun  * specific, written prior permission.  Metro Link, Inc. makes no
11*4882a593Smuzhiyun  * representations about the suitability of this software for any purpose.
12*4882a593Smuzhiyun  *  It is provided "as is" without express or implied warranty.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15*4882a593Smuzhiyun  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16*4882a593Smuzhiyun  * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17*4882a593Smuzhiyun  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18*4882a593Smuzhiyun  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19*4882a593Smuzhiyun  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20*4882a593Smuzhiyun  * PERFORMANCE OF THIS SOFTWARE.
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun /*
23*4882a593Smuzhiyun  * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
26*4882a593Smuzhiyun  * copy of this software and associated documentation files (the "Software"),
27*4882a593Smuzhiyun  * to deal in the Software without restriction, including without limitation
28*4882a593Smuzhiyun  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
29*4882a593Smuzhiyun  * and/or sell copies of the Software, and to permit persons to whom the
30*4882a593Smuzhiyun  * Software is furnished to do so, subject to the following conditions:
31*4882a593Smuzhiyun  *
32*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be included in
33*4882a593Smuzhiyun  * all copies or substantial portions of the Software.
34*4882a593Smuzhiyun  *
35*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36*4882a593Smuzhiyun  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
38*4882a593Smuzhiyun  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
39*4882a593Smuzhiyun  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
40*4882a593Smuzhiyun  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41*4882a593Smuzhiyun  * OTHER DEALINGS IN THE SOFTWARE.
42*4882a593Smuzhiyun  *
43*4882a593Smuzhiyun  * Except as contained in this notice, the name of the copyright holder(s)
44*4882a593Smuzhiyun  * and author(s) shall not be used in advertising or otherwise to promote
45*4882a593Smuzhiyun  * the sale, use or other dealings in this Software without prior written
46*4882a593Smuzhiyun  * authorization from the copyright holder(s) and author(s).
47*4882a593Smuzhiyun  */
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #ifdef HAVE_XORG_CONFIG_H
50*4882a593Smuzhiyun #include <xorg-config.h>
51*4882a593Smuzhiyun #endif
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #ifndef _LOADERPROCS_H
54*4882a593Smuzhiyun #define _LOADERPROCS_H
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun #include "xf86Module.h"
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun typedef struct module_desc {
59*4882a593Smuzhiyun     struct module_desc *child;
60*4882a593Smuzhiyun     struct module_desc *sib;
61*4882a593Smuzhiyun     struct module_desc *parent;
62*4882a593Smuzhiyun     void *handle;
63*4882a593Smuzhiyun     ModuleSetupProc SetupProc;
64*4882a593Smuzhiyun     ModuleTearDownProc TearDownProc;
65*4882a593Smuzhiyun     void *TearDownData;         /* returned from SetupProc */
66*4882a593Smuzhiyun     const XF86ModuleVersionInfo *VersionInfo;
67*4882a593Smuzhiyun } ModuleDesc, *ModuleDescPtr;
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun /* External API for the loader */
70*4882a593Smuzhiyun 
71*4882a593Smuzhiyun void LoaderInit(void);
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun ModuleDescPtr LoadModule(const char *, void *, const XF86ModReqInfo *, int *);
74*4882a593Smuzhiyun ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
75*4882a593Smuzhiyun void UnloadDriver(ModuleDescPtr);
76*4882a593Smuzhiyun void LoaderSetPath(const char *path);
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun void LoaderUnload(const char *, void *);
79*4882a593Smuzhiyun unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun void LoaderResetOptions(void);
82*4882a593Smuzhiyun void LoaderSetOptions(unsigned long);
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun const char **LoaderListDir(const char *, const char **);
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun /* Options for LoaderSetOptions */
87*4882a593Smuzhiyun #define LDR_OPT_ABI_MISMATCH_NONFATAL		0x0001
88*4882a593Smuzhiyun 
89*4882a593Smuzhiyun #endif                          /* _LOADERPROCS_H */
90