Changeset 9186 in vbox
- Timestamp:
- May 28, 2008 2:05:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstInlineAsm.cpp
r9185 r9186 903 903 { 904 904 uint64_t u64Magic1; 905 uint8_t abPage[PAGE_SIZE ];905 uint8_t abPage[PAGE_SIZE - 32]; 906 906 uint64_t u64Magic2; 907 907 } Buf1, Buf2, Buf3; … … 916 916 memset(Buf3.abPage, 0x99, sizeof(Buf3.abPage)); 917 917 Buf3.u64Magic2 = UINT64_C(0xffffffffffffffff); 918 ASMMemZero32(Buf1.abPage, PAGE_SIZE);919 ASMMemZero32(Buf2.abPage, PAGE_SIZE);920 ASMMemZero32(Buf3.abPage, PAGE_SIZE);918 ASMMemZero32(Buf1.abPage, sizeof(Buf1.abPage)); 919 ASMMemZero32(Buf2.abPage, sizeof(Buf2.abPage)); 920 ASMMemZero32(Buf3.abPage, sizeof(Buf3.abPage)); 921 921 if ( Buf1.u64Magic1 != UINT64_C(0xffffffffffffffff) 922 922 || Buf1.u64Magic2 != UINT64_C(0xffffffffffffffff) … … 929 929 g_cErrors++; 930 930 } 931 for (unsigned i = 0; i < sizeof(Buf1.abPage); i++)931 for (unsigned i = 0; i < RT_ELEMENTS(Buf1.abPage); i++) 932 932 if (Buf1.abPage[i]) 933 933 { … … 935 935 g_cErrors++; 936 936 } 937 for (unsigned i = 0; i < sizeof(Buf2.abPage); i++) 938 if (Buf1.abPage[i]) 939 { 940 RTPrintf("tstInlineAsm: ASMMemZero32 didn't clear byte at offset %#x!\n", i); 941 g_cErrors++; 942 } 943 for (unsigned i = 0; i < sizeof(Buf3.abPage); i++) 937 for (unsigned i = 0; i < RT_ELEMENTS(Buf2.abPage); i++) 944 938 if (Buf2.abPage[i]) 945 939 { … … 947 941 g_cErrors++; 948 942 } 943 for (unsigned i = 0; i < RT_ELEMENTS(Buf3.abPage); i++) 944 if (Buf3.abPage[i]) 945 { 946 RTPrintf("tstInlineAsm: ASMMemZero32 didn't clear byte at offset %#x!\n", i); 947 g_cErrors++; 948 } 949 949 } 950 950 … … 957 957 uint32_t au32Page[PAGE_SIZE / 4]; 958 958 uint64_t u64Magic2; 959 } Buf1, Buf2, Buf3; 959 } Buf1; 960 struct 961 { 962 uint64_t u64Magic1; 963 uint32_t au32Page[(PAGE_SIZE / 4) - 3]; 964 uint64_t u64Magic2; 965 } Buf2; 966 struct 967 { 968 uint64_t u64Magic1; 969 uint32_t au32Page[(PAGE_SIZE / 4) - 1]; 970 uint64_t u64Magic2; 971 } Buf3; 960 972 961 973 Buf1.u64Magic1 = UINT64_C(0xffffffffffffffff); … … 968 980 memset(Buf3.au32Page, 0x99, sizeof(Buf3.au32Page)); 969 981 Buf3.u64Magic2 = UINT64_C(0xffffffffffffffff); 970 ASMMemFill32(Buf1.au32Page, PAGE_SIZE, 0xdeadbeef);971 ASMMemFill32(Buf2.au32Page, PAGE_SIZE, 0xcafeff01);972 ASMMemFill32(Buf3.au32Page, PAGE_SIZE, 0xf00dd00f);982 ASMMemFill32(Buf1.au32Page, sizeof(Buf1.au32Page), 0xdeadbeef); 983 ASMMemFill32(Buf2.au32Page, sizeof(Buf2.au32Page), 0xcafeff01); 984 ASMMemFill32(Buf3.au32Page, sizeof(Buf3.au32Page), 0xf00dd00f); 973 985 if ( Buf1.u64Magic1 != UINT64_C(0xffffffffffffffff) 974 986 || Buf1.u64Magic2 != UINT64_C(0xffffffffffffffff)
Note:
See TracChangeset
for help on using the changeset viewer.