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
|
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
|
-
+
-
+
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
|
#if defined(XVFS_MODE_STANDALONE)
/*
* In standalone mode, we just redefine calls to
* Xvfs_Register() to go to the xvfs_standalone_register()
* function
*/
# define Xvfs_Register xvfs_standalone_register
XVFS_REGISTER_INTERFACE(Xvfs_Register)
static XVFS_REGISTER_INTERFACE(Xvfs_Register)
#elif defined(XVFS_MODE_FLEXIBLE)
/*
* In flexible mode we declare an external symbol named
* In flexible mode, we just redefine calls to
* Xvfs_Register(), as well as an internal symbol called
* xvfs_flexible_register(), which we redefine future
* calls to Xvfs_Register() to invoke
* Xvfs_Register() to go to the xvfs_flexible_register()
* function which will either dispatch to a common
* core XVFS or use the xvfs_standalone_register()
* function as a standalone would.
*/
extern XVFS_REGISTER_INTERFACE(Xvfs_Register)
# define Xvfs_Register xvfs_flexible_register
XVFS_REGISTER_INTERFACE(Xvfs_Register)
static XVFS_REGISTER_INTERFACE(Xvfs_Register)
#elif defined(XVFS_MODE_CLIENT)
/*
* In client mode we declare an external symbol named
* Xvfs_Register() that must be provided by the environment
* we are loaded into
*/
extern XVFS_REGISTER_INTERFACE(Xvfs_Register)
#elif defined(XVFS_MODE_SERVER)
/*
* In server mode we are going to implementing Xvfs_Register()
* for flexible/client modes, just forward declare it
*/
XVFS_REGISTER_INTERFACE(Xvfs_Register)
#else
# error Unsupported XVFS_MODE
#endif
/*
* In flexible or standalone mode, directly include what
* would otherwise be a separate translation unit, to
* avoid symbols leaking
*/
#if defined(XVFS_MODE_FLEXIBLE) || defined(XVFS_MODE_STANDALONE)
#include <xvfs-core.c>
#endif
#endif
|