Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

DECLINLINE ( int   ) 

Executes VMXON

Returns:
VBox status code
Parameters:
pVMXOn Physical address of VMXON structure
Executes VMCLEAR

Returns:
VBox status code
Parameters:
pVMCS Physical address of VM control structure
Executes VMPTRLD

Returns:
VBox status code
Parameters:
pVMCS Physical address of VMCS structure
Executes VMWRITE

Returns:
VBox status code
Parameters:
idxField VMCS index
u32Val 32 bits value
Executes VMREAD

Returns:
VBox status code
Parameters:
idxField VMCS index
pData Ptr to store VM field value

Definition at line 1221 of file hwacc_vmx.h.

References VERR_VMX_GENERIC, VERR_VMX_INVALID_VMXON_PTR, and VINF_SUCCESS.

{
    int rc = VINF_SUCCESS;
# if RT_INLINE_ASM_GNU_STYLE
    __asm__ __volatile__ (
       "push     %3                                             \n\t"
       "push     %2                                             \n\t"
       ".byte    0xF3, 0x0F, 0xC7, 0x34, 0x24  # VMXON [esp]    \n\t"
       "ja       2f                                             \n\t"
       "je       1f                                             \n\t"
       "movl     $"STR(VERR_VMX_INVALID_VMXON_PTR)", %0         \n\t"
       "jmp      2f                                             \n\t"
       "1:                                                      \n\t"
       "movl     $"STR(VERR_VMX_GENERIC)", %0                   \n\t"
       "2:                                                      \n\t"
       "add      $8, %%esp                                      \n\t"
       :"=rm"(rc)
       :"0"(VINF_SUCCESS),
        "ir"((uint32_t)pVMXOn),        /* don't allow direct memory reference here, */
        "ir"((uint32_t)(pVMXOn >> 32)) /* this would not work with -fomit-frame-pointer */
       :"memory"
       );
# else
    __asm
    {
        push    dword ptr [pVMXOn+4]
        push    dword ptr [pVMXOn]
        _emit   0xF3
        _emit   0x0F
        _emit   0xC7
        _emit   0x34
        _emit   0x24     /* VMXON [esp] */
        jnc     vmxon_good
        mov     dword ptr [rc], VERR_VMX_INVALID_VMXON_PTR
        jmp     the_end

vmxon_good:
        jnz     the_end
        mov     dword ptr [rc], VERR_VMX_GENERIC
the_end:
        add     esp, 8
    }
# endif
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index