VirtualBox

Ticket #916: pit.patch

File pit.patch, 1.2 KB (added by Nikolay Igotti, 16 years ago)

PIT pacth to fix boot hang.

  • src/VBox/Devices/PC/DevPit-i8254.cpp

     
    177177    if (s->mode == 2)
    178178    {
    179179        if (s->u64NextTS == UINT64_MAX)
    180             return 1; /** @todo check this value. */
     180        {
     181            d = ASMMultU64ByU32DivByU32(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
     182            return s->count - (d % s->count); /** @todo check this value. */
     183        }
    181184        d = TMTimerGet(pTimer);
    182185        d = ASMMultU64ByU32DivByU32(d - s->u64ReloadTS, s->count, s->u64NextTS - s->u64ReloadTS);
    183186        if (d >= s->count)
    184187            return 1;
    185         return s->count - d;
     188        return  s->count - d;
    186189    }
    187190    d = ASMMultU64ByU32DivByU32(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
    188191    switch(s->mode) {
     
    865868        s->rw_mode = 0;
    866869        s->bcd = 0;
    867870#endif
     871        s->u64NextTS = UINT64_MAX;
    868872        s->cRelLogEntries = 0;
    869873        s->mode = 3;
    870874        s->gate = (i != 2);
     
    11011105
    11021106#endif /* IN_RING3 */
    11031107#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
    1104 

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy