Changeset 2836 for trunk/kLdr/kLdrInternal.h
- Timestamp:
- Oct 26, 2006, 5:58:53 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdrInternal.h
r2835 r2836 70 70 /** The usual invalid 0 enum. */ 71 71 KLDRSTATE_INVALID = 0, 72 /** kldrOpen succeeded. 73 * Modules in this state will be freed at */ 72 /** The module has just been opened and has no references. 73 * Prev state: - 74 * Next state: MAPPED, DESTROYED 75 */ 74 76 KLDRSTATE_OPEN, 75 /** Dependencies has been loaded. */ 76 KLDRSTATE_DEPS, 77 /** Fixups has been applied. */ 78 KLDRSTATE_FIXED, 79 /** The module has been initialized. */ 80 KLDRSTATE_INITED, 81 /** The module is loaded successfully. */ 82 KLDRSTATE_LOADED, 77 /** The module been mapped. 78 * Prev state: OPEN 79 * Next state: LOADED_DEPS, DESTROYED 80 */ 81 KLDRSTATE_MAPPED, 82 /** The immediate dependencies has been loaded. 83 * Prev state: MAPPED 84 * Next state: FIXED_UP, DESTROYED 85 */ 86 KLDRSTATE_LOADED_DEPS, 87 /** Fixups has been applied. 88 * Prev state: LOADED_DEPS 89 * Next state: PENDING_INIT, DESTROYED 90 */ 91 KLDRSTATE_FIXED_UP, 92 /** Pending initialization. 93 * (The loader can now be in a re-entrant mode.) 94 * Prev state: FIXED_UP 95 * Next state: PENDING_INITIALIZATION, PENDING_GC 96 */ 97 KLDRSTATE_PENDING_INITIALIZATION, 98 /** Initializing. 99 * (The loader is now in a re-entrant mode.) 100 * Prev state: PENDING_INITIALIZATION 101 * Next state: GOOD, PENDING_GC 102 */ 103 KLDRSTATE_INITIALIZING, 104 /** The module has been successfully loaded and initialized. 105 * (The loader can still be in a re-entrant mode.) 106 * Prev state: INITIALIZING 107 * Next state: PENDING_TERMINATION 108 * Re-entrant. 109 */ 110 KLDRSTATE_GOOD, 111 /** Pending termination, reference count is 0. 112 * (The loader can now be in a re-entrant mode.) 113 * Prev state: GOOD 114 * Next state: TERMINATING, GOOD 115 */ 116 KLDRSTATE_PENDING_TERMINATION, 117 /** Terminating, reference count is still 0. 118 * (The loader is now in a re-entrant mode, but loading is a bit restricted.) 119 * Prev state: PENDING_TERMINATION 120 * Next state: PENDING_GC 121 */ 122 KLDRSTATE_TERMINATING, 123 /** Pending garbage collection. 124 * (The loader can still be in a re-entrant mode.) 125 * Prev state: TERMINATING, INITIALIZING, PENDING_INITIALIZATION 126 * Next state: GC, RELOADING 127 */ 128 KLDRSTATE_PENDING_GC, 129 /** Being garbage collected. 130 * (The loader can still be in a re-entrant mode.) 131 * Prev state: PENDING_GC 132 * Next state: DESTROYED 133 */ 134 KLDRSTATE_GC, 135 /** The module is being reloaded after having been scheduled for termination or/and GC. 136 * (The loader can still be in a re-entrant mode.) 137 * Prev state: PENDING_GC 138 * Next state: PENDING_INITIALIZATION 139 */ 140 KLDRSTATE_RELOADING, 141 /** The module has been destroyed and is no longer valid. 142 * Prev state: GC 143 */ 144 KLDRSTATE_DESTROYED, 83 145 /** The end of valid states (exclusive) */ 84 KLDRSTATE_END ,146 KLDRSTATE_END = KLDRSTATE_DESTROYED, 85 147 /** The usual 32-bit blowup. */ 86 148 KLDRSTATE_32BIT_HACK = 0x7fffffff … … 99 161 /** The module. */ 100 162 PKLDRMOD pMod; 163 /** The module handle. */ 164 HKLDRMOD hMod; 101 165 /** The number of references. */ 102 166 uint32_t cRefs; 103 167 /** The number of dynamic references. */ 104 168 uint32_t cDynRefs; 105 /** Set if this is the executable module. */ 169 /** The number of dynamic load operations in progress. 170 * This is used to reject anyone trying to unload a module before the load has 171 * been completed. An alternative to this would be to not add the cDynRefs until 172 * the load operation has completed... */ 173 uint32_t cDynRefsInProgress; 174 /** Set if this is the executable module. 175 * When clear, the module is a shared object or relocatable object. */ 106 176 uint32_t fExecutable : 1; 107 177 /** Global DLL (set) or specific DLL (clear). */ 108 uint32_t fGlobal : 1;109 /** Load stage one. */110 uint32_t f LoadStageOne : 1;178 uint32_t fGlobalOrSpecific : 1; 179 /** Whether the module contains bindable symbols in the global unix namespace. */ 180 uint32_t fBindable : 1; 111 181 /** Reserved for future use. */ 112 182 uint32_t fReserved : 29; 113 /** The next module in the list. */ 114 struct KLDRDYMOD *pNext; 115 /** The prev module in the list. */ 116 struct KLDRDYMOD *pPrev; 183 /** The load list linkage. */ 184 struct 185 { 186 /** The next module in the list. */ 187 struct KLDRDYLDMOD *pNext; 188 /** The prev module in the list. */ 189 struct KLDRDYLDMOD *pPrev; 190 } Load; 191 /** The termination list linkage. */ 192 struct 193 { 194 /** The next module in the list. */ 195 struct KLDRDYLDMOD *pNext; 196 /** The prev module in the list. */ 197 struct KLDRDYLDMOD *pPrev; 198 } Term; 199 /** The bind order list linkage. 200 * The module is not in this list when fBindable is clear. */ 201 struct 202 { 203 /** The next module in the list. */ 204 struct KLDRDYLDMOD *pNext; 205 /** The prev module in the list. */ 206 struct KLDRDYLDMOD *pPrev; 207 } Bind; 117 208 /** Magic number. */ 118 209 uint32_t u32MagicTail; 119 210 } KLDRDYLDMOD, *PKLDRDYLDMOD, **PPKLDRDYLDMOD; 120 211 121 /** KLDRDY MOD magic value. (Fuyumi Soryo) */212 /** KLDRDYLDMOD magic value. (Fuyumi Soryo) */ 122 213 #define KLDRDYMOD_MAGIC 0x19590106 123 214 … … 134 225 135 226 136 int kldrDyldFindNewModule(const char *pszName, const char *psz Prefix, const char *pszSuffix,227 int kldrDyldFindNewModule(const char *pszName, const char *pszDefPrefix, const char *pszDefSuffix, 137 228 KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod); 138 int kldrDyldFindExistingModule(const char *pszName, const char *psz Prefix, const char *pszSuffix,229 int kldrDyldFindExistingModule(const char *pszName, const char *pszDefPrefix, const char *pszDefSuffix, 139 230 KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod); 140 231 … … 158 249 int kldrDyldModCallInit(PKLDRDYLDMOD pMod); 159 250 int kldrDyldModCallTerm(PKLDRDYLDMOD pMod); 251 int kldrDyldModAttachThread(PKLDRDYLDMOD pMod); 252 int kldrDyldModDetachThread(PKLDRDYLDMOD pMod); 160 253 int kldrDyldModGetStackInfo(PKLDRDYLDMOD pMod, void *pvStack, size_t *pcbStack, size_t); 161 254 int kldrDyldModStartExe(PKLDRDYLDMOD pMod); … … 169 262 170 263 171 /** Pointer to the head module (the executable). */264 /** Pointer to the head module of the load list (the executable). */ 172 265 extern PKLDRDYLDMOD kLdrDyldModuleHead; 173 /** Pointer to the tail module . */266 /** Pointer to the tail module of the load list. */ 174 267 extern PKLDRDYLDMOD kLdrDyldModuleTail; 268 /** Pointer to the head module of the termination order list. */ 269 extern PKLDRDYLDMOD g_pkLdrDyldTermHead; 270 /** Pointer to the tail module of the termination order list. */ 271 extern PKLDRDYLDMOD g_pkLdrDyldTermTail; 272 /** Pointer to the head module of the bind order list. 273 * The modules in this list makes up the global namespace used when binding symbol unix fashion. */ 274 extern PKLDRDYLDMOD g_pkLdrDyldBindHead; 275 /** Pointer to the tail module of the bind order list. */ 276 extern PKLDRDYLDMOD g_pkLdrDyldBindTail; 277 278 /** The global error buffer. */ 279 extern char g_szkLdrDyldError[1024]; 280 175 281 /** The Library search path. */ 176 282 extern char kLdrDyldLibraryPath[4096]; 177 /** The global error buffer. */178 extern char g_szkLdrDyldError[1024];179 283 180 284
Note:
See TracChangeset
for help on using the changeset viewer.