Changeset 66174 in vbox
- Timestamp:
- Mar 21, 2017 10:20:57 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114086
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66172 r66174 1771 1771 1772 1772 1773 BS3_DECL_FAR(uint8_t) BS3_CMN_NM(Bs3Cg1Worker)(uint8_t bMode) 1774 { 1775 BS3CG1STATE ThisIsIt; 1776 PBS3CG1STATE pThis = &ThisIsIt; 1777 unsigned const iFirstRing = BS3_MODE_IS_V86(bMode) ? 3 : 0; 1778 uint8_t const cRings = BS3_MODE_IS_RM_OR_V86(bMode) ? 1 : 4; 1779 uint8_t iRing; 1780 unsigned iInstr; 1781 BS3MEMKIND const enmMemKind = BS3_MODE_IS_RM_OR_V86(bMode) ? BS3MEMKIND_REAL 1782 : !BS3_MODE_IS_64BIT_CODE(bMode) ? BS3MEMKIND_TILED : BS3MEMKIND_FLAT32; 1783 1784 #if 0 1785 if (bMode != BS3_MODE_PP16_V86) 1786 return BS3TESTDOMODE_SKIPPED; 1787 #endif 1788 1789 /* 1790 * Initalize the state. 1791 */ 1773 /** 1774 * Destroys the state, freeing all allocations and such. 1775 * 1776 * @param pThis The state. 1777 */ 1778 static void Bs3Cg1Destroy(PBS3CG1STATE pThis) 1779 { 1780 if (BS3_MODE_IS_PAGED(pThis->bMode)) 1781 { 1782 Bs3MemGuardedTestPageFree(pThis->pbCodePg); 1783 Bs3MemGuardedTestPageFree(pThis->pbDataPg); 1784 } 1785 else 1786 { 1787 Bs3MemFree(pThis->pbCodePg, X86_PAGE_SIZE); 1788 Bs3MemFree(pThis->pbDataPg, X86_PAGE_SIZE); 1789 } 1790 } 1791 1792 1793 /** 1794 * Initializes the state. 1795 * 1796 * @returns Success indicator (true/false) 1797 * @param pThis The state. 1798 * @param bMode The mode being tested. 1799 */ 1800 static bool Bs3Cg1Init(PBS3CG1STATE pThis, uint8_t bMode, uint8_t cRings, uint8_t iFirstRing) 1801 { 1802 BS3MEMKIND const enmMemKind = BS3_MODE_IS_RM_OR_V86(bMode) ? BS3MEMKIND_REAL 1803 : !BS3_MODE_IS_64BIT_CODE(bMode) ? BS3MEMKIND_TILED : BS3MEMKIND_FLAT32; 1804 unsigned iRing; 1805 1792 1806 Bs3MemSet(pThis, 0, sizeof(*pThis)); 1793 1807 … … 1887 1901 } 1888 1902 } 1903 1904 return true; 1905 } 1906 1907 1908 BS3_DECL_FAR(uint8_t) BS3_CMN_NM(Bs3Cg1Worker)(uint8_t bMode) 1909 { 1910 BS3CG1STATE ThisIsIt; 1911 PBS3CG1STATE pThis = &ThisIsIt; 1912 unsigned const iFirstRing = BS3_MODE_IS_V86(bMode) ? 3 : 0; 1913 uint8_t const cRings = BS3_MODE_IS_RM_OR_V86(bMode) ? 1 : 4; 1914 uint8_t iRing; 1915 unsigned iInstr; 1916 1917 #if 0 1918 if (bMode != BS3_MODE_PP16_V86) 1919 return BS3TESTDOMODE_SKIPPED; 1920 #endif 1921 1922 /* 1923 * Initalize the state. 1924 */ 1925 if (!Bs3Cg1Init(pThis, bMode, cRings, iFirstRing)) 1926 return 1; 1889 1927 1890 1928 /* … … 2043 2081 * Clean up. 2044 2082 */ 2045 if (BS3_MODE_IS_PAGED(bMode)) 2046 { 2047 Bs3MemGuardedTestPageFree(pThis->pbCodePg); 2048 Bs3MemGuardedTestPageFree(pThis->pbDataPg); 2049 } 2050 else 2051 { 2052 Bs3MemFree(pThis->pbCodePg, X86_PAGE_SIZE); 2053 Bs3MemFree(pThis->pbDataPg, X86_PAGE_SIZE); 2054 } 2055 2083 Bs3Cg1Destroy(pThis); 2056 2084 Bs3TestSubDone(); 2085 2057 2086 #if 0 2058 2087 if (bMode >= BS3_MODE_PE16_32)
Note:
See TracChangeset
for help on using the changeset viewer.