vbox的更動 12617 路徑 trunk/src/VBox/Devices/PC
- 時間撮記:
- 2008-9-20 下午05:18:44 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r12616 r12617 62 62 /** @def IOAPIC_UNLOCK 63 63 * Releases the PDM lock. This is a NOP if locking is disabled. */ 64 #define APIC_LOCK(pThis, rc) \65 do { \64 #define APIC_LOCK(pThis, rc) \ 65 do { \ 66 66 int rc2 = (pThis)->CTX_SUFF(pApicHlp)->pfnLock((pThis)->CTX_SUFF(pDevIns), rc); \ 67 if (rc2 != VINF_SUCCESS) \68 return rc2; \67 if (rc2 != VINF_SUCCESS) \ 68 return rc2; \ 69 69 } while (0) 70 #define APIC_UNLOCK(pThis) \ 70 #define APIC_LOCK_VOID(pThis, rc) \ 71 do { \ 72 int rc2 = (pThis)->CTX_SUFF(pApicHlp)->pfnLock((pThis)->CTX_SUFF(pDevIns), rc); \ 73 if (rc2 != VINF_SUCCESS) \ 74 return; \ 75 } while (0) 76 #define APIC_UNLOCK(pThis) \ 71 77 (pThis)->CTX_SUFF(pApicHlp)->pfnUnlock((pThis)->CTX_SUFF(pDevIns)) 72 78 #define IOAPIC_LOCK(pThis, rc) \ … … 447 453 APICState *s = getLapic(dev); 448 454 Log(("cpu_set_apic_base: %016RX64\n", val)); 449 455 456 /** @todo: do we need to lock here ? */ 457 /* APIC_LOCK_VOID(dev, VERR_INTERNAL_ERROR); */ 450 458 /** @todo If this change is valid immediately, then we should change the MMIO registration! */ 451 459 s->apicbase = (val & 0xfffff000) | … … 460 468 dev->CTX_SUFF(pApicHlp)->pfnChangeFeature(pDevIns, false); 461 469 } 470 /* APIC_UNLOCK(dev); */ 462 471 } 463 472 #endif /* VBOX */ … … 648 657 return false; 649 658 APICState *s = getLapic(dev); 650 659 660 /* 661 * All our callbacks now come from single IOAPIC, thus locking 662 * seems to be excessive now (@todo: check) 663 */ 651 664 irrv = get_highest_priority_int(s->irr); 652 665 if (irrv < 0) … … 654 667 655 668 ppr = apic_get_ppr_zero_tpr(s); 669 656 670 if (ppr && (irrv & 0xf0) <= (ppr & 0xf0)) 657 671 return false; … … 871 885 } 872 886 873 #ifndef VBOX 874 int apic_get_interrupt(CPUState *env) 875 { 876 APICState *s = env->apic_state; 877 #else /* VBOX */ 887 878 888 PDMBOTHCBDECL(int) apicGetInterrupt(PPDMDEVINS pDevIns) 879 889 { 880 890 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 881 APICState *s = getLapic(dev);882 #endif /* VBOX */883 int intno;884 885 891 /* if the APIC is not installed or enabled, we let the 8259 handle the 886 892 IRQs */ 887 if (!s) { 893 if (!dev) 894 { 888 895 Log(("apic_get_interrupt: returns -1 (!s)\n")); 889 896 return -1; 890 897 } 898 899 APIC_LOCK(dev, VERR_INTERNAL_ERROR); 900 901 APICState *s = getLapic(dev); 902 int intno; 903 891 904 if (!(s->spurious_vec & APIC_SV_ENABLE)) { 892 905 Log(("apic_get_interrupt: returns -1 (APIC_SV_ENABLE)\n")); … … 908 921 apic_update_irq(dev, s); 909 922 LogFlow(("apic_get_interrupt: returns %d\n", intno)); 923 APIC_UNLOCK(dev); 910 924 return intno; 911 925 } … … 975 989 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 976 990 APICState *s = getLapic(dev); 977 dev->pApicHlpR3->pfnLock(pDevIns, VERR_INTERNAL_ERROR); 991 992 APIC_LOCK_VOID(dev, VERR_INTERNAL_ERROR); 978 993 #endif /* VBOX */ 979 994 … … 1772 1787 APICState *s = getLapic(dev); 1773 1788 1774 dev->pApicHlpR3->pfnLock(pDevIns, VERR_INTERNAL_ERROR);1789 APIC_LOCK_VOID(dev, VERR_INTERNAL_ERROR); 1775 1790 1776 1791 TMTimerStop(s->CTX_SUFF(pTimer)); … … 1794 1809 { 1795 1810 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 1796 1811 #ifdef VBOX_WITH_SMP_GUESTS 1812 LogRel(("[SMP]: relocate apic on %llx\n", offDelta)); 1813 #endif 1797 1814 dev->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 1798 1815 dev->pApicHlpRC = dev->pApicHlpR3->pfnGetRCHelpers(pDevIns); 1799 /** @todo: check if relocated pLapicsRC right */ 1800 dev->pLapicsRC = MMHyperR3ToR0(PDMDevHlpGetVM(pDevIns), dev->pLapicsR3); 1816 /** @todo: write pLapicsRC relocation right */ 1817 #if 0 1818 if (dev->pLapicsRC) 1819 dev->pLapicsRC = MMHyperR3ToR0(PDMDevHlpGetVM(pDevIns), dev->pLapicsR3); 1820 #endif 1801 1821 foreach_apic(dev, 0xffffffff, 1802 1822 apic->pTimerRC = TMTimerRCPtr(apic->CTX_SUFF(pTimer)));
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器