Changeset 2840 for trunk/kLdr/kLdrInternal.h
- Timestamp:
- Oct 29, 2006, 2:32:25 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdrInternal.h
r2837 r2840 65 65 /** 66 66 * The state of a dynamic loader module. 67 * @image html KLDRSTATE.gif "The state diagram" 67 68 */ 68 69 typedef enum KLDRSTATE … … 70 71 /** The usual invalid 0 enum. */ 71 72 KLDRSTATE_INVALID = 0, 72 /** The module has just been opened and has no references. 73 74 /** The module has just been opened and linked into the load list. 75 * 73 76 * Prev state: - 74 * Next state: MAPPED, DESTROYED77 * Next state: MAPPED, PENDING_DESTROY 75 78 */ 76 79 KLDRSTATE_OPEN, 77 /** The module been mapped. 80 81 /** The module segments has been mapped into the process memory. 82 * 78 83 * Prev state: OPEN 79 * Next state: LOADED_PREREQUISITES, DESTROYED84 * Next state: LOADED_PREREQUISITES, PENDING_DESTROY 80 85 */ 81 86 KLDRSTATE_MAPPED, 82 87 /** The module has been reloaded and needs to be fixed up again. 83 * (The loader can still be in a re-entrant mode.) 88 * This can occure when the loader is called recursivly. 89 * 90 * The reason RELOADED modules must go back to the PENDING_GC state is 91 * because we want to guard against uninit order issues, and therefore 92 * doesn't unmap modules untill all pending termintation callbacks has 93 * been executed. 94 * 84 95 * Prev state: PENDING_GC 85 * Next state: LOADED_PREREQUISITES, PENDING_GC96 * Next state: RELOADED_LOADED_PREREQUISITES, PENDING_GC 86 97 */ 87 98 KLDRSTATE_RELOADED, 99 88 100 /** The immediate prerequisites have been loaded. 89 * Prev state: MAPPED, RELOADED 90 * Next state: FIXED_UP, DESTROYED 101 * 102 * Prev state: MAPPED 103 * Next state: FIXED_UP, PENDING_DESTROY 91 104 */ 92 105 KLDRSTATE_LOADED_PREREQUISITES, 106 /** The immediate prerequisites have been loaded for a reloaded module. 107 * 108 * Prev state: RELOADED 109 * Next state: RELOADED_FIXED_UP, PENDING_GC 110 */ 111 KLDRSTATE_RELOADED_LOADED_PREREQUISITES, 112 93 113 /** Fixups has been applied. 114 * 94 115 * Prev state: LOADED_PREREQUISITES 95 * Next state: PENDING_INIT , DESTROYED116 * Next state: PENDING_INITIALIZATION, PENDING_DESTROY 96 117 */ 97 118 KLDRSTATE_FIXED_UP, 119 /** Fixups has been applied. 120 * 121 * Prev state: RELOADED_LOADED_PREREQUISITES 122 * Next state: PENDING_INITIALIZATION, PENDING_GC 123 */ 124 KLDRSTATE_RELOADED_FIXED_UP, 125 98 126 /** Pending initialization. 99 * (The loader can now be in a re-entrant mode.) 100 * Prev state: FIXED_UP 101 * Next state: PENDING_INITIALIZATION, PENDING_GC 127 * While the module is in this state the loader is in reentrant mode. 128 * 129 * Prev state: FIXED_UP, RELOADED_FIXED_UP 130 * Next state: INITIALIZATION, PENDING_GC 102 131 */ 103 132 KLDRSTATE_PENDING_INITIALIZATION, 133 104 134 /** Initializing. 105 * (The loader is now in a re-entrant mode.) 135 * While the module is in this state the loader is in reentrant mode. 136 * 106 137 * Prev state: PENDING_INITIALIZATION 107 138 * Next state: GOOD, PENDING_GC 108 139 */ 109 140 KLDRSTATE_INITIALIZING, 141 142 /** Initialization failed. 143 * 144 * This is somewhat similar to PENDING_GC except that, a module 145 * in this state cannot be reloaded untill we've done GC. This ensures 146 * that a init failure during recursive loading is propagated up. 147 * 148 * While the module is in this state the loader is in reentrant mode. 149 * 150 * Prev state: INITIALIZING 151 * Next state: GC 152 */ 153 KLDRSTATE_INITIALIZATION_FAILED, 154 110 155 /** The module has been successfully loaded and initialized. 111 * (The loader can still be in a re-entrant mode.) 156 * While the module is in this state the loader can be in reentrant 157 * or 'unused' mode. 158 * 112 159 * Prev state: INITIALIZING 113 160 * Next state: PENDING_TERMINATION 114 * Re-entrant.115 161 */ 116 162 KLDRSTATE_GOOD, 163 117 164 /** Pending termination, reference count is 0. 118 * (The loader can now be in a re-entrant mode.) 165 * While the module is in this state the loader is in reentrant mode. 166 * 119 167 * Prev state: GOOD 120 168 * Next state: TERMINATING, GOOD 121 169 */ 122 170 KLDRSTATE_PENDING_TERMINATION, 171 123 172 /** Terminating, reference count is still 0. 124 * (The loader is now in a re-entrant mode, but loading is a bit restricted.) 173 * While the module is in this state the loader is in reentrant mode. 174 * 125 175 * Prev state: PENDING_TERMINATION 126 176 * Next state: PENDING_GC 127 177 */ 128 178 KLDRSTATE_TERMINATING, 179 129 180 /** Pending garbage collection. 130 * (The loader can still be in a re-entrant mode.)131 * Prev state: TERMINATING, INITIALIZING, PENDING_INITIALIZATION181 * 182 * Prev state: TERMINATING, PENDING_INITIALIZATION, INITIALIZATION_FAILED 132 183 * Next state: GC, RELOADED 133 184 */ 134 185 KLDRSTATE_PENDING_GC, 186 135 187 /** Being garbage collected. 136 * Prev state: PENDING_GC 188 * 189 * Prev state: PENDING_GC, INITIALIZATION_FAILED 137 190 * Next state: PENDING_DESTROY, DESTROYED 138 191 */ 139 192 KLDRSTATE_GC, 193 140 194 /** The module has be unlinked, but there are still stack references to it. 141 * Prev state: GC 195 * 196 * Prev state: GC, FIXED_UP, LOADED_PREREQUISITES, MAPPED, OPEN 142 197 * Next state: DESTROYED 143 198 */ 144 199 KLDRSTATE_PENDING_DESTROY, 200 145 201 /** The module has been destroyed and is no longer valid. 202 * 146 203 * Prev state: GC, PENDING_DESTROY 147 204 */ 148 205 KLDRSTATE_DESTROYED, 206 149 207 /** The end of valid states (exclusive) */ 150 208 KLDRSTATE_END = KLDRSTATE_DESTROYED, … … 194 252 struct KLDRDYLDMOD *pPrev; 195 253 } Load; 196 /** The termination list linkage. */ 254 /** The termination list linkage. 255 * A module will be linked into the termination list upon a successful 256 * return from module initialization. */ 197 257 struct 198 258 {
Note:
See TracChangeset
for help on using the changeset viewer.