Changeset 60088 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemCpy.c
- Timestamp:
- Mar 18, 2016 12:07:33 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemCpy.c
r58666 r60088 30 30 BS3_DECL(void BS3_FAR *) BS3_CMN_NM(Bs3MemCpy)(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy) 31 31 { 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 32 57 size_t cLargeRounds; 33 58 BS3CPTRUNION uSrc; … … 44 69 *uDst.pb++ = *uSrc.pb++; 45 70 71 #endif 72 46 73 return pvDst; 47 74 }
Note:
See TracChangeset
for help on using the changeset viewer.