VirtualBox

Ignore:
Timestamp:
Mar 18, 2016 12:07:33 AM (9 years ago)
Author:
vboxsync
Message:

bs3kit: updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemCpy.c

    r58666 r60088  
    3030BS3_DECL(void BS3_FAR *) BS3_CMN_NM(Bs3MemCpy)(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)
    3131{
     32#if 1
     33    const size_t BS3_FAR   *pBigSrc = (const size_t BS3_FAR *)pvSrc;
     34    size_t BS3_FAR         *pBigDst = (size_t *)pvDst;
     35    size_t                  cBig = cbToCopy / sizeof(size_t);
     36    while (cBig-- > 0)
     37        *pBigDst++ = *pBigSrc++;
     38
     39    switch (cbToCopy % sizeof(size_t))
     40    {
     41#if TMPL_BITS >= 64
     42        case 7: ((uint8_t BS3_FAR *)pBigDst)[6] = ((const uint8_t BS3_FAR *)pBigSrc)[6];
     43        case 6: ((uint8_t BS3_FAR *)pBigDst)[5] = ((const uint8_t BS3_FAR *)pBigSrc)[5];
     44        case 5: ((uint8_t BS3_FAR *)pBigDst)[4] = ((const uint8_t BS3_FAR *)pBigSrc)[4];
     45        case 4: ((uint8_t BS3_FAR *)pBigDst)[3] = ((const uint8_t BS3_FAR *)pBigSrc)[3];
     46#endif
     47#if TMPL_BITS >= 32
     48        case 3: ((uint8_t BS3_FAR *)pBigDst)[2] = ((const uint8_t BS3_FAR *)pBigSrc)[2];
     49        case 2: ((uint8_t BS3_FAR *)pBigDst)[1] = ((const uint8_t BS3_FAR *)pBigSrc)[1];
     50#endif
     51        case 1: ((uint8_t BS3_FAR *)pBigDst)[0] = ((const uint8_t BS3_FAR *)pBigSrc)[0];
     52        case 0:
     53            break;
     54    }
     55
     56#else
    3257    size_t          cLargeRounds;
    3358    BS3CPTRUNION    uSrc;
     
    4469        *uDst.pb++ = *uSrc.pb++;
    4570
     71#endif
     72
    4673    return pvDst;
    4774}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette