Changeset 3569 for trunk


Ignore:
Timestamp:
Aug 31, 2007, 4:16:27 AM (18 years ago)
Author:
bird
Message:

Dropped kLdrBase.h

Location:
trunk/kStuff
Files:
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/include/k/kDefs.h

    r3554 r3569  
    252252/** @def K_E2E_U16
    253253 * Convert the endian of an unsigned 16-bit value. */
    254 # define K_E2E_U16(u16)         ( (uint16_t) (((u16) >> 8) | ((u16) << 8)) )
     254# define K_E2E_U16(u16)         ( (KU16) (((u16) >> 8) | ((u16) << 8)) )
    255255/** @def K_E2E_U32
    256256 * Convert the endian of an unsigned 32-bit value. */
    257 # define K_E2E_U32(u32)         (   ( ((u32) & UINT32_C(0xff000000)) >> 24 ) \
    258                                   | ( ((u32) & UINT32_C(0x00ff0000)) >>  8 ) \
    259                                   | ( ((u32) & UINT32_C(0x0000ff00)) <<  8 ) \
    260                                   | ( ((u32) & UINT32_C(0x000000ff)) << 24 ) \
     257# define K_E2E_U32(u32)         (   ( ((u32) & KU32_C(0xff000000)) >> 24 ) \
     258                                  | ( ((u32) & KU32_C(0x00ff0000)) >>  8 ) \
     259                                  | ( ((u32) & KU32_C(0x0000ff00)) <<  8 ) \
     260                                  | ( ((u32) & KU32_C(0x000000ff)) << 24 ) \
    261261                                )
    262262/** @def K_E2E_U64
    263263 * Convert the endian of an unsigned 64-bit value. */
    264 # define K_E2E_U64(u64)         (   ( ((u64) & UINT64_C(0xff00000000000000)) >> 56 ) \
    265                                   | ( ((u64) & UINT64_C(0x00ff000000000000)) >> 40 ) \
    266                                   | ( ((u64) & UINT64_C(0x0000ff0000000000)) >> 24 ) \
    267                                   | ( ((u64) & UINT64_C(0x000000ff00000000)) >>  8 ) \
    268                                   | ( ((u64) & UINT64_C(0x00000000ff000000)) <<  8 ) \
    269                                   | ( ((u64) & UINT64_C(0x0000000000ff0000)) << 24 ) \
    270                                   | ( ((u64) & UINT64_C(0x000000000000ff00)) << 40 ) \
    271                                   | ( ((u64) & UINT64_C(0x00000000000000ff)) << 56 ) \
     264# define K_E2E_U64(u64)         (   ( ((u64) & KU64_C(0xff00000000000000)) >> 56 ) \
     265                                  | ( ((u64) & KU64_C(0x00ff000000000000)) >> 40 ) \
     266                                  | ( ((u64) & KU64_C(0x0000ff0000000000)) >> 24 ) \
     267                                  | ( ((u64) & KU64_C(0x000000ff00000000)) >>  8 ) \
     268                                  | ( ((u64) & KU64_C(0x00000000ff000000)) <<  8 ) \
     269                                  | ( ((u64) & KU64_C(0x0000000000ff0000)) << 24 ) \
     270                                  | ( ((u64) & KU64_C(0x000000000000ff00)) << 40 ) \
     271                                  | ( ((u64) & KU64_C(0x00000000000000ff)) << 56 ) \
    272272                                )
    273273
  • trunk/kStuff/include/k/kLdrFmts/lx.h

    r3568 r3569  
    1313#ifndef IMAGE_OS2_SIGNATURE_LX
    1414/** LX signature ("LX") */
    15 # define IMAGE_LX_SIGNATURE  KLDR_LE2H_U16('L' | ('X' << 8))
     15# define IMAGE_LX_SIGNATURE  K_LE2H_U16('L' | ('X' << 8))
    1616#endif
    1717
  • trunk/kStuff/include/k/kLdrFmts/mach-o.h

    r3568 r3569  
    865865typedef struct scattered_relocation_info
    866866{
    867 #ifdef KLDR_LITTLE_ENDIAN
     867#if K_ENDIAN == K_ENDIAN_LITTLE
    868868    KU32        r_address : 24,     /**< Section relative address of the fixup. (macho_relocation_info_t::r_address) */
    869869                r_type : 4,         /**< Relocation type; 0 is standard, non-zero are machine specific. (macho_relocation_info_t::r_type) */
     
    871871                r_pcrel : 1,        /**< PC (program counter) relative fixup; subtract the fixup address. (macho_relocation_info_t::r_pcrel) */
    872872                r_scattered : 1;    /**< Set if scattered relocation, clear if normal relocation. */
    873 #elif defined(KLDR_BIG_ENDIAN)
     873#elif K_ENDIAN == K_ENDIAN_BIG
    874874    KU32        r_scattered : 1,    /**< Set if scattered relocation, clear if normal relocation. */
    875875                r_pcrel : 1,        /**< PC (program counter) relative fixup; subtract the fixup address. (macho_relocation_info_t::r_pcrel) */
     
    878878                r_address : 24;     /**< Section relative address of the fixup. (macho_relocation_info_t::r_address) */
    879879#else
    880 # error "Neither KLDR_LITTLE_ENDIAN nor KLDR_BIG_ENDIAN is defined!"
     880# error "Neither K_ENDIAN isn't LITTLE or BIG!"
    881881#endif
    882882    KI32        r_value;            /**< The value the fixup is refering to (without offset added). */
  • trunk/kStuff/include/k/kLdrFmts/mz.h

    r3568 r3569  
    3737
    3838#ifndef IMAGE_DOS_SIGNATURE
    39 # define IMAGE_DOS_SIGNATURE KLDR_LE2H_U16('M' | ('Z' << 8))
     39# define IMAGE_DOS_SIGNATURE K_LE2H_U16('M' | ('Z' << 8))
    4040#endif
    4141
  • trunk/kStuff/include/k/kLdrFmts/pe.h

    r3568 r3569  
    1919*******************************************************************************/
    2020#ifndef IMAGE_NT_SIGNATURE
    21 # define  IMAGE_NT_SIGNATURE KLDR_LE2H_U32('P' | ('E' << 8))
     21# define  IMAGE_NT_SIGNATURE K_LE2H_U32('P' | ('E' << 8))
    2222#endif
    2323
  • trunk/kStuff/kLdr/kLdr.h

    r3567 r3569  
    3535 * Include the base typedefs and macros.
    3636 */
    37 #include "kLdrBase.h"
     37#include <k/kDefs.h>
     38#include <k/kTypes.h>
    3839
    3940
     
    5859# define PRI_KLDRADDR    "llx"
    5960#endif
     61
     62/** Align a KSIZE value. */
     63#define KLDR_ALIGN_ADDR(val, align) ( ((val) + ((align) - 1)) & ~(KLDRADDR)((align) - 1) )
    6064
    6165
  • trunk/kStuff/kLdr/kLdrDyld.c

    r3567 r3569  
    267267    /** @todo make sense of this default prefix/suffix stuff. */
    268268    if (pArgs->szDefPrefix[0] != '\0')
    269         kLdrHlpMemCopy(kLdrDyldDefPrefix, pArgs->szDefPrefix, KLDR_MIN(sizeof(pArgs->szDefPrefix), sizeof(kLdrDyldDefPrefix)));
     269        kLdrHlpMemCopy(kLdrDyldDefPrefix, pArgs->szDefPrefix, K_MIN(sizeof(pArgs->szDefPrefix), sizeof(kLdrDyldDefPrefix)));
    270270    if (pArgs->szDefSuffix[0] != '\0')
    271         kLdrHlpMemCopy(kLdrDyldDefSuffix, pArgs->szDefSuffix, KLDR_MIN(sizeof(pArgs->szDefSuffix), sizeof(kLdrDyldDefSuffix)));
     271        kLdrHlpMemCopy(kLdrDyldDefSuffix, pArgs->szDefSuffix, K_MIN(sizeof(pArgs->szDefSuffix), sizeof(kLdrDyldDefSuffix)));
    272272
    273273    /** @todo append that path to the one for the specified search method. */
     
    275275    /* append path */
    276276    cbStack = sizeof(kLdrDyldLibraryPath) - kLdrHlpStrLen(kLdrDyldLibraryPath); /* borrow cbStack for a itty bit. */
    277     kLdrHlpMemCopy(kLdrDyldLibraryPath, pArgs->szLibPath, KLDR_MIN(sizeof(pArgs->szLibPath), cbStack));
     277    kLdrHlpMemCopy(kLdrDyldLibraryPath, pArgs->szLibPath, K_MIN(sizeof(pArgs->szLibPath), cbStack));
    278278    kLdrDyldLibraryPath[sizeof(kLdrDyldLibraryPath) - 1] = '\0';
    279279
  • trunk/kStuff/kLdr/kLdrDyldMod.c

    r3567 r3569  
    11571157                ||  StackInfo.cbStack < cbDefOverride)
    11581158            {
    1159                 KSIZE cbStack = (KSIZE)KLDR_MAX(StackInfo.cbStack, cbDefOverride);
     1159                KSIZE cbStack = (KSIZE)K_MAX(StackInfo.cbStack, cbDefOverride);
    11601160
    11611161                g_pvkLdrDyldMainStack = kldrDyldOSAllocStack(cbStack);
     
    12321232int kldrDyldModGetName(PKLDRDYLDMOD pMod, char *pszName, KSIZE cchName)
    12331233{
    1234     KSIZE cch = KLDR_MIN(cchName, pMod->pMod->cchName + 1);
     1234    KSIZE cch = K_MIN(cchName, pMod->pMod->cchName + 1);
    12351235    if (cch)
    12361236    {
     
    12521252int kldrDyldModGetFilename(PKLDRDYLDMOD pMod, char *pszFilename, KSIZE cchFilename)
    12531253{
    1254     KSIZE cch = KLDR_MIN(cchFilename, pMod->pMod->cchFilename + 1);
     1254    KSIZE cch = K_MIN(cchFilename, pMod->pMod->cchFilename + 1);
    12551255    if (cch)
    12561256    {
  • trunk/kStuff/kLdr/kLdrHlpHeap.c

    r3567 r3569  
    327327     * Find a fitting free block.
    328328     */
    329     const KSIZE     cbReq = KLDR_ALIGN_Z(cb + sizeof(KLDRHEAPBLOCK), KLDRHEAPBLOCK_ALIGNMENT);
     329    const KSIZE     cbReq = K_ALIGN_Z(cb + sizeof(KLDRHEAPBLOCK), KLDRHEAPBLOCK_ALIGNMENT);
    330330    PKLDRHEAPFREE   pCur = pHeap->pFreeHead;
    331331    while (pCur)
     
    420420
    421421    /* adjust the requested block size. */
    422     cb = KLDR_ALIGN_Z(cb, KLDRHEAPBLOCK_ALIGNMENT);
     422    cb = K_ALIGN_Z(cb, KLDRHEAPBLOCK_ALIGNMENT);
    423423    if (!cb)
    424424        cb = KLDRHEAPBLOCK_ALIGNMENT;
     
    579579    {
    580580        cb -= (KUPTR)pv & 31;
    581         pv = KLDR_ALIGN_P(pv, KLDRHEAPBLOCK_ALIGNMENT);
     581        pv = K_ALIGN_P(pv, KLDRHEAPBLOCK_ALIGNMENT);
    582582    }
    583583    cb &= ~(KSIZE)(KLDRHEAPBLOCK_ALIGNMENT - 1);
  • trunk/kStuff/kLdr/kLdrHlpMem.c

    r3567 r3569  
    227227    {
    228228        /* decommit the pages in the stub. */
    229         KSIZE cbStub = KLDR_MIN(g_cbStub - offStub, cb);
     229        KSIZE cbStub = K_MIN(g_cbStub - offStub, cb);
    230230        rc = DosSetMem(pv, cbStub, PAG_DECOMMIT);
    231231        if (rc)
  • trunk/kStuff/kLdr/kLdrInternal.h

    r3567 r3569  
    5050 * @{ */
    5151/** ELF signature ("\x7fELF"). */
    52 #define IMAGE_ELF_SIGNATURE         KLDR_LE2H_U32(0x7f | ('E' << 8) | ((KU32)'L' << 16) | ((KU32)'F' << 24))
     52#define IMAGE_ELF_SIGNATURE         K_LE2H_U32(0x7f | ('E' << 8) | ((KU32)'L' << 16) | ((KU32)'F' << 24))
    5353/** PE signature ("PE\0\0"). */
    54 #define IMAGE_NT_SIGNATURE          KLDR_LE2H_U32('P' | ('E' << 8))
     54#define IMAGE_NT_SIGNATURE          K_LE2H_U32('P' | ('E' << 8))
    5555/** LX signature ("LX") */
    56 #define IMAGE_LX_SIGNATURE          KLDR_LE2H_U16('L' | ('X' << 8))
     56#define IMAGE_LX_SIGNATURE          K_LE2H_U16('L' | ('X' << 8))
    5757/** LE signature ("LE") */
    58 #define IMAGE_LE_SIGNATURE          KLDR_LE2H_U16('L' | ('E' << 8))
     58#define IMAGE_LE_SIGNATURE          K_LE2H_U16('L' | ('E' << 8))
    5959/** NE signature ("NE") */
    60 #define IMAGE_NE_SIGNATURE          KLDR_LE2H_U16('N' | ('E' << 8))
     60#define IMAGE_NE_SIGNATURE          K_LE2H_U16('N' | ('E' << 8))
    6161/** MZ signature ("MZ"). */
    62 #define IMAGE_DOS_SIGNATURE         KLDR_LE2H_U16('M' | ('Z' << 8))
     62#define IMAGE_DOS_SIGNATURE         K_LE2H_U16('M' | ('Z' << 8))
    6363/** The FAT signature (universal binaries). */
    6464#define IMAGE_FAT_SIGNATURE         KU32_C(0xcafebabe)
  • trunk/kStuff/kLdr/kLdrMod.c

    r3568 r3569  
    158158        &&  kLdrRdrSize(pRdr) > sizeof(IMAGE_DOS_HEADER))
    159159    {
    160         rc = kLdrRdrRead(pRdr, &u, sizeof(u.u32), KLDR_OFFSETOF(IMAGE_DOS_HEADER, e_lfanew));
     160        rc = kLdrRdrRead(pRdr, &u, sizeof(u.u32), K_OFFSETOF(IMAGE_DOS_HEADER, e_lfanew));
    161161        if (rc)
    162162            return rc;
  • trunk/kStuff/kLdr/kLdrModLX.c

    r3568 r3569  
    268268     */
    269269    cchFilename = kLdrHlpStrLen(kLdrRdrName(pRdr));
    270     cb = KLDR_ALIGN_Z(sizeof(KLDRMODLX), 8)
    271        + KLDR_ALIGN_Z(KLDR_OFFSETOF(KLDRMOD, aSegments[Hdr.e32_objcnt + 1]), 8)
    272        + KLDR_ALIGN_Z(cchFilename + 1, 8)
     270    cb = K_ALIGN_Z(sizeof(KLDRMODLX), 8)
     271       + K_ALIGN_Z(K_OFFSETOF(KLDRMOD, aSegments[Hdr.e32_objcnt + 1]), 8)
     272       + K_ALIGN_Z(cchFilename + 1, 8)
    273273       + Hdr.e32_ldrsize + 2; /* +2 for two extra zeros. */
    274274    pModLX = (PKLDRMODLX)kldrHlpAlloc(cb);
     
    278278
    279279    /* KLDRMOD */
    280     pMod = (PKLDRMOD)((KU8 *)pModLX + KLDR_ALIGN_Z(sizeof(KLDRMODLX), 8));
     280    pMod = (PKLDRMOD)((KU8 *)pModLX + K_ALIGN_Z(sizeof(KLDRMODLX), 8));
    281281    pMod->pvData = pModLX;
    282282    pMod->pRdr = pRdr;
     
    284284    pMod->cSegments = Hdr.e32_objcnt;
    285285    pMod->cchFilename = cchFilename;
    286     pMod->pszFilename = (char *)KLDR_ALIGN_P(&pMod->aSegments[pMod->cSegments], 8);
     286    pMod->pszFilename = (char *)K_ALIGN_P(&pMod->aSegments[pMod->cSegments], 8);
    287287    kLdrHlpMemCopy((char *)pMod->pszFilename, kLdrRdrName(pRdr), cchFilename + 1);
    288288    pMod->pszName = NULL; /* finalized further down */
     
    337337    pModLX->Hdr = Hdr;
    338338
    339     pModLX->pbLoaderSection = KLDR_ALIGN_P(pMod->pszFilename + pMod->cchFilename + 1, 16);
     339    pModLX->pbLoaderSection = K_ALIGN_P(pMod->pszFilename + pMod->cchFilename + 1, 16);
    340340    pModLX->pbLoaderSectionLast = pModLX->pbLoaderSection + pModLX->Hdr.e32_ldrsize - 1;
    341341    pModLX->paObjs = NULL;
     
    459459            ||  (pModLX->paObjs[i].o32_flags & OBJRSRC)
    460460            ||  (pModLX->paObjs[i + 1].o32_flags & OBJRSRC))
    461             pMod->aSegments[i].cbMapped = KLDR_ALIGN_Z(pModLX->paObjs[i].o32_size, OBJPAGELEN);
     461            pMod->aSegments[i].cbMapped = K_ALIGN_Z(pModLX->paObjs[i].o32_size, OBJPAGELEN);
    462462        else
    463463            pMod->aSegments[i].cbMapped = pModLX->paObjs[i + 1].o32_base - pModLX->paObjs[i].o32_base;
  • trunk/kStuff/kLdr/kLdrModMachO.c

    r3568 r3569  
    299299     */
    300300    cchFilename = kLdrHlpStrLen(kLdrRdrName(pRdr));
    301     cb = KLDR_ALIGN_Z(  KLDR_OFFSETOF(KLDRMODMACHO, aSegments[cSegments])
     301    cb = K_ALIGN_Z(  K_OFFSETOF(KLDRMODMACHO, aSegments[cSegments])
    302302                      + sizeof(KLDRMODMACHOSECT) * cSections, 16)
    303        + KLDR_OFFSETOF(KLDRMOD, aSegments[cSegments])
     303       + K_OFFSETOF(KLDRMOD, aSegments[cSegments])
    304304       + cchFilename + 1
    305305       + cbStringPool;
     
    311311
    312312    /* KLDRMOD */
    313     pMod = (PKLDRMOD)((KU8 *)pModMachO + KLDR_ALIGN_Z(  KLDR_OFFSETOF(KLDRMODMACHO, aSegments[cSegments])
     313    pMod = (PKLDRMOD)((KU8 *)pModMachO + K_ALIGN_Z(  K_OFFSETOF(KLDRMODMACHO, aSegments[cSegments])
    314314                                                      + sizeof(KLDRMODMACHOSECT) * cSections, 16));
    315315    pMod->pvData = pModMachO;
     
    470470        if (fConvertEndian)
    471471        {
    472             u.pLoadCmd->cmd = KLDR_E2E_U32(u.pLoadCmd->cmd);
    473             u.pLoadCmd->cmdsize = KLDR_E2E_U32(u.pLoadCmd->cmdsize);
     472            u.pLoadCmd->cmd = K_E2E_U32(u.pLoadCmd->cmd);
     473            u.pLoadCmd->cmdsize = K_E2E_U32(u.pLoadCmd->cmdsize);
    474474        }
    475475        if (u.pLoadCmd->cmdsize > cbLeft)
     
    497497                if (fConvertEndian)
    498498                {
    499                     u.pSeg32->vmaddr   = KLDR_E2E_U32(u.pSeg32->vmaddr);
    500                     u.pSeg32->vmsize   = KLDR_E2E_U32(u.pSeg32->vmsize);
    501                     u.pSeg32->fileoff  = KLDR_E2E_U32(u.pSeg32->fileoff);
    502                     u.pSeg32->filesize = KLDR_E2E_U32(u.pSeg32->filesize);
    503                     u.pSeg32->maxprot  = KLDR_E2E_U32(u.pSeg32->maxprot);
    504                     u.pSeg32->initprot = KLDR_E2E_U32(u.pSeg32->initprot);
    505                     u.pSeg32->nsects   = KLDR_E2E_U32(u.pSeg32->nsects);
    506                     u.pSeg32->flags    = KLDR_E2E_U32(u.pSeg32->flags);
     499                    u.pSeg32->vmaddr   = K_E2E_U32(u.pSeg32->vmaddr);
     500                    u.pSeg32->vmsize   = K_E2E_U32(u.pSeg32->vmsize);
     501                    u.pSeg32->fileoff  = K_E2E_U32(u.pSeg32->fileoff);
     502                    u.pSeg32->filesize = K_E2E_U32(u.pSeg32->filesize);
     503                    u.pSeg32->maxprot  = K_E2E_U32(u.pSeg32->maxprot);
     504                    u.pSeg32->initprot = K_E2E_U32(u.pSeg32->initprot);
     505                    u.pSeg32->nsects   = K_E2E_U32(u.pSeg32->nsects);
     506                    u.pSeg32->flags    = K_E2E_U32(u.pSeg32->flags);
    507507                }
    508508
     
    537537                    if (fConvertEndian)
    538538                    {
    539                         pSect->addr      = KLDR_E2E_U32(pSect->addr);
    540                         pSect->size      = KLDR_E2E_U32(pSect->size);
    541                         pSect->offset    = KLDR_E2E_U32(pSect->offset);
    542                         pSect->align     = KLDR_E2E_U32(pSect->align);
    543                         pSect->reloff    = KLDR_E2E_U32(pSect->reloff);
    544                         pSect->nreloc    = KLDR_E2E_U32(pSect->nreloc);
    545                         pSect->flags     = KLDR_E2E_U32(pSect->flags);
    546                         pSect->reserved1 = KLDR_E2E_U32(pSect->reserved1);
    547                         pSect->reserved2 = KLDR_E2E_U32(pSect->reserved2);
     539                        pSect->addr      = K_E2E_U32(pSect->addr);
     540                        pSect->size      = K_E2E_U32(pSect->size);
     541                        pSect->offset    = K_E2E_U32(pSect->offset);
     542                        pSect->align     = K_E2E_U32(pSect->align);
     543                        pSect->reloff    = K_E2E_U32(pSect->reloff);
     544                        pSect->nreloc    = K_E2E_U32(pSect->nreloc);
     545                        pSect->flags     = K_E2E_U32(pSect->flags);
     546                        pSect->reserved1 = K_E2E_U32(pSect->reserved1);
     547                        pSect->reserved2 = K_E2E_U32(pSect->reserved2);
    548548                    }
    549549
     
    659659                if (fConvertEndian)
    660660                {
    661                     u.pSymTab->symoff  = KLDR_E2E_U32(u.pSymTab->symoff);
    662                     u.pSymTab->nsyms   = KLDR_E2E_U32(u.pSymTab->nsyms);
    663                     u.pSymTab->stroff  = KLDR_E2E_U32(u.pSymTab->stroff);
    664                     u.pSymTab->strsize = KLDR_E2E_U32(u.pSymTab->strsize);
     661                    u.pSymTab->symoff  = K_E2E_U32(u.pSymTab->symoff);
     662                    u.pSymTab->nsyms   = K_E2E_U32(u.pSymTab->nsyms);
     663                    u.pSymTab->stroff  = K_E2E_U32(u.pSymTab->stroff);
     664                    u.pSymTab->strsize = K_E2E_U32(u.pSymTab->strsize);
    665665                }
    666666
     
    701701                    if (fConvertEndian)
    702702                    {
    703                         pu32[0] = KLDR_E2E_U32(pu32[0]);
    704                         pu32[1] = KLDR_E2E_U32(pu32[1]);
     703                        pu32[0] = K_E2E_U32(pu32[0]);
     704                        pu32[1] = K_E2E_U32(pu32[1]);
    705705                    }
    706706                    if (pu32[1] + 2 > cItemsLeft)
     
    21672167                        while (cLeft-- > 0)
    21682168                        {
    2169                             pSym->n_un.n_strx = KLDR_E2E_U32(pSym->n_un.n_strx);
    2170                             pSym->n_desc = (KI16)KLDR_E2E_U16(pSym->n_desc);
    2171                             pSym->n_value = KLDR_E2E_U32(pSym->n_value);
     2169                            pSym->n_un.n_strx = K_E2E_U32(pSym->n_un.n_strx);
     2170                            pSym->n_desc = (KI16)K_E2E_U16(pSym->n_desc);
     2171                            pSym->n_value = K_E2E_U32(pSym->n_value);
    21722172                            pSym++;
    21732173                        }
     
    21792179                        while (cLeft-- > 0)
    21802180                        {
    2181                             pSym->n_un.n_strx = KLDR_E2E_U32(pSym->n_un.n_strx);
    2182                             pSym->n_desc = (KI16)KLDR_E2E_U16(pSym->n_desc);
    2183                             pSym->n_value = KLDR_E2E_U64(pSym->n_value);
     2181                            pSym->n_un.n_strx = K_E2E_U32(pSym->n_un.n_strx);
     2182                            pSym->n_desc = (KI16)K_E2E_U16(pSym->n_desc);
     2183                            pSym->n_value = K_E2E_U64(pSym->n_value);
    21842184                            pSym++;
    21852185                        }
     
    22382238            {
    22392239                KU32 *pu32 = (KU32 *)&paFixups[iFixup];
    2240                 pu32[0] = KLDR_E2E_U32(pu32[0]);
    2241                 pu32[1] = KLDR_E2E_U32(pu32[1]);
     2240                pu32[0] = K_E2E_U32(pu32[0]);
     2241                pu32[1] = K_E2E_U32(pu32[1]);
    22422242            }
    22432243        }
  • trunk/kStuff/kLdr/kLdrModNative.c

    r3567 r3569  
    301301     */
    302302    cchFilename = kLdrHlpStrLen(szFilename);
    303     cb = KLDR_ALIGN_Z(sizeof(KLDRMODNATIVE), 16)
    304        + KLDR_OFFSETOF(KLDRMOD, aSegments[cSegments])
     303    cb = K_ALIGN_Z(sizeof(KLDRMODNATIVE), 16)
     304       + K_OFFSETOF(KLDRMOD, aSegments[cSegments])
    305305       + cchFilename + 1;
    306306    pModNative = (PKLDRMODNATIVE)kldrHlpAlloc(cb);
     
    309309
    310310    /* KLDRMOD */
    311     pMod = (PKLDRMOD)((KU8 *)pModNative + KLDR_ALIGN_Z(sizeof(KLDRMODNATIVE), 16));
     311    pMod = (PKLDRMOD)((KU8 *)pModNative + K_ALIGN_Z(sizeof(KLDRMODNATIVE), 16));
    312312    pMod->pvData = pModNative;
    313313    pMod->pRdr = NULL;
  • trunk/kStuff/kLdr/kLdrModPE.c

    r3568 r3569  
    201201     */
    202202    cchFilename = kLdrHlpStrLen(kLdrRdrName(pRdr));
    203     cb = KLDR_ALIGN_Z(KLDR_OFFSETOF(KLDRMODPE, aShdrs[s.FileHdr.NumberOfSections]), 16)
    204        + KLDR_OFFSETOF(KLDRMOD, aSegments[s.FileHdr.NumberOfSections + 1])
     203    cb = K_ALIGN_Z(K_OFFSETOF(KLDRMODPE, aShdrs[s.FileHdr.NumberOfSections]), 16)
     204       + K_OFFSETOF(KLDRMOD, aSegments[s.FileHdr.NumberOfSections + 1])
    205205       + cchFilename + 1;
    206206    pModPE = (PKLDRMODPE)kldrHlpAlloc(cb);
     
    210210
    211211    /* KLDRMOD */
    212     pMod = (PKLDRMOD)((KU8 *)pModPE + KLDR_ALIGN_Z(KLDR_OFFSETOF(KLDRMODPE, aShdrs[s.FileHdr.NumberOfSections]), 16));
     212    pMod = (PKLDRMOD)((KU8 *)pModPE + K_ALIGN_Z(K_OFFSETOF(KLDRMODPE, aShdrs[s.FileHdr.NumberOfSections]), 16));
    213213    pMod->pvData = pModPE;
    214214    pMod->pRdr = pRdr;
     
    723723         */
    724724        iExpOrd = iSymbol - pExpDir->Base;
    725         if (iExpOrd >= KLDR_MAX(pExpDir->NumberOfNames, pExpDir->NumberOfFunctions))
     725        if (iExpOrd >= K_MAX(pExpDir->NumberOfNames, pExpDir->NumberOfFunctions))
    726726            return KLDR_ERR_SYMBOL_NOT_FOUND;
    727727    }
     
    14031403                        u;
    14041404        const KU16 *poffFixup = (const KU16 *)(pBR + 1);
    1405         const KU32  cbBlock = KLDR_MIN(cbLeft, pBR->SizeOfBlock) - sizeof(IMAGE_BASE_RELOCATION); /* more caution... */
     1405        const KU32  cbBlock = K_MIN(cbLeft, pBR->SizeOfBlock) - sizeof(IMAGE_BASE_RELOCATION); /* more caution... */
    14061406        KU32        cFixups = cbBlock / sizeof(poffFixup[0]);
    14071407        uChunk.pu8 = KLDRMODPE_RVA2TYPE(pvMapping, pBR->VirtualAddress, KU8 *);
  • trunk/kStuff/kLdr/kLdrRdrFile.c

    r3567 r3569  
    544544    KU32                i;
    545545
    546     if (pRdrFile->cPreps >= KLDR_ELEMENTS(pRdrFile->aPreps))
     546    if (pRdrFile->cPreps >= K_ELEMENTS(pRdrFile->aPreps))
    547547        return KLDR_ERR_TOO_MANY_MAPPINGS;
    548548
Note: See TracChangeset for help on using the changeset viewer.