Changeset 87185 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Jan 6, 2021 12:27:54 PM (4 years ago)
- Location:
- trunk/src/VBox/Runtime/common/asm
- Files:
-
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/asm/ASMMemFill32-generic.cpp
r87184 r87185 33 33 34 34 #include <iprt/string.h> 35 #include <iprt/assert.h> 35 36 36 37 37 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMem ZeroPage(volatile void RT_FAR *pv) RT_NOTHROW_DEF38 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMemFill32(volatile void RT_FAR *pv, size_t cb, uint32_t u32) RT_NOTHROW_DEF 38 39 { 39 memset((void *)pv, 0, RT_ASM_PAGE_SIZE); 40 Assert(!(cb & 3)); 41 size_t cFills = cb / sizeof(uint32_t); 42 uint32_t *pu32Dst = (uint32_t *)pv; 43 44 while (cFills >= 8) 45 { 46 pu32Dst[0] = u32; 47 pu32Dst[1] = u32; 48 pu32Dst[2] = u32; 49 pu32Dst[3] = u32; 50 pu32Dst[4] = u32; 51 pu32Dst[5] = u32; 52 pu32Dst[6] = u32; 53 pu32Dst[7] = u32; 54 pu32Dst += 8; 55 cFills -= 8; 56 } 57 58 while (cFills > 0) 59 { 60 *pu32Dst++ = u32; 61 cFills -= 1; 62 } 40 63 } 41 64 -
trunk/src/VBox/Runtime/common/asm/ASMMemFirstMismatchingU8-generic.cpp
r87184 r87185 5 5 6 6 /* 7 * Copyright (C) 20 21 Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 32 32 #include "internal/iprt.h" 33 33 34 #include <iprt/string.h>35 34 36 37 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMemZeroPage(volatile void RT_FAR *pv) RT_NOTHROW_DEF 35 DECLASM(void *) ASMMemFirstMismatchingU8(void const RT_FAR *pv, size_t cb, uint8_t u8) RT_NOTHROW_DEF 38 36 { 39 memset((void *)pv, 0, RT_ASM_PAGE_SIZE); 37 uint8_t const *pb = (uint8_t const RT_FAR *)pv; 38 for (; cb; cb--, pb++) 39 if (RT_LIKELY(*pb == u8)) 40 { /* likely */ } 41 else 42 return (void *)pb; 43 return NULL; 40 44 } 41 45 -
trunk/src/VBox/Runtime/common/asm/ASMMemZero32-generic.cpp
r87184 r87185 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - ASMMemZero Page- generic C implementation.3 * IPRT - ASMMemZero32 - generic C implementation. 4 4 */ 5 5 … … 35 35 36 36 37 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMemZero Page(volatile void RT_FAR *pv) RT_NOTHROW_DEF37 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMemZero32(volatile void RT_FAR *pv, size_t cb) RT_NOTHROW_DEF 38 38 { 39 memset((void *)pv, 0, RT_ASM_PAGE_SIZE);39 memset((void *)pv, 0, cb); 40 40 } 41 41
Note:
See TracChangeset
for help on using the changeset viewer.