OSCR0似乎还有分配时间片的用途,以后再补充
//
// XllpOstDelayTicks
//
// Delay the number of ticks specified using the OST OSCR0 clock.
//
// Inputs:
// pOstRegs - handle to structure containing the OST a base register
// addresses.
// ticks - the unsigned 32-bit value containing the number of
// ticks to delay
//
static void XllpOstDelayTicks
(P_XLLP_OST_T pOstRegs, XLLP_UINT32_T ticks)
{
XLLP_UINT32_T expireTime,
time;
time = pOstRegs->oscr0;
expireTime = time + ticks;
//
// Check if we wrapped on the expireTime
// and delay first part until wrap
//
if (expireTime < time)
{
while (time < pOstRegs->oscr0);
}
while (pOstRegs->oscr0 <= expireTime);
return;
}