VirtualBox

Changeset 7110 in vbox


Ignore:
Timestamp:
Feb 25, 2008 2:44:22 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28358
Message:

r=bird: The rate of the virtual clock is subject to change, don't assume 1GHz - use the new TMTimerSetNano for the CSR7 timer and convert the 2ms period for the other one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r7098 r7110  
    12451245    }
    12461246
    1247     if ((pData->aCSR[7] & 0x0C00) == 0x0C00)
     1247    if ((pData->aCSR[7] & 0x0C00) == 0x0C00) /* STINT + STINTE */
    12481248        iISR = 1;
    12491249
     
    23842384            /* Poll timer interval is fixed to 500Hz. Don't stop it. */
    23852385            TMTimerSet(pData->CTXSUFF(pTimerPoll),
    2386                        TMTimerGet(pData->CTXSUFF(pTimerPoll)) + 2000000);
     2386                       TMTimerGet(pData->CTXSUFF(pTimerPoll))
     2387                       + TMTimerFromMilli(pData->CTXSUFF(pTimerPoll), 2));
    23872388#endif
    23882389    }
     
    27182719            pData->aBCR[BCR_STVAL] = val;
    27192720            if (pData->fAm79C973)
    2720                 TMTimerSet(pData->CTXSUFF(pTimerSoftInt), (uint64_t)12800 * val);
     2721                TMTimerSetNano(pData->CTXSUFF(pTimerSoftInt), (uint64_t)12800 * val);
    27212722            break;
    27222723
     
    27932794        case 2:
    27942795            /* PHY identifier 1. */
    2795             val = 0x22;     /* Am79C874 PHY */ 
     2796            val = 0x22;     /* Am79C874 PHY */
    27962797            break;
    27972798
    27982799        case 3:
    27992800            /* PHY identifier 2. */
    2800             val = 0x561b;   /* Am79C874 PHY */ 
     2801            val = 0x561b;   /* Am79C874 PHY */
    28012802            break;
    28022803
     
    28062807#if 0
    28072808                // Advertising flow control is a) not the default, and b) confuses
    2808                 // the link speed detection routine in Windows PCnet driver 
     2809                // the link speed detection routine in Windows PCnet driver
    28092810                  | 0x0400  /* Try flow control. */
    28102811#endif
     
    34963497}
    34973498
     3499
    34983500/**
    34993501 * Software interrupt timer callback function.
     
    35073509    PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *);
    35083510
    3509     pData->aCSR[7] |= 0x0800;
     3511    pData->aCSR[7] |= 0x0800; /* STINT */
    35103512    pcnetUpdateIrq(pData);
    3511     TMTimerSet(pData->CTXSUFF(pTimerSoftInt), (uint64_t)12800 * (pData->aBCR[BCR_STVAL] & 0xffff));
     3513    TMTimerSetNano(pData->CTXSUFF(pTimerSoftInt), (uint64_t)12800 * (pData->aBCR[BCR_STVAL] & 0xffff));
    35123514}
    35133515
     
    44574459        /* Software Interrupt timer */
    44584460        rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimerSoftInt,
    4459                                    "PCNet SoftInt Timer", &pData->pTimerSoftIntHC);
     4461                                    "PCNet SoftInt Timer", &pData->pTimerSoftIntHC);
    44604462        if (VBOX_FAILURE(rc))
    44614463        {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette