VirtualBox

Changeset 14785 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Nov 28, 2008 3:11:20 PM (16 years ago)
Author:
vboxsync
Message:

More switcher updates

Location:
trunk/src/VBox/VMM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CPUMInternal.h

    r14411 r14785  
    361361    uint32_t                ulOffCPUM;
    362362
    363     /* Round to 16 byte size. */
     363    /* Temporary storage for the return code of the function called in the 32-64 switcher. */
     364    uint32_t                u32RetCode;
     365
     366    /* Round to 16 byte size.
    364367    uint32_t                uPadding;
     368     */
    365369} CPUMCPU, *PCPUMCPU;
    366370/** Pointer to the CPUMCPU instance data residing in the shared VMCPU structure. */
  • trunk/src/VBox/VMM/CPUMInternal.mac

    r14411 r14785  
    407407    .fChanged             resd    1
    408408    .ulOffCPUM            resd    1
    409     .uPadding             resd    1   
     409    .u32RetCode           resd    1   
    410410endstruc
    411411
  • trunk/src/VBox/VMM/Makefile.kmk

    r14766 r14785  
    336336        VMMAll/CPUMAllA.asm \
    337337        VMMAll/DBGFAll.cpp \
     338        VMMGC/HWACCMGCA.asm \
    338339        VMMAll/IOMAll.cpp \
    339340        VMMAll/IOMAllMMIO.cpp \
  • trunk/src/VBox/VMM/VMMGC/VMMGC.def

    r14042 r14785  
    6363    VMSetError
    6464    VMSetErrorV
     65    VMXGCStartVM64
     66    SVMGCVMRun64
    6567
    6668    ; runtime
  • trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac

    r14776 r14785  
    232232ALIGNCODE(16)
    233233GLOBALNAME ICEnterTarget     
    234     ; at this moment we're in 64-bit mode. let's write something to CPUM
    235234    ; Load CPUM pointer into rdx
    236235    mov     rdx, [NAME(pCpumIC) wrt rip]
    237     ; Load the CPUMCPU offset.
    238     mov     r8, [rdx + CPUM.ulOffCPUMCPU]
    239        
    240     mov rsi, 012345678h
    241     mov [rdx + r8 + CPUMCPU.uPadding], rsi
    242 
     236   
     237    mov     rax, cs
     238    mov     ds, rax
     239    mov     es, rax
     240    mov     fs, rax
     241    mov     gs, rax
     242   
     243    ; Setup stack; use the lss_esp, ss pair for lss
     244    DEBUG_CHAR('7')
     245    mov     rsp, 0
     246    mov     eax, [rdx + CPUM.Hyper.esp]
     247    mov     [rdx + CPUM.Hyper.lss_esp], eax
     248    lss     esp, [rdx + CPUM.Hyper.lss_esp]
     249
     250    ; call the hypervisor function with rdx=pCpumCpu
     251    mov     eax, [rdx + r8 + CPUM.Hyper.eip]
     252    CPUMCPU_FROM_CPUM(rdx)   
     253    call    rax
     254   
     255    ; Load CPUM pointer into rdx
     256    mov     rdx, [NAME(pCpumIC) wrt rip]
     257    CPUMCPU_FROM_CPUM(rdx)
     258   
     259    ; Save the return code
     260    mov     [rdx + CPUMCPU.u32RetCode], eax
     261   
    243262    ; now let's switch back
    244     mov     rax,  0666h
    245263    jmp     NAME(VMMGCGuestToHostAsm)   ; rax = returncode.
    246264
     
    439457
    440458    ; restore general registers.
    441     mov     eax, edi                    ; restore return code. eax = return code !!
    442459    mov     edi, [edx + CPUMCPU.Host.edi]
    443460    mov     esi, [edx + CPUMCPU.Host.esi]
    444461    mov     ebx, [edx + CPUMCPU.Host.ebx]
    445462    mov     ebp, [edx + CPUMCPU.Host.ebp]
     463
     464    ; store the return code in eax   
     465    mov     eax, [edx + CPUMCPU.u32RetCode]
     466   
    446467    push    dword [edx + CPUMCPU.Host.eflags]
    447468    popfd
    448469
    449 %ifdef DEBUG_STUFF
    450 ;    COM_S_CHAR '4'
    451 %endif
    452470    retf
    453471       
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette