Changeset 2835
- Timestamp:
- Oct 26, 2006, 3:03:39 AM (19 years ago)
- Location:
- trunk/kLdr
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/Makefile.kmk
r2833 r2835 92 92 kLdr.c \ 93 93 kLdrDy.c \ 94 kLdrDyldMod.c \ 94 95 kLdrDySearch.c \ 95 96 kLdrHlp.c \ -
trunk/kLdr/kLdr.h
r2833 r2835 254 254 /** @defgroup grp_kLdrMod kLdrMod - The executable image intepreter 255 255 * @{ */ 256 257 /** 258 * Stack information. 259 */ 260 typedef struct KLDRSTACKINFO 261 { 262 /** The base address of the stack (sub) segment, link address. 263 * Set this to ~(uintptr_t)0 if the module doesn't include any stack (sub)segment. */ 264 uintmax_t uLinkAddress; 265 /** The base address of the stack (sub) segment, actual load address. 266 * Set this to ~(uintptr_t)0 if the module doesn't include any stack (sub)segment or if 267 * the module isn't mapped (loaded) yet. */ 268 uintmax_t uLoadAddress; 269 /** The stack size of the main thread. 270 * If no stack (sub)segment in the module, this is the stack size of the main thread. 271 * If the module doesn't contain this kind of information this field will be set to 0. */ 272 uintmax_t cbStack; 273 /** The stack size of non-main threads. 274 * If the module doesn't contain this kind of information this field will be set to 0. */ 275 uintmax_t cbStackThread; 276 } KLDRSTACKINFO, *PKLDRSTACKINFO; 277 256 278 257 279 /** … … 538 560 int kLdrModRelocateBits(PKLDRMOD pMod, void *pvBits, uintmax_t NewBaseAddress, uintmax_t OldBaseAddress, PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser); 539 561 int kLdrModCanExecuteOn(PKLDRMOD pMod, KLDRARCH enmArch, KLDRCPU enmCpu); 562 int kLdrModGetStackInfo(PKLDRMOD pMod, PKLDRSTACKINFO pStackInfo); 540 563 541 564 /** @} */ … … 605 628 int kLdrDyldFindByAddress(uintptr_t Address, PHKLDRMOD phMod, uint32_t *piSegment, uintptr_t *poffSegment); 606 629 int kLdrDyldGetName(HKLDRMOD hMod, char *pszName, size_t cchName); 607 int kLdrDyldGetFilename(HKLDRMOD hMod, char *pszFilename, size_t cchFilename p);630 int kLdrDyldGetFilename(HKLDRMOD hMod, char *pszFilename, size_t cchFilename); 608 631 int kLdrDyldQuerySymbol(HKLDRMOD hMod, uint32_t uSymbolOrdinal, const char *pszSymbolName, uintptr_t *pValue, uint32_t *pfKind); 609 632 -
trunk/kLdr/kLdrDySearch.c
r2834 r2835 35 35 36 36 37 /** 38 * Locates and opens a module using the specified search method. 39 * 40 * @returns 0 and *ppRdr on success, non-zero OS specific error on failure. 41 * 42 * @param pszName Partial or complete name, it's specific to the search method to determin which. 43 * @param pszPrefix Prefix that might be used (that's method specific). 44 * @param pszSuffix Suffix that can be applied to an incomplete name. 45 * @param enmSearch The file search method to apply. 46 * @param fFlags Search flags. 47 * @param ppMod Where to store the file provider instance on success. 48 */ 49 int kldrDyldFindNewModule(const char *pszName, const char *pszPrefix, const char *pszSuffix, 50 KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod) 51 { 52 *ppMod = NULL; 53 return -1; 54 } 55 56 57 /** 58 * Locates an already open module using the specified search method. 59 * 60 * @returns 0 and *ppMod on success, non-zero OS specific error on failure. 61 * 62 * @param pszName Partial or complete name, it's specific to the search method to determin which. 63 * @param pszPrefix Prefix that might be used (that's method specific). 64 * @param pszSuffix Suffix that can be applied to an incomplete name. 65 * @param enmSearch The file search method to apply. 66 * @param fFlags Search flags. 67 * @param ppMod Where to store the file provider instance on success. 68 */ 69 int kldrDyldFindExistingModule(const char *pszName, const char *pszPrefix, const char *pszSuffix, 70 KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod) 71 { 72 *ppMod = NULL; 73 return -1; 74 } 75 -
trunk/kLdr/kLdrInternal.h
r2833 r2835 134 134 135 135 136 int kldrDyldFindNewModule(const char *pszName, const char *pszPrefix, const char *pszSuffix, 137 KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod); 138 int kldrDyldFindExistingModule(const char *pszName, const char *pszPrefix, const char *pszSuffix, 139 KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod); 140 141 142 int kldrDyldModCreate(PKLDRRDR pRdr, PPKLDRDYLDMOD ppMod); 143 int kldrDyldModDestroy(PKLDRDYLDMOD pMod); 144 int kldrDyldModAddDep(PKLDRDYLDMOD pMod, PKLDRDYLDMOD pModDep); 145 int kldrDyldModRemoveDep(PKLDRDYLDMOD pMod, PKLDRDYLDMOD pModDep); 146 int kldrDyldModDynamicLoad(PKLDRDYLDMOD pMod); 147 int kldrDyldModDynamicUnload(PKLDRDYLDMOD pMod); 148 int kldrDyldModMarkGlobal(PKLDRDYLDMOD pMod); 149 int kldrDyldModMarkSpecific(PKLDRDYLDMOD pMod); 150 int kldrDyldModSetBindable(PKLDRDYLDMOD pMod); 151 int kldrDyldModClearBindable(PKLDRDYLDMOD pMod); 152 int kldrDyldModSetDeepBindable(PKLDRDYLDMOD pMod); 153 int kldrDyldModClearDeepBindable(PKLDRDYLDMOD pMod); 154 int kldrDyldModMap(PKLDRDYLDMOD pMod); 155 int kldrDyldModUnmap(PKLDRDYLDMOD pMod); 156 int kldrDyldModLoadDependencies(PKLDRDYLDMOD pMod); 157 int kldrDyldModFixup(PKLDRDYLDMOD pMod); 158 int kldrDyldModCallInit(PKLDRDYLDMOD pMod); 159 int kldrDyldModCallTerm(PKLDRDYLDMOD pMod); 160 int kldrDyldModGetStackInfo(PKLDRDYLDMOD pMod, void *pvStack, size_t *pcbStack, size_t); 161 int kldrDyldModStartExe(PKLDRDYLDMOD pMod); 162 163 int kldrDyldModGetName(PKLDRDYLDMOD pMod, char *pszName, size_t cchName); 164 int kldrDyldModGetFilename(PKLDRDYLDMOD pMod, char *pszFilename, size_t cchFilename); 165 int kldrDyldModQuerySymbol(PKLDRDYLDMOD pMod, uint32_t uSymbolOrdinal, const char *pszSymbolName, uintptr_t *pValue, uint32_t *pfKind); 166 167 168 void kldrDyldFailure(const char *pszFilename, ...); 169 170 136 171 /** Pointer to the head module (the executable). */ 137 172 extern PKLDRDYLDMOD kLdrDyldModuleHead; … … 140 175 /** The Library search path. */ 141 176 extern char kLdrDyldLibraryPath[4096]; 177 /** The global error buffer. */ 178 extern char g_szkLdrDyldError[1024]; 142 179 143 144 #if 0145 void kldrFailure(const char *pszFilename, ...);146 #endif147 180 148 181 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.