1 | /** @file
|
---|
2 | * IPRT - Runtime Init/Term.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | *
|
---|
25 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
26 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
27 | * additional information or have any questions.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef ___iprt_initterm_h
|
---|
31 | #define ___iprt_initterm_h
|
---|
32 |
|
---|
33 | #include <iprt/cdefs.h>
|
---|
34 | #include <iprt/types.h>
|
---|
35 |
|
---|
36 | __BEGIN_DECLS
|
---|
37 |
|
---|
38 | /** @defgroup grp_rt IPRT APIs
|
---|
39 | * @{
|
---|
40 | */
|
---|
41 |
|
---|
42 | /** @defgroup grp_rt_initterm Init / Term
|
---|
43 | * @{
|
---|
44 | */
|
---|
45 |
|
---|
46 | #ifdef IN_RING3
|
---|
47 | /**
|
---|
48 | * Initializes the runtime library.
|
---|
49 | *
|
---|
50 | * @returns iprt status code.
|
---|
51 | */
|
---|
52 | RTR3DECL(int) RTR3Init(void);
|
---|
53 |
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * Initializes the runtime library and try initialize SUPLib too.
|
---|
57 | *
|
---|
58 | * @returns IPRT status code.
|
---|
59 | * @param pszProgramPath The path to the program file.
|
---|
60 | *
|
---|
61 | * @remarks Failure to initialize SUPLib is ignored.
|
---|
62 | */
|
---|
63 | RTR3DECL(int) RTR3InitAndSUPLib(void);
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Initializes the runtime library passing it the program path.
|
---|
67 | *
|
---|
68 | * @returns IPRT status code.
|
---|
69 | * @param pszProgramPath The path to the program file.
|
---|
70 | */
|
---|
71 | RTR3DECL(int) RTR3InitWithProgramPath(const char *pszProgramPath);
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Initializes the runtime library passing it the program path,
|
---|
75 | * and try initialize SUPLib too (failures ignored).
|
---|
76 | *
|
---|
77 | * @returns IPRT status code.
|
---|
78 | * @param pszProgramPath The path to the program file.
|
---|
79 | *
|
---|
80 | * @remarks Failure to initialize SUPLib is ignored.
|
---|
81 | */
|
---|
82 | RTR3DECL(int) RTR3InitAndSUPLibWithProgramPath(const char *pszProgramPath);
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * Initializes the runtime library and possibly also SUPLib too.
|
---|
86 | *
|
---|
87 | * Avoid this interface, it's not considered stable.
|
---|
88 | *
|
---|
89 | * @returns IPRT status code.
|
---|
90 | * @param iVersion The interface version. Must be 0 atm.
|
---|
91 | * @param pszProgramPath The program path. Pass NULL if we're to figure it out ourselves.
|
---|
92 | * @param fInitSUPLib Whether to initialize the support library or not.
|
---|
93 | */
|
---|
94 | RTR3DECL(int) RTR3InitEx(uint32_t iVersion, const char *pszProgramPath, bool fInitSUPLib);
|
---|
95 |
|
---|
96 | /**
|
---|
97 | * Terminates the runtime library.
|
---|
98 | */
|
---|
99 | RTR3DECL(void) RTR3Term(void);
|
---|
100 |
|
---|
101 | #endif /* IN_RING3 */
|
---|
102 |
|
---|
103 |
|
---|
104 | #ifdef IN_RING0
|
---|
105 | /**
|
---|
106 | * Initalizes the ring-0 driver runtime library.
|
---|
107 | *
|
---|
108 | * @returns iprt status code.
|
---|
109 | * @param fReserved Flags reserved for the future.
|
---|
110 | */
|
---|
111 | RTR0DECL(int) RTR0Init(unsigned fReserved);
|
---|
112 |
|
---|
113 | /**
|
---|
114 | * Terminates the ring-0 driver runtime library.
|
---|
115 | */
|
---|
116 | RTR0DECL(void) RTR0Term(void);
|
---|
117 | #endif
|
---|
118 |
|
---|
119 | #ifdef IN_GC
|
---|
120 | /**
|
---|
121 | * Initalizes the guest context runtime library.
|
---|
122 | *
|
---|
123 | * @returns iprt status code.
|
---|
124 | *
|
---|
125 | * @param u64ProgramStartNanoTS The startup timestamp.
|
---|
126 | */
|
---|
127 | RTGCDECL(int) RTGCInit(uint64_t u64ProgramStartNanoTS);
|
---|
128 |
|
---|
129 | /**
|
---|
130 | * Terminates the guest context runtime library.
|
---|
131 | */
|
---|
132 | RTGCDECL(void) RTGCTerm(void);
|
---|
133 | #endif
|
---|
134 |
|
---|
135 |
|
---|
136 | /** @} */
|
---|
137 |
|
---|
138 | /** @} */
|
---|
139 |
|
---|
140 | __END_DECLS
|
---|
141 |
|
---|
142 |
|
---|
143 | #endif
|
---|
144 |
|
---|