Changeset 27226 in vbox
- Timestamp:
- Mar 9, 2010 5:33:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevHPET.cpp
r27126 r27226 37 37 * schedule interrupt earlier than in 1ms 38 38 * - statistics not implemented 39 * - level-triggered mode not implemented 39 40 */ 40 41 /* … … 87 88 #define HPET_CFG_WRITE_MASK 0x3 88 89 89 #define HPET_TN_ENABLE 0x004 90 #define HPET_TN_PERIODIC 0x008 91 #define HPET_TN_PERIODIC_CAP 0x010 92 #define HPET_TN_SIZE_CAP 0x020 93 #define HPET_TN_SETVAL 0x040 94 #define HPET_TN_32BIT 0x100 95 #define HPET_TN_INT_ROUTE_MASK 0x3e00 96 #define HPET_TN_CFG_WRITE_MASK 0x3f4e 97 #define HPET_TN_INT_ROUTE_SHIFT 9 98 #define HPET_TN_INT_ROUTE_CAP_SHIFT 32 90 #define HPET_TN_INT_TYPE (1 << 1) 91 #define HPET_TN_ENABLE (1 << 2) 92 #define HPET_TN_PERIODIC (1 << 3) 93 #define HPET_TN_PERIODIC_CAP (1 << 4) 94 #define HPET_TN_SIZE_CAP (1 << 5) 95 #define HPET_TN_SETVAL (1 << 6) 96 #define HPET_TN_32BIT (1 << 8) 97 #define HPET_TN_INT_ROUTE_MASK 0x3e00 98 #define HPET_TN_CFG_WRITE_MASK 0x3f4e 99 #define HPET_TN_INT_ROUTE_SHIFT 9 100 #define HPET_TN_INT_ROUTE_CAP_SHIFT 32 99 101 #define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U 100 102 … … 359 361 * PIT and RTC 360 362 */ 361 /*362 * nike: Linux refuses to boot with HPET, claiming that 8259 timer not363 * connected to IO-APIC, if we use IRQ2, so let's use IRQ0 for now.364 */365 363 if ((pTimer->u8TimerNumber <= 1) && 366 364 (pTimer->CTX_SUFF(pHpet)->u64Config & HPET_CFG_LEGACY)) … … 488 486 { 489 487 Log(("write HPET_TN_CFG: %d\n", iTimerNo)); 488 if (iNewValue & HPET_TN_32BIT) 489 { 490 pTimer->u64Cmp = (uint32_t)pTimer->u64Cmp; 491 pTimer->u64Period = (uint32_t)pTimer->u64Period; 492 } 493 if ((iNewValue & HPET_TN_INT_TYPE) == HPET_TIMER_TYPE_LEVEL) 494 { 495 LogRel(("level-triggered config not yet supported\n")); 496 Assert(false); 497 } 490 498 /** We only care about lower 32-bits so far */ 491 499 pTimer->u64Config = 492 500 updateMasked(iNewValue, iOldValue, HPET_TN_CFG_WRITE_MASK); 493 if (iNewValue & HPET_TN_32BIT)494 {495 pTimer->u64Cmp = (uint32_t)pTimer->u64Cmp;496 pTimer->u64Period = (uint32_t)pTimer->u64Period;497 }498 if (iNewValue & HPET_TIMER_TYPE_LEVEL)499 {500 LogRel(("level-triggered config not yet supported\n"));501 Assert(false);502 }503 501 break; 504 502 } … … 984 982 { 985 983 Log4(("HPET: raising IRQ %d\n", irq)); 986 if ((pTimer->u64Config & HPET_TIMER_TYPE_LEVEL) == 0) 987 { 984 985 /* ISR bits are only set in level-triggered mode */ 986 if ((pTimer->u64Config & HPET_TN_INT_TYPE) == HPET_TIMER_TYPE_LEVEL) 988 987 pThis->u64Isr |= (uint64_t)(1 << pTimer->u8TimerNumber); 988 989 /* We trigger flip/flop in edge-triggered mode and do nothing in level-triggered mode yet */ 990 if ((pTimer->u64Config & HPET_TN_INT_TYPE) == HPET_TIMER_TYPE_EDGE) 989 991 pThis->pHpetHlpR3->pfnSetIrq(pThis->CTX_SUFF(pDevIns), irq, PDM_IRQ_LEVEL_FLIP_FLOP); 990 }992 /* @todo: implement IRQs in level-triggered mode */ 991 993 } 992 994 } … … 1203 1205 1204 1206 /* Query configuration. */ 1205 #if 11207 #if 0 1206 1208 rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &fRCEnabled, true); 1207 1209 if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.