Changeset 2835


Ignore:
Timestamp:
Oct 26, 2006, 3:03:39 AM (19 years ago)
Author:
bird
Message:

more prototyping.

Location:
trunk/kLdr
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/Makefile.kmk

    r2833 r2835  
    9292        kLdr.c \
    9393        kLdrDy.c \
     94        kLdrDyldMod.c \
    9495        kLdrDySearch.c \
    9596        kLdrHlp.c \
  • trunk/kLdr/kLdr.h

    r2833 r2835  
    254254/** @defgroup grp_kLdrMod   kLdrMod - The executable image intepreter
    255255 * @{ */
     256
     257/**
     258 * Stack information.
     259 */
     260typedef 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
    256278
    257279/**
     
    538560int     kLdrModRelocateBits(PKLDRMOD pMod, void *pvBits, uintmax_t NewBaseAddress, uintmax_t OldBaseAddress, PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser);
    539561int     kLdrModCanExecuteOn(PKLDRMOD pMod, KLDRARCH enmArch, KLDRCPU enmCpu);
     562int     kLdrModGetStackInfo(PKLDRMOD pMod, PKLDRSTACKINFO pStackInfo);
    540563
    541564/** @} */
     
    605628int     kLdrDyldFindByAddress(uintptr_t Address, PHKLDRMOD phMod, uint32_t *piSegment, uintptr_t *poffSegment);
    606629int     kLdrDyldGetName(HKLDRMOD hMod, char *pszName, size_t cchName);
    607 int     kLdrDyldGetFilename(HKLDRMOD hMod, char *pszFilename, size_t cchFilenamep);
     630int     kLdrDyldGetFilename(HKLDRMOD hMod, char *pszFilename, size_t cchFilename);
    608631int     kLdrDyldQuerySymbol(HKLDRMOD hMod, uint32_t uSymbolOrdinal, const char *pszSymbolName, uintptr_t *pValue, uint32_t *pfKind);
    609632
  • trunk/kLdr/kLdrDySearch.c

    r2834 r2835  
    3535
    3636
     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 */
     49int 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 */
     69int 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  
    134134
    135135
     136int kldrDyldFindNewModule(const char *pszName, const char *pszPrefix, const char *pszSuffix,
     137                          KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod);
     138int kldrDyldFindExistingModule(const char *pszName, const char *pszPrefix, const char *pszSuffix,
     139                               KLDRDYLDSEARCH enmSearch, unsigned fFlags, PPKLDRDYLDMOD ppMod);
     140
     141
     142int kldrDyldModCreate(PKLDRRDR pRdr, PPKLDRDYLDMOD ppMod);
     143int kldrDyldModDestroy(PKLDRDYLDMOD pMod);
     144int kldrDyldModAddDep(PKLDRDYLDMOD pMod, PKLDRDYLDMOD pModDep);
     145int kldrDyldModRemoveDep(PKLDRDYLDMOD pMod, PKLDRDYLDMOD pModDep);
     146int kldrDyldModDynamicLoad(PKLDRDYLDMOD pMod);
     147int kldrDyldModDynamicUnload(PKLDRDYLDMOD pMod);
     148int kldrDyldModMarkGlobal(PKLDRDYLDMOD pMod);
     149int kldrDyldModMarkSpecific(PKLDRDYLDMOD pMod);
     150int kldrDyldModSetBindable(PKLDRDYLDMOD pMod);
     151int kldrDyldModClearBindable(PKLDRDYLDMOD pMod);
     152int kldrDyldModSetDeepBindable(PKLDRDYLDMOD pMod);
     153int kldrDyldModClearDeepBindable(PKLDRDYLDMOD pMod);
     154int kldrDyldModMap(PKLDRDYLDMOD pMod);
     155int kldrDyldModUnmap(PKLDRDYLDMOD pMod);
     156int kldrDyldModLoadDependencies(PKLDRDYLDMOD pMod);
     157int kldrDyldModFixup(PKLDRDYLDMOD pMod);
     158int kldrDyldModCallInit(PKLDRDYLDMOD pMod);
     159int kldrDyldModCallTerm(PKLDRDYLDMOD pMod);
     160int kldrDyldModGetStackInfo(PKLDRDYLDMOD pMod, void *pvStack, size_t *pcbStack, size_t);
     161int kldrDyldModStartExe(PKLDRDYLDMOD pMod);
     162
     163int kldrDyldModGetName(PKLDRDYLDMOD pMod, char *pszName, size_t cchName);
     164int kldrDyldModGetFilename(PKLDRDYLDMOD pMod, char *pszFilename, size_t cchFilename);
     165int kldrDyldModQuerySymbol(PKLDRDYLDMOD pMod, uint32_t uSymbolOrdinal, const char *pszSymbolName, uintptr_t *pValue, uint32_t *pfKind);
     166
     167
     168void kldrDyldFailure(const char *pszFilename, ...);
     169
     170
    136171/** Pointer to the head module (the executable). */
    137172extern PKLDRDYLDMOD     kLdrDyldModuleHead;
     
    140175/** The Library search path. */
    141176extern char             kLdrDyldLibraryPath[4096];
     177/** The global error buffer. */
     178extern char             g_szkLdrDyldError[1024];
    142179
    143 
    144 #if 0
    145 void kldrFailure(const char *pszFilename, ...);
    146 #endif
    147180
    148181/** @} */
Note: See TracChangeset for help on using the changeset viewer.