Changeset 64735 in vbox for trunk/src/VBox/ValidationKit/bootsectors
- Timestamp:
- Nov 22, 2016 9:14:13 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-pf.c32
r64704 r64735 30 30 *********************************************************************************************************************************/ 31 31 #include <bs3kit.h> 32 #include <iprt/asm-amd64-x86.h>33 32 34 33 … … 39 38 40 39 40 /** 41 * Worker for bs3CpuBasic2_RaiseXcpt0e_c32 that does the actual testing. 42 * 43 * Caller does all the cleaning up. 44 * 45 * @returns Error count. 46 * @param bMode The mode to test. 47 * @param pbTestOrg Pointer to the actual memory allocation (low 48 * memory) where it is identity mapped (virtual 49 * address == physical address). This function 50 * will not touch paging structures here. 51 * @param pbTest Pointer to the aliased allocation in high 52 * memory. This is aligned on a gigabyte boundrary 53 * so that 1GB pages can be tested (later). 54 * @param cbTest The size of the memory allocated for testing. 55 * @param pPgInfo The paging info for @a pbTest. 56 */ 57 static uint8_t bs3CpuBasic2_RaiseXcpt0eWorker(uint8_t bMode, uint8_t *pbTestOrg, uint8_t *pbTest, uint32_t cbTest, 58 PBS3PAGINGINFO4ADDR pPgInfo) 59 { 60 61 62 return 0; 63 } 41 64 42 65 … … 48 71 uint8_t *pbTest; 49 72 uint8_t *pbAlias; 73 uint8_t bRet = 1; 50 74 int rc; 51 75 … … 58 82 { 59 83 cbTestUnaligned >>= 1; 60 if (cbTestUnaligned < _8K)84 if (cbTestUnaligned <= _8K) 61 85 { 62 86 Bs3TestFailed("Failed to allocate memory to play around with\n"); … … 79 103 * Alias this memory far away from where our code and data lives. 80 104 */ 81 pbAlias = (uint8_t *)UINT32_C(0x a0000000);105 pbAlias = (uint8_t *)UINT32_C(0x80000000); 82 106 rc = Bs3PagingAlias((uintptr_t)pbAlias, (uintptr_t)pbTest, cbTest, X86_PTE_P | X86_PTE_RW | X86_PTE_US); 83 107 if (RT_SUCCESS(rc)) 84 108 { 85 void *pvPte = Bs3PagingGetPte((uintptr_t)pbAlias, NULL); 86 if (pvPte) 109 BS3PAGINGINFO4ADDR PgInfo; 110 rc = Bs3PagingQueryAddressInfo((uintptr_t)pbTest, &PgInfo); 111 if (RT_SUCCESS(rc)) 87 112 { 88 Bs3TestPrintf("RaiseXcpt0e_c32: bMode=%#x/%#x cbTest=%#x pbTest=%p pbAlias=%p pvPte=%p\n", 89 bMode, g_bBs3CurrentMode, cbTest, pbTest, pbAlias, pvPte); 113 /* 114 * Setup a 16-bit selector for accessing the alias. 115 */ 116 // ==> office // 117 118 Bs3TestPrintf("RaiseXcpt0e_c32: bMode=%#x/%#x cbTest=%#x pbTest=%p pbAlias=%p\n", 119 bMode, g_bBs3CurrentMode, cbTest, pbTest, pbAlias); 120 bRet = bs3CpuBasic2_RaiseXcpt0eWorker(bMode, pbTest, pbAlias, cbTest, &PgInfo); 90 121 91 122 } 92 123 else 93 Bs3TestFailed ("Bs3PagingGetPte failed!\n");124 Bs3TestFailedF("Bs3PagingQueryAddressInfo failed: %d\n", rc); 94 125 Bs3PagingUnalias((uintptr_t)pbAlias, cbTest); 95 126 } … … 97 128 Bs3TestFailedF("Bs3PagingAlias failed! rc=%d\n", rc); 98 129 Bs3MemFree(pvTestUnaligned, cbTestUnaligned); 99 return 0;130 return bRet; 100 131 } 101 132 102
Note:
See TracChangeset
for help on using the changeset viewer.