Changeset 73 in vbox
- Timestamp:
- Jan 16, 2007 5:25:59 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/include/VBox/hwacc_vmx.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/hwacc_vmx.h
r1 r73 697 697 * @param pVMXOn Physical address of VMXON structure 698 698 */ 699 #if RT_INLINE_ASM_EXTERNAL 699 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 700 700 DECLASM(int) VMXEnable(RTHCPHYS pVMXOn); 701 701 #else … … 750 750 * Executes VMXOFF 751 751 */ 752 #if RT_INLINE_ASM_EXTERNAL 752 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 753 753 DECLASM(void) VMXDisable(void); 754 754 #else … … 777 777 * @param pVMCS Physical address of VM control structure 778 778 */ 779 #if RT_INLINE_ASM_EXTERNAL 779 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 780 780 DECLASM(int) VMXClearVMCS(RTHCPHYS pVMCS); 781 781 #else … … 824 824 * @param pVMCS Physical address of VMCS structure 825 825 */ 826 #if RT_INLINE_ASM_EXTERNAL 826 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 827 827 DECLASM(int) VMXActivateVMCS(RTHCPHYS pVMCS); 828 828 #else … … 872 872 * @param u64Val 16, 32 or 64 bits value 873 873 */ 874 #if RT_INLINE_ASM_EXTERNAL875 874 DECLASM(int) VMXWriteVMCS64(uint32_t idxField, uint64_t u64Val); 876 #else877 DECLINLINE(int) VMXWriteVMCS64(uint32_t idxField, uint64_t u64Val)878 {879 int rc = VINF_SUCCESS;880 # if RT_INLINE_ASM_GNU_STYLE881 # if HC_ARCH_BITS == 64882 # error "todo"883 # endif884 # else885 __asm886 {887 push dword ptr [u64Val+4]888 push dword ptr [u64Val]889 mov eax, [idxField]890 _emit 0x0F891 _emit 0x79892 _emit 0x04893 _emit 0x24 /* VMWRITE eax, [esp] */894 jnc valid_vmcs895 mov dword ptr [rc], VERR_VMX_INVALID_VMCS_PTR896 jmp the_end897 898 valid_vmcs:899 jnz the_end900 mov dword ptr [rc], VERR_VMX_INVALID_VMCS_FIELD901 the_end:902 add esp, 8903 }904 # endif905 return rc;906 }907 #endif908 875 909 876 /** … … 914 881 * @param u32Val 32 bits value 915 882 */ 916 #if RT_INLINE_ASM_EXTERNAL 883 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 917 884 DECLASM(int) VMXWriteVMCS32(uint32_t idxField, uint32_t u32Val); 918 885 #else … … 973 940 * @param pData Ptr to store VM field value 974 941 */ 975 #if RT_INLINE_ASM_EXTERNAL976 942 DECLASM(int) VMXReadVMCS64(uint32_t idxField, uint64_t *pData); 977 #else978 DECLINLINE(int) VMXReadVMCS64(uint32_t idxField, uint64_t *pData)979 {980 int rc = VINF_SUCCESS;981 # if RT_INLINE_ASM_GNU_STYLE982 # if HC_ARCH_BITS == 64983 # error "todo"984 # endif985 # else986 __asm987 {988 sub esp, 8989 mov dword ptr [esp], 0990 mov dword ptr [esp+4], 0991 mov eax, [idxField]992 _emit 0x0F993 _emit 0x78994 _emit 0x04995 _emit 0x24 /* VMREAD eax, [esp] */996 mov edx, pData997 pop dword ptr [edx]998 pop dword ptr [edx+4]999 jnc valid_vmcs1000 mov dword ptr [rc], VERR_VMX_INVALID_VMCS_PTR1001 jmp the_end1002 1003 valid_vmcs:1004 jnz the_end1005 mov dword ptr [rc], VERR_VMX_INVALID_VMCS_FIELD1006 the_end:1007 }1008 # endif1009 return rc;1010 }1011 #endif1012 1013 943 1014 944 /** … … 1019 949 * @param pData Ptr to store VM field value 1020 950 */ 1021 #if RT_INLINE_ASM_EXTERNAL 951 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 1022 952 DECLASM(int) VMXReadVMCS32(uint32_t idxField, uint32_t *pData); 1023 953 #else … … 1094 1024 * @returns error value 1095 1025 */ 1096 uint32_t inline VMXGetLastError()1026 DECLINLINE(uint32_t) VMXGetLastError(void) 1097 1027 { 1028 #if HC_ARCH_BITS == 64 1029 uint64_t uLastError = 0; 1030 int rc = VMXReadVMCS(VMX_VMCS_RO_VM_INSTR_ERROR, &uLastError); 1031 AssertRC(rc); 1032 return (uint32_t)uLastError; 1033 1034 #else /* 32-bit host: */ 1098 1035 uint32_t lasterr = 0; 1099 1036 int rc; … … 1102 1039 AssertRC(rc); 1103 1040 return lasterr; 1041 #endif 1104 1042 } 1105 1043
Note:
See TracChangeset
for help on using the changeset viewer.

