Ignore:
Timestamp:
Feb 14, 2007, 11:12:44 AM (18 years ago)
Author:
bird
Message:

off_t -> KLDRFOFF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdrModLX.c

    r2948 r2974  
    7070
    7171    /** The offset of the LX header. */
    72     off_t                   offHdr;
     72    KLDRFOFF                offHdr;
    7373    /** Copy of the LX header. */
    7474    struct e32_exe          Hdr;
     
    116116static int kldrModLXRelocateBits(PKLDRMOD pMod, void *pvBits, KLDRADDR NewBaseAddress, KLDRADDR OldBaseAddress,
    117117                                 PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser);
    118 static int kldrModLXDoCreate(PKLDRRDR pRdr, off_t offNewHdr, PKLDRMODLX *ppModLX);
     118static int kldrModLXDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX);
    119119static const uint8_t *kldrModLXDoNameTableLookupByOrdinal(const uint8_t *pbNameTable, int32_t cbNameTable, uint32_t iOrdinal);
    120120static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, uint32_t cchSymbol, uint32_t *piSymbol);
     
    133133static int kldrModLXDoLoadFixupSection(PKLDRMODLX pModLX);
    134134static int32_t kldrModLXDoCall(uintptr_t uEntrypoint, uintptr_t uHandle, uint32_t uOp, void *pvReserved);
    135 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 
     135static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc,
    136136                            int iSelector, KLDRADDR uValue, uint32_t fKind);
    137137
     
    148148 * @param   ppMod           Where to store the module instance pointer.
    149149 */
    150 static int kldrModLXCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_t offNewHdr, PPKLDRMOD ppMod)
     150static int kldrModLXCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod)
    151151{
    152152    PKLDRMODLX pModLX;
     
    173173 * simplify cleanup on failure.
    174174 */
    175 static int kldrModLXDoCreate(PKLDRRDR pRdr, off_t offNewHdr, PKLDRMODLX *ppModLX)
     175static int kldrModLXDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX)
    176176{
    177177    struct e32_exe Hdr;
     
    208208
    209209    /* Some rough sanity checks. */
    210     offEnd = kLdrRdrSize(pRdr) >= (off_t)~(uint32_t)16 ? ~(uint32_t)16 : (uint32_t)kLdrRdrSize(pRdr);
     210    offEnd = kLdrRdrSize(pRdr) >= (KLDRFOFF)~(uint32_t)16 ? ~(uint32_t)16 : (uint32_t)kLdrRdrSize(pRdr);
    211211    if (    Hdr.e32_itermap > offEnd
    212212        ||  Hdr.e32_datapage > offEnd
     
    249249        &&  (Hdr.e32_fpagetab < off || Hdr.e32_fpagetab > offEnd))
    250250    {
    251         /* 
     251        /*
    252252         * wlink mixes the fixup section and the loader section.
    253253         */
     
    21052105                        else
    21062106                            uValue = pMod->aSegments[iSeg].MapAddress;
    2107                         if (    (u.prlc->nr_stype & NRALIAS) 
     2107                        if (    (u.prlc->nr_stype & NRALIAS)
    21082108                            ||  (pMod->aSegments[iSeg].fFlags & KLDRSEG_FLAG_16BIT))
    21092109                            iSelector = pMod->aSegments[iSeg].Sel16bit;
     
    22422242
    22432243                    /* common / simple */
    2244                     if (    (u.prlc->nr_stype & NRSRCMASK) == NROFF32 
    2245                         &&  off >= 0 
     2244                    if (    (u.prlc->nr_stype & NRSRCMASK) == NROFF32
     2245                        &&  off >= 0
    22462246                        &&  off <= OBJPAGELEN - 4)
    22472247                        *(uint32_t *)&pbPage[off] = uValue;
    2248                     else if (    (u.prlc->nr_stype & NRSRCMASK) == NRSOFF32 
    2249                             &&  off >= 0 
     2248                    else if (    (u.prlc->nr_stype & NRSRCMASK) == NRSOFF32
     2249                            &&  off >= 0
    22502250                            &&  off <= OBJPAGELEN - 4)
    22512251                        *(uint32_t *)&pbPage[off] = uValue - (PageAddress + off);
     
    23212321/**
    23222322 * Applies the relocation to one 'source' in a page.
    2323  * 
    2324  * This takes care of the more esotic case while the common cases 
     2323 *
     2324 * This takes care of the more esotic case while the common cases
    23252325 * are dealt with seperately.
    23262326 *
     
    23312331 * @param   fKind       The target kind.
    23322332 */
    2333 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 
     2333static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc,
    23342334                            int iSelector, KLDRADDR uValue, uint32_t fKind)
    23352335{
    2336     static const uint8_t s_acb[16] = 
     2336    static const uint8_t s_acb[16] =
    23372337    {
    23382338        1, /* 0: NRSBYT */
     
    23402340        2, /* 2: NRSSEG - selector */
    23412341        4, /* 3: NRSPTR - 16:16 */
    2342         0, 
     2342        0,
    23432343        2, /* 5: NRSOFF - 16-bit offset */
    23442344        6, /* 6: NRPTR48 - 16:32 */
     
    23482348    };
    23492349#pragma pack(1) /* just to be sure */
    2350     union 
     2350    union
    23512351    {
    23522352        uint8_t     ab[6];
     
    23542354        uint16_t    off16;
    23552355        uint8_t     off8;
    2356         struct 
     2356        struct
    23572357        {
    23582358            uint16_t off;
    23592359            uint16_t Sel;
    23602360        }           Far16;
    2361         struct 
     2361        struct
    23622362        {
    23632363            uint32_t off;
     
    23752375    switch (prlc->nr_stype & NRSRCMASK)
    23762376    {
    2377         case NRSBYT:       
     2377        case NRSBYT:
    23782378            uData.off8 = (uint8_t)uValue;
    23792379            cb = 1;
Note: See TracChangeset for help on using the changeset viewer.