- Timestamp:
- Jan 24, 2024 12:58:12 AM (8 months ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 9 edited
-
include/iprt/asm-mem-watcom-x86-16.h (modified) (1 diff)
-
include/iprt/asm-mem-watcom-x86-32.h (modified) (1 diff)
-
include/iprt/asm-mem.h (modified) (1 diff)
-
include/iprt/mangling.h (modified) (1 diff)
-
src/VBox/Runtime/Makefile.kmk (modified) (2 diffs)
-
src/VBox/Runtime/VBox/VBoxRTImp.def (modified) (1 diff)
-
src/VBox/Runtime/common/asm/ASMMemZeroPage-generic.cpp (deleted)
-
src/VBox/Runtime/testcase/tstRTInlineAsm.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMAll/PGMAllPool.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/PGMPool.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm-mem-watcom-x86-16.h
r103005 r103014 52 52 * the watcom header at both the top and the bottom of asm.h file. 53 53 */ 54 55 #undef ASMMemZeroPage56 #ifdef IPRT_ASM_WATCOM_X86_16_WITH_PRAGMAS57 # if defined(__SW_0) || defined(__SW_1) || defined(__SW_2)58 # pragma aux ASMMemZeroPage = \59 "mov cx, 2048" \60 "xor ax, ax" \61 "rep stosw" \62 parm [es di] \63 modify exact [ax cx di];64 # else65 # pragma aux ASMMemZeroPage = \66 "mov ecx, 1024" \67 "xor eax, eax" \68 "rep stosd" \69 parm [es di] \70 modify exact [ax cx di];71 # endif72 #endif73 54 74 55 #undef ASMMemZero32 -
trunk/include/iprt/asm-mem-watcom-x86-32.h
r103005 r103014 53 53 */ 54 54 55 #undef ASMMemZeroPage56 #ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS57 #pragma aux ASMMemZeroPage = \58 "mov ecx, 1024" \59 "xor eax, eax" \60 "rep stosd" \61 parm [edi] \62 modify exact [eax ecx edi];63 #endif64 65 55 #undef ASMMemZero32 66 56 #ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS -
trunk/include/iprt/asm-mem.h
r103013 r103014 101 101 # endif 102 102 #endif 103 104 105 #ifdef RT_ASM_PAGE_SIZE106 /**107 * Zeros a 4K memory page.108 *109 * @param pv Pointer to the memory block. This must be page aligned.110 */111 # if (RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN) || (!defined(RT_ARCH_AMD64) && !defined(RT_ARCH_X86))112 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMemZeroPage(volatile void RT_FAR *pv) RT_NOTHROW_PROTO;113 # else114 DECLINLINE(void) ASMMemZeroPage(volatile void RT_FAR *pv) RT_NOTHROW_DEF115 {116 # if RT_INLINE_ASM_USES_INTRIN117 # ifdef RT_ARCH_AMD64118 __stosq((unsigned __int64 *)pv, 0, RT_ASM_PAGE_SIZE / 8);119 # else120 __stosd((unsigned long *)pv, 0, RT_ASM_PAGE_SIZE / 4);121 # endif122 123 # elif RT_INLINE_ASM_GNU_STYLE124 RTCCUINTREG uDummy;125 # ifdef RT_ARCH_AMD64126 __asm__ __volatile__("rep stosq"127 : "=D" (pv),128 "=c" (uDummy)129 : "0" (pv),130 "c" (RT_ASM_PAGE_SIZE >> 3),131 "a" (0)132 : "memory");133 # else134 __asm__ __volatile__("rep stosl"135 : "=D" (pv),136 "=c" (uDummy)137 : "0" (pv),138 "c" (RT_ASM_PAGE_SIZE >> 2),139 "a" (0)140 : "memory");141 # endif142 # else143 __asm144 {145 # ifdef RT_ARCH_AMD64146 xor rax, rax147 mov ecx, 0200h148 mov rdi, [pv]149 rep stosq150 # else151 xor eax, eax152 mov ecx, 0400h153 mov edi, [pv]154 rep stosd155 # endif156 }157 # endif158 }159 # endif160 #endif /* RT_ASM_PAGE_SIZE */161 103 162 104 -
trunk/include/iprt/mangling.h
r102647 r103014 291 291 # define ASMMemZero32 RT_MANGLER(ASMMemZero32) 292 292 # define ASMMemZero32_EndProc RT_MANGLER(ASMMemZero32_EndProc) 293 # define ASMMemZeroPage RT_MANGLER(ASMMemZeroPage)294 # define ASMMemZeroPage_EndProc RT_MANGLER(ASMMemZeroPage_EndProc)295 293 # define ASMMultU64ByU32DivByU32 RT_MANGLER(ASMMultU64ByU32DivByU32) 296 294 # define ASMMultU64ByU32DivByU32_EndProc RT_MANGLER(ASMMultU64ByU32DivByU32_EndProc) -
trunk/src/VBox/Runtime/Makefile.kmk
r102648 r103014 879 879 common/asm/ASMBitFirstSet-generic.cpp \ 880 880 common/asm/ASMBitNextSet-generic.cpp \ 881 common/asm/ASMMemZeroPage-generic.cpp \882 881 common/asm/ASMMemZero32-generic.cpp \ 883 882 common/asm/ASMMemFill32-generic.cpp \ … … 893 892 common/asm/ASMBitFirstSet-generic.cpp \ 894 893 common/asm/ASMBitNextSet-generic.cpp \ 895 common/asm/ASMMemZeroPage-generic.cpp \896 894 common/asm/ASMMemZero32-generic.cpp \ 897 895 common/asm/ASMMemFill32-generic.cpp \ -
trunk/src/VBox/Runtime/VBox/VBoxRTImp.def
r101349 r103014 81 81 ASMBitFirstSet ; not-amd64 not-x86 82 82 ASMBitNextSet ; not-amd64 not-x86 83 ASMMemZeroPage ; not-amd64 not-x8684 83 ASMMemZero32 ; not-amd64 not-x86 85 84 ASMMemFill32 ; not-amd64 not-x86 -
trunk/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp
r103013 r103014 2380 2380 DO_SIMPLE_TEST(ASMAtomicUoAndOrXorU64, uint64_t); 2381 2381 //DO_SIMPLE_TEST(ASMAtomicAndOrXorExU64, uint64_t); 2382 }2383 2384 2385 typedef struct2386 {2387 uint8_t ab[PAGE_SIZE];2388 } TSTPAGE;2389 2390 2391 DECLINLINE(void) tstASMMemZeroPageWorker(TSTPAGE *pPage)2392 {2393 for (unsigned j = 0; j < 16; j++)2394 {2395 memset(pPage, 0x11 * j, sizeof(*pPage));2396 ASMMemZeroPage(pPage);2397 for (unsigned i = 0; i < sizeof(pPage->ab); i++)2398 if (pPage->ab[i])2399 RTTestFailed(g_hTest, "ASMMemZeroPage didn't clear byte at offset %#x!\n", i);2400 if (ASMMemIsZero(pPage, RT_ASM_PAGE_SIZE) != true)2401 RTTestFailed(g_hTest, "ASMMemIsZero/RT_ASM_PAGE_SIZE returns false after ASMMemZeroPage!\n");2402 if (ASMMemFirstMismatchingU32(pPage, sizeof(pPage), 0) != NULL)2403 RTTestFailed(g_hTest, "ASMMemFirstMismatchingU32(,,0) returns non-NULL after ASMMemZeroPage!\n");2404 }2405 }2406 2407 2408 static void tstASMMemZeroPage(void)2409 {2410 RTTestISub("ASMMemZeroPage");2411 DO_SIMPLE_TEST_NO_SUB_NO_STACK(tstASMMemZeroPageWorker, TSTPAGE);2412 2382 } 2413 2383 … … 3297 3267 tstASMAtomicAndOrXor(); 3298 3268 3299 tstASMMemZeroPage();3300 3269 tstASMMemFirstMismatchingU8(g_hTest); 3301 3270 tstASMMemZero32(); -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r103005 r103014 5144 5144 /* paranoia, clear the shadow page. Remove this laser (i.e. let Alloc and ClearAll do it). */ 5145 5145 STAM_PROFILE_START(&pPool->StatZeroPage, z); 5146 ASMMemZeroPage(pvShw);5146 RT_BZERO(pvShw, PAGE_SIZE); 5147 5147 STAM_PROFILE_STOP(&pPool->StatZeroPage, z); 5148 5148 pPage->fZeroed = true; … … 5480 5480 STAM_PROFILE_START(&pPool->StatZeroPage, z); 5481 5481 void *pv = PGMPOOL_PAGE_2_PTR(pVM, pPage); 5482 ASMMemZeroPage(pv);5482 RT_BZERO(pv, PAGE_SIZE); 5483 5483 STAM_PROFILE_STOP(&pPool->StatZeroPage, z); 5484 5484 } -
trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
r103005 r103014 682 682 } 683 683 #endif 684 ASMMemZeroPage(pvShw);684 RT_BZERO(pvShw, PAGE_SIZE); 685 685 STAM_PROFILE_STOP(&pPool->StatZeroPage, z); 686 686 pPage->cPresent = 0;
Note:
See TracChangeset
for help on using the changeset viewer.

