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

« back to all changes in this revision

Viewing changes to src/VBox/VMM/VMMGC/PDMGCDevice.cpp

  • 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:
86
86
 * @{
87
87
 */
88
88
static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu);
89
 
static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
 
89
static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu);
90
90
static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
91
91
static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
92
92
static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns);
369
369
{
370
370
    PDMDEV_ASSERT_DEVINS(pDevIns);
371
371
    PVM pVM = pDevIns->Internal.s.pVMRC;
 
372
 
 
373
    if (pVM->pdm.s.Apic.pfnLocalInterruptRC)
 
374
    {
 
375
        LogFlow(("pdmRCPicHlp_SetInterruptFF: caller='%p'/%d: Setting local interrupt on LAPIC\n",
 
376
                 pDevIns, pDevIns->iInstance));
 
377
        /* Raise the LAPIC's LINT0 line instead of signaling the CPU directly. */
 
378
        pVM->pdm.s.Apic.pfnLocalInterruptRC(pVM->pdm.s.Apic.pDevInsRC, 0, 1);
 
379
        return;
 
380
    }
 
381
 
372
382
    PVMCPU pVCpu = &pVM->aCpus[0];  /* for PIC we always deliver to CPU 0, MP use APIC */
373
383
 
374
384
    LogFlow(("pdmRCPicHlp_SetInterruptFF: caller=%p/%d: VMMCPU_FF_INTERRUPT_PIC %d -> 1\n",
383
393
{
384
394
    PDMDEV_ASSERT_DEVINS(pDevIns);
385
395
    PVM pVM = pDevIns->Internal.s.CTX_SUFF(pVM);
 
396
 
 
397
    if (pVM->pdm.s.Apic.pfnLocalInterruptRC)
 
398
    {
 
399
        /* Raise the LAPIC's LINT0 line instead of signaling the CPU directly. */
 
400
        LogFlow(("pdmRCPicHlp_ClearInterruptFF: caller='%s'/%d: Clearing local interrupt on LAPIC\n",
 
401
                 pDevIns, pDevIns->iInstance));
 
402
        /* Lower the LAPIC's LINT0 line instead of signaling the CPU directly. */
 
403
        pVM->pdm.s.Apic.pfnLocalInterruptRC(pVM->pdm.s.Apic.pDevInsRC, 0, 0);
 
404
        return;
 
405
    }
 
406
 
386
407
    PVMCPU pVCpu = &pVM->aCpus[0];  /* for PIC we always deliver to CPU 0, MP use APIC */
387
408
 
388
409
    LogFlow(("pdmRCPicHlp_ClearInterruptFF: caller=%p/%d: VMCPU_FF_INTERRUPT_PIC %d -> 0\n",
417
438
    PVM pVM = pDevIns->Internal.s.pVMRC;
418
439
    PVMCPU pVCpu = &pVM->aCpus[idCpu];
419
440
 
420
 
    AssertReturnVoid(idCpu < pVM->cCPUs);
 
441
    AssertReturnVoid(idCpu < pVM->cCpus);
421
442
 
422
443
    LogFlow(("pdmRCApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
423
444
             pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INTERRUPT_APIC)));
432
453
        case PDMAPICIRQ_SMI:
433
454
            VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_SMI);
434
455
            break;
 
456
        case PDMAPICIRQ_EXTINT:
 
457
            VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_PIC);
 
458
            break;
435
459
        default:
436
460
            AssertMsgFailed(("enmType=%d\n", enmType));
437
461
            break;
440
464
 
441
465
 
442
466
/** @copydoc PDMAPICHLPRC::pfnClearInterruptFF */
443
 
static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu)
 
467
static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu)
444
468
{
445
469
    PDMDEV_ASSERT_DEVINS(pDevIns);
446
470
    PVM pVM = pDevIns->Internal.s.pVMRC;
447
471
    PVMCPU pVCpu = &pVM->aCpus[idCpu];
448
472
 
449
 
    AssertReturnVoid(idCpu < pVM->cCPUs);
 
473
    AssertReturnVoid(idCpu < pVM->cCpus);
450
474
 
451
475
    LogFlow(("pdmRCApicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 0\n",
452
476
             pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INTERRUPT_APIC)));
453
 
    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INTERRUPT_APIC);
 
477
 
 
478
    /* Note: NMI/SMI can't be cleared. */
 
479
    switch (enmType)
 
480
    {
 
481
        case PDMAPICIRQ_HARDWARE:
 
482
            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INTERRUPT_APIC);
 
483
            break;
 
484
        case PDMAPICIRQ_EXTINT:
 
485
            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INTERRUPT_PIC);
 
486
            break;
 
487
        default:
 
488
            AssertMsgFailed(("enmType=%d\n", enmType));
 
489
            break;
 
490
    }
454
491
}
455
492
 
456
493