Line 64... |
Line 64... |
cpu_state.sprs[SPR_TTMR] = 0;
|
cpu_state.sprs[SPR_TTMR] = 0;
|
tick_count = 0;
|
tick_count = 0;
|
}
|
}
|
|
|
/* Raises a timer exception */
|
/* Raises a timer exception */
|
void tick_raise_except(void *dat)
|
static void tick_raise_except(void *dat)
|
{
|
{
|
cpu_state.sprs[SPR_TTMR] |= SPR_TTMR_IP;
|
cpu_state.sprs[SPR_TTMR] |= SPR_TTMR_IP;
|
|
|
/* Reschedule unconditionally, since we have to raise the exception until
|
/* Reschedule unconditionally, since we have to raise the exception until
|
* TTMR_IP has been cleared */
|
* TTMR_IP has been cleared */
|
Line 78... |
Line 78... |
if(cpu_state.sprs[SPR_SR] & SPR_SR_TEE)
|
if(cpu_state.sprs[SPR_SR] & SPR_SR_TEE)
|
except_handle(EXCEPT_TICK, cpu_state.sprs[SPR_EEAR_BASE]);
|
except_handle(EXCEPT_TICK, cpu_state.sprs[SPR_EEAR_BASE]);
|
}
|
}
|
|
|
/* Restarts the tick timer */
|
/* Restarts the tick timer */
|
void tick_restart(void *dat)
|
static void tick_restart(void *dat)
|
{
|
{
|
cpu_state.sprs[SPR_TTCR] = 0;
|
cpu_state.sprs[SPR_TTCR] = 0;
|
cycles_start = runtime.sim.cycles;
|
cycles_start = runtime.sim.cycles;
|
TRACE("Scheduleing timer restart job for %"PRIdREG"\n",
|
TRACE("Scheduleing timer restart job for %"PRIdREG"\n",
|
cpu_state.sprs[SPR_TTMR] & SPR_TTMR_PERIOD);
|
cpu_state.sprs[SPR_TTMR] & SPR_TTMR_PERIOD);
|
SCHED_ADD(tick_restart, NULL, cpu_state.sprs[SPR_TTMR] & SPR_TTMR_PERIOD);
|
SCHED_ADD(tick_restart, NULL, cpu_state.sprs[SPR_TTMR] & SPR_TTMR_PERIOD);
|
}
|
}
|
|
|
/* Stops the timer */
|
/* Stops the timer */
|
void tick_one_shot(void *dat)
|
static void tick_one_shot(void *dat)
|
{
|
{
|
TRACE("Stopping one-shot timer\n");
|
TRACE("Stopping one-shot timer\n");
|
cpu_state.sprs[SPR_TTCR] = cpu_state.sprs[SPR_TTMR] & SPR_TTMR_PERIOD;
|
cpu_state.sprs[SPR_TTCR] = cpu_state.sprs[SPR_TTMR] & SPR_TTMR_PERIOD;
|
tick_count = 0;
|
tick_count = 0;
|
}
|
}
|