Ignore:
Timestamp:
Sep 3, 2007, 12:46:37 AM (18 years ago)
Author:
bird
Message:

fixed the testcases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/kLdr/testcase/tst-3-driver.c

    r3579 r3584  
    2929*   Header Files                                                               *
    3030*******************************************************************************/
    31 #include <kLdr.h>
    3231#include "tst.h"
     32#include <k/kErr.h>
     33
    3334#include <stdarg.h>
    3435#include <stdio.h>
     
    8687 * Callback for resolving the Tst3Ext import.
    8788 */
    88 static int GetImport(PKLDRMOD pMod, uint32_t iImport, uint32_t iSymbol, const char *pchSymbol, size_t cchSymbol,
    89                      const char *pszVersion, PKLDRADDR puValue, uint32_t *pfKind, void *pvUser)
     89static int GetImport(PKLDRMOD pMod, KU32 iImport, KU32 iSymbol, const char *pchSymbol, KSIZE cchSymbol,
     90                     const char *pszVersion, PKLDRADDR puValue, KU32 *pfKind, void *pvUser)
    9091{
    9192    if (*pfKind != KLDRSYMKIND_REQ_FLAT)
     
    9596        ||  !strncmp(pchSymbol, "_Tst3Ext", strlen("_Tst3Ext")))
    9697    {
    97         *puValue = (uintptr_t)&Tst3Ext;
     98        *puValue = (KUPTR)&Tst3Ext;
    9899        *pfKind = KLDRSYMKIND_CODE | (sizeof(pfKind) == 4 ? KLDRSYMKIND_32BIT : KLDRSYMKIND_64BIT);
    99100        return 0;
     
    124125    /* get bits. */
    125126    cbImage = kLdrModSize(pMod);
    126     pvBits = malloc((size_t)cbImage + 0xfff);
     127    pvBits = malloc((KSIZE)cbImage + 0xfff);
    127128    if (pvBits)
    128129    {
    129         void *pvBits2 = (void *)( ((uintptr_t)pvBits + 0xfff) & ~(uintptr_t)0xfff );
    130 
    131         KLDRADDR BaseAddress = (uintptr_t)pvBits2;
     130        void *pvBits2 = (void *)( ((KUPTR)pvBits + 0xfff) & ~(KUPTR)0xfff );
     131
     132        KLDRADDR BaseAddress = (KUPTR)pvBits2;
    132133        rc = kLdrModGetBits(pMod, pvBits2, BaseAddress, GetImport, NULL);
    133134        if (!rc)
     
    143144            if (!rc)
    144145            {
    145                 int (*pfnEntryPoint)(int) = (int (*)(int)) ((uintptr_t)EntryPoint);
     146                int (*pfnEntryPoint)(int) = (int (*)(int)) ((KUPTR)EntryPoint);
    146147                rc = pfnEntryPoint(42);
    147148                if (rc == 42)
Note: See TracChangeset for help on using the changeset viewer.