Changeset 19304 in vbox for trunk/include/VBox
- Timestamp:
- May 3, 2009 1:18:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/x86.h
r18763 r19304 1900 1900 1901 1901 /** 1902 * Descriptor attributes. 1903 */ 1904 typedef struct X86DESCATTRBITS 1905 { 1906 /** Segment Type. */ 1907 unsigned u4Type : 4; 1908 /** Descriptor Type. System(=0) or code/data selector */ 1909 unsigned u1DescType : 1; 1910 /** Descriptor Privelege level. */ 1911 unsigned u2Dpl : 2; 1912 /** Flags selector present(=1) or not. */ 1913 unsigned u1Present : 1; 1914 /** Segment limit 16-19. */ 1915 unsigned u4LimitHigh : 4; 1916 /** Available for system software. */ 1917 unsigned u1Available : 1; 1918 /** 32 bits mode: Reserved - 0, long mode: Long Attribute Bit. */ 1919 unsigned u1Long : 1; 1920 /** This flags meaning depends on the segment type. Try make sense out 1921 * of the intel manual yourself. */ 1922 unsigned u1DefBig : 1; 1923 /** Granularity of the limit. If set 4KB granularity is used, if 1924 * clear byte. */ 1925 unsigned u1Granularity : 1; 1926 } X86DESCATTRBITS; 1927 1928 1929 #pragma pack(1) 1930 typedef union X86DESCATTR 1931 { 1932 /** Unsigned integer view. */ 1933 uint32_t u; 1934 /** Normal view. */ 1935 X86DESCATTRBITS n; 1936 } X86DESCATTR; 1937 #pragma pack() 1938 /** Pointer to descriptor attributes. */ 1939 typedef X86DESCATTR *PX86DESCATTR; 1940 /** Pointer to const descriptor attributes. */ 1941 typedef const X86DESCATTR *PCX86DESCATTR; 1942 1943 1944 /** 1902 1945 * Generic descriptor table entry 1903 1946 */ … … 1908 1951 unsigned u16LimitLow : 16; 1909 1952 /** Base address - lowe word. 1910 * Don't try set this to 24 because MSC is doing stu dingthings then. */1953 * Don't try set this to 24 because MSC is doing stupid things then. */ 1911 1954 unsigned u16BaseLow : 16; 1912 1955 /** Base address - first 8 bits of high word. */ … … 1941 1984 typedef const X86DESCGENERIC *PCX86DESCGENERIC; 1942 1985 1943 1944 /** 1945 * Descriptor attributes. 1946 */ 1947 typedef struct X86DESCATTRBITS 1948 { 1986 /** 1987 * Call-, Interrupt-, Trap- or Task-gate descriptor (legacy). 1988 */ 1989 typedef struct X86DESCGATE 1990 { 1991 /** Target code segment offset - Low word. 1992 * Ignored if task-gate. */ 1993 unsigned u16OffsetLow : 16; 1994 /** Target code segment selector for call-, interrupt- and trap-gates, 1995 * TSS selector if task-gate. */ 1996 unsigned u16Sel : 16; 1997 /** Number of parameters for a call-gate. 1998 * Ignored if interrupt-, trap- or task-gate. */ 1999 unsigned u4ParmCount : 4; 2000 /** Reserved / ignored. */ 2001 unsigned u4Reserved : 4; 1949 2002 /** Segment Type. */ 1950 2003 unsigned u4Type : 4; 1951 /** Descriptor Type . System(=0) or code/data selector*/2004 /** Descriptor Type (0 = system). */ 1952 2005 unsigned u1DescType : 1; 1953 2006 /** Descriptor Privelege level. */ … … 1955 2008 /** Flags selector present(=1) or not. */ 1956 2009 unsigned u1Present : 1; 1957 /** Segment limit 16-19. */ 1958 unsigned u4LimitHigh : 4; 1959 /** Available for system software. */ 1960 unsigned u1Available : 1; 1961 /** 32 bits mode: Reserved - 0, long mode: Long Attribute Bit. */ 1962 unsigned u1Long : 1; 1963 /** This flags meaning depends on the segment type. Try make sense out 1964 * of the intel manual yourself. */ 1965 unsigned u1DefBig : 1; 1966 /** Granularity of the limit. If set 4KB granularity is used, if 1967 * clear byte. */ 1968 unsigned u1Granularity : 1; 1969 } X86DESCATTRBITS; 1970 1971 1972 #pragma pack(1) 1973 typedef union X86DESCATTR 1974 { 1975 /** Unsigned integer view. */ 1976 uint32_t u; 1977 /** Normal view. */ 1978 X86DESCATTRBITS n; 1979 } X86DESCATTR; 1980 #pragma pack() 1981 1982 /** Pointer to descriptor attributes. */ 1983 typedef X86DESCATTR *PX86DESCATTR; 1984 /** Pointer to const descriptor attributes. */ 1985 typedef const X86DESCATTR *PCX86DESCATTR; 1986 2010 /** Target code segment offset - High word. 2011 * Ignored if task-gate. */ 2012 unsigned u16OffsetHigh : 16; 2013 } X86DESCGATE; 2014 AssertCompileSize(X86DESCGATE, 8); 2015 /** Pointer to a Call-, Interrupt-, Trap- or Task-gate descriptor entry. */ 2016 typedef X86DESCGATE *PX86DESCGATE; 2017 /** Pointer to a const Call-, Interrupt-, Trap- or Task-gate descriptor entry. */ 2018 typedef const X86DESCGATE *PCX86DESCGATE; 1987 2019 1988 2020 /** … … 1994 2026 /** Generic descriptor view. */ 1995 2027 X86DESCGENERIC Gen; 1996 #if 0 1997 /** IDT view. */ 1998 VBOXIDTE Idt; 1999 #endif 2028 /** Gate descriptor view. */ 2029 X86DESCGATE Gate; 2000 2030 2001 2031 /** 8 bit unsigned interger view. */ … … 2006 2036 uint32_t au32[2]; 2007 2037 } X86DESC; 2038 AssertCompileSize(X86DESC, 8); 2008 2039 #pragma pack() 2009 2040 /** Pointer to descriptor table entry. */ … … 2012 2043 typedef const X86DESC *PCX86DESC; 2013 2044 2014 2015 2045 /** @def X86DESC_BASE 2016 2046 * Return the base address of a descriptor. … … 2038 2068 unsigned u16LimitLow : 16; 2039 2069 /** Base address - lowe word. - *IGNORED* 2040 * Don't try set this to 24 because MSC is doing stu dingthings then. */2070 * Don't try set this to 24 because MSC is doing stupid things then. */ 2041 2071 unsigned u16BaseLow : 16; 2042 2072 /** Base address - first 8 bits of high word. - *IGNORED* */ … … 2078 2108 /** 2079 2109 * System descriptor table entry (64 bits) 2110 * 2111 * @remarks This is, save a couple of comments, identical to X86DESC64GENERIC... 2080 2112 */ 2081 2113 #pragma pack(1) … … 2085 2117 unsigned u16LimitLow : 16; 2086 2118 /** Base address - lowe word. 2087 * Don't try set this to 24 because MSC is doing stu dingthings then. */2119 * Don't try set this to 24 because MSC is doing stupid things then. */ 2088 2120 unsigned u16BaseLow : 16; 2089 2121 /** Base address - first 8 bits of high word. */ … … 2118 2150 } X86DESC64SYSTEM; 2119 2151 #pragma pack() 2120 /** Pointer to a genericdescriptor entry. */2152 /** Pointer to a system descriptor entry. */ 2121 2153 typedef X86DESC64SYSTEM *PX86DESC64SYSTEM; 2122 /** Pointer to a const genericdescriptor entry. */2154 /** Pointer to a const system descriptor entry. */ 2123 2155 typedef const X86DESC64SYSTEM *PCX86DESC64SYSTEM; 2156 2157 /** 2158 * Call-, Interrupt-, Trap- or Task-gate descriptor (64-bit). 2159 */ 2160 typedef struct X86DESC64GATE 2161 { 2162 /** Target code segment offset - Low word. */ 2163 unsigned u16OffsetLow : 16; 2164 /** Target code segment selector. */ 2165 unsigned u16Sel : 16; 2166 /** Interrupt stack table for interrupt- and trap-gates. 2167 * Ignored by call-gates. */ 2168 unsigned u3IST : 3; 2169 /** Reserved / ignored. */ 2170 unsigned u5Reserved : 5; 2171 /** Segment Type. */ 2172 unsigned u4Type : 4; 2173 /** Descriptor Type (0 = system). */ 2174 unsigned u1DescType : 1; 2175 /** Descriptor Privelege level. */ 2176 unsigned u2Dpl : 2; 2177 /** Flags selector present(=1) or not. */ 2178 unsigned u1Present : 1; 2179 /** Target code segment offset - High word. 2180 * Ignored if task-gate. */ 2181 unsigned u16OffsetHigh : 16; 2182 /** Target code segment offset - Top dword. 2183 * Ignored if task-gate. */ 2184 unsigned u32OffsetTop : 32; 2185 /** Reserved / ignored / must be zero. 2186 * For call-gates bits 8 thru 12 must be zero, the other gates ignores this. */ 2187 unsigned u32Reserved : 32; 2188 } X86DESC64GATE; 2189 AssertCompileSize(X86DESC64GATE, 16); 2190 /** Pointer to a Call-, Interrupt-, Trap- or Task-gate descriptor entry. */ 2191 typedef X86DESC64GATE *PX86DESC64GATE; 2192 /** Pointer to a const Call-, Interrupt-, Trap- or Task-gate descriptor entry. */ 2193 typedef const X86DESC64GATE *PCX86DESC64GATE; 2124 2194 2125 2195 … … 2134 2204 /** System descriptor view. */ 2135 2205 X86DESC64SYSTEM System; 2136 #if 0 2206 /** Gate descriptor view. */ 2137 2207 X86DESC64GATE Gate; 2138 #endif2139 2208 2140 2209 /** 8 bit unsigned interger view. */ … … 2147 2216 uint64_t au64[2]; 2148 2217 } X86DESC64; 2218 AssertCompileSize(X86DESC64, 16); 2149 2219 #pragma pack() 2150 2220 /** Pointer to descriptor table entry. */ … … 2161 2231 #endif 2162 2232 2163 /** @def X86DESC _LIMIT2233 /** @def X86DESC64_BASE 2164 2234 * Return the base of a 64-bit descriptor. 2165 2235 */
Note:
See TracChangeset
for help on using the changeset viewer.