~ubuntu-branches/ubuntu/trusty/virtualbox-ose/trusty

« back to all changes in this revision

Viewing changes to src/recompiler/VBoxRecompiler.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
*   Internal Functions                                                         *
88
88
*******************************************************************************/
89
89
static DECLCALLBACK(int) remR3Save(PVM pVM, PSSMHANDLE pSSM);
90
 
static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u32Version);
 
90
static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
91
91
static void     remR3StateUpdate(PVM pVM, PVMCPU pVCpu);
92
92
static int      remR3InitPhysRamSizeAndDirtyMap(PVM pVM, bool fGuarded);
93
93
 
338
338
     * Register the saved state data unit.
339
339
     */
340
340
    rc = SSMR3RegisterInternal(pVM, "rem", 1, REM_SAVED_STATE_VERSION, sizeof(uint32_t) * 10,
 
341
                               NULL, NULL, NULL,
341
342
                               NULL, remR3Save, NULL,
342
343
                               NULL, remR3Load, NULL);
343
344
    if (RT_FAILURE(rc))
658
659
 * @returns VBox status code.
659
660
 * @param   pVM             VM Handle.
660
661
 * @param   pSSM            SSM operation handle.
661
 
 * @param   u32Version      Data layout version.
 
662
 * @param   uVersion        Data layout version.
 
663
 * @param   uPass           The data pass.
662
664
 */
663
 
static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u32Version)
 
665
static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
664
666
{
665
667
    uint32_t u32Dummy;
666
668
    uint32_t fRawRing0 = false;
667
669
    uint32_t u32Sep;
668
 
    unsigned i;
 
670
    uint32_t i;
669
671
    int rc;
670
672
    PREM pRem;
 
673
 
671
674
    LogFlow(("remR3Load:\n"));
 
675
    Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
672
676
 
673
677
    /*
674
678
     * Validate version.
675
679
     */
676
 
    if (    u32Version != REM_SAVED_STATE_VERSION
677
 
        &&  u32Version != REM_SAVED_STATE_VERSION_VER1_6)
 
680
    if (    uVersion != REM_SAVED_STATE_VERSION
 
681
        &&  uVersion != REM_SAVED_STATE_VERSION_VER1_6)
678
682
    {
679
 
        AssertMsgFailed(("remR3Load: Invalid version u32Version=%d!\n", u32Version));
 
683
        AssertMsgFailed(("remR3Load: Invalid version uVersion=%d!\n", uVersion));
680
684
        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
681
685
    }
682
686
 
698
702
    pRem = &pVM->rem.s;
699
703
    Assert(!pRem->fInREM);
700
704
    SSMR3GetU32(pSSM,   &pRem->Env.hflags);
701
 
    if (u32Version == REM_SAVED_STATE_VERSION_VER1_6)
 
705
    if (uVersion == REM_SAVED_STATE_VERSION_VER1_6)
702
706
    {
703
707
        /* Redundant REM CPU state has to be loaded, but can be ignored. */
704
708
        CPUX86State_Ver16 temp;
719
723
    if (fRawRing0)
720
724
        pRem->Env.state |= CPU_RAW_RING0;
721
725
 
722
 
    if (u32Version == REM_SAVED_STATE_VERSION_VER1_6)
 
726
    if (uVersion == REM_SAVED_STATE_VERSION_VER1_6)
723
727
    {
724
728
        /*
725
729
         * Load the REM stuff.
772
776
    /*
773
777
     * Sync the whole CPU state when executing code in the recompiler.
774
778
     */
775
 
    for (i=0;i<pVM->cCPUs;i++)
 
779
    for (i = 0; i < pVM->cCpus; i++)
776
780
    {
777
781
        PVMCPU pVCpu = &pVM->aCpus[i];
778
 
 
779
782
        CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_ALL);
780
783
    }
781
784
    return VINF_SUCCESS;
2822
2825
        } while (idxHead != UINT32_MAX);
2823
2826
 
2824
2827
#ifdef VBOX_STRICT
2825
 
        if (pVM->cCPUs == 1)
 
2828
        if (pVM->cCpus == 1)
2826
2829
        {
2827
2830
            /* Check that all records are now on the free list. */
2828
2831
            for (c = 0, idxNext = pVM->rem.s.idxFreeList; idxNext != UINT32_MAX;
3636
3639
 */
3637
3640
REMR3DECL(int) REMR3DisasEnableStepping(PVM pVM, bool fEnable)
3638
3641
{
3639
 
    PVMREQ  pReq;
3640
 
    int     rc;
 
3642
    int rc;
3641
3643
 
3642
3644
    LogFlow(("REMR3DisasEnableStepping: fEnable=%d\n", fEnable));
3643
3645
    if (VM_IS_EMT(pVM))
3644
3646
        return remR3DisasEnableStepping(pVM, fEnable);
3645
3647
 
3646
 
    rc = VMR3ReqCall(pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)remR3DisasEnableStepping, 2, pVM, fEnable);
 
3648
    rc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)remR3DisasEnableStepping, 2, pVM, fEnable);
3647
3649
    AssertRC(rc);
3648
 
    if (RT_SUCCESS(rc))
3649
 
        rc = pReq->iStatus;
3650
 
    VMR3ReqFree(pReq);
3651
3650
    return rc;
3652
3651
}
3653
3652
 
3845
3844
 */
3846
3845
const char *lookup_symbol(target_ulong orig_addr)
3847
3846
{
3848
 
    RTGCINTPTR off = 0;
3849
 
    DBGFSYMBOL Sym;
3850
 
    PVM pVM = cpu_single_env->pVM;
3851
 
    int rc = DBGFR3SymbolByAddr(pVM, orig_addr, &off, &Sym);
 
3847
    PVM         pVM = cpu_single_env->pVM;
 
3848
    RTGCINTPTR  off = 0;
 
3849
    RTDBGSYMBOL Sym;
 
3850
    DBGFADDRESS Addr;
 
3851
 
 
3852
    int rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_GLOBAL, DBGFR3AddrFromFlat(pVM, &Addr, orig_addr), &off, &Sym, NULL /*phMod*/);
3852
3853
    if (RT_SUCCESS(rc))
3853
3854
    {
3854
3855
        static char szSym[sizeof(Sym.szName) + 48];