VirtualBox

Changeset 19445 in vbox


Ignore:
Timestamp:
May 6, 2009 5:33:41 PM (16 years ago)
Author:
vboxsync
Message:

VMMAll.cpp: How to wake up a CPU (on SIPI), heed todos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/VMMAll.cpp

    r19437 r19445  
    7474
    7575
     76#ifdef IN_RING3
     77/**
     78 * On VCPU worker for VMMSendSipi.
     79 *
     80 * @param   pVM         The VM to operate on.
     81 * @param   idCpu       Virtual CPU to perform SIPI on
     82 * @param   iVector     SIPI vector
     83 */
     84DECLCALLBACK(int) vmmR3SendSipi(PVM pVM, VMCPUID idCpu, int iVector)
     85{
     86    PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     87    VMCPU_ASSERT_EMT(pVCpu);
     88
     89    /** @todo what are we supposed to do if the processor is already running? */
     90    VMCPU_ASSERT_STATE(pVCpu, VMCPUSTATE_STOPPED);
     91    VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED);
     92
     93    CPUMSetGuestCS(pVCpu, iVector * 0x100);
     94    CPUMSetGuestEIP(pVCpu, 0);
     95    return VINF_SUCCESS;
     96}
     97#endif /* IN_RING3 */
     98
     99
    76100/**
    77101 * Sends SIPI to the virtual CPU by setting CS:EIP into vector-dependent state
     
    82106 * @param   iVector     SIPI vector
    83107 */
    84 VMMDECL(void) VMMSendSipi(PVM pVM, VMCPUID idCpu, int iVector)
    85 {
    86     PVMCPU pCpu = VMMGetCpuById(pVM, idCpu);
    87     CPUMSetGuestCS(pCpu, iVector * 0x100);
    88     CPUMSetGuestEIP(pCpu, 0);
    89     /** @todo: how do I unhalt VCPU? */
    90 }
     108VMMDECL(void) VMMSendSipi(PVM pVM, VMCPUID idCpu, int iVector) /** @todo why is iVector signed? */
     109{
     110    AssertReturnVoid(idCpu < pVM->cCPUs);
     111
     112#ifdef IN_RING3
     113    PVMREQ pReq;
     114    int rc = VMR3ReqCallU(pVM->pUVM, idCpu, &pReq, RT_INDEFINITE_WAIT, 0,
     115                          (PFNRT)vmmR3SendSipi, 3, pVM, idCpu, iVector);
     116    AssertRC(rc);
     117    VMR3ReqFree(pReq);
     118#else
     119    AssertMsgFailed(("has to be done in ring-3, fix the code.\n"));
     120#endif
     121}
     122
    91123
    92124/**
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