User’s Manual
Preliminary
PPC440x5 CPU Core
timers.fm.
September 12, 2002
Page 211 of 589
lwz
Ry, lower
li
Rz, 0
# set GPR Rz to 0
mtspr
TBL,Rz
# force TBL to 0 (thereby preventing wrap into TBU)
mtspr
TBU,Rx
# set TBU to initial value
mtspr
TBL,Ry
# set TBL to initial value
7.2 Decrementer (DEC)
The DEC is a 32-bit privileged SPR that decrements at the same rate that the time base increments. The
DEC is read and written using
mfspr and mtspr, respectively. When a non-zero value is written to the DEC,
it begins to decrement with the next time base clock. A Decrementer exception is signalled when a decrement
occurs on a DEC count of 1, and the Decrementer Interrupt Status field of the Timer Status Register
(TSR[DIS]; see Page 216) is set. A Decrementer interrupt will occur if it is enabled by both the Decrementer
Interrupt Enable field of the Timer Control Register (TCR[DIE]; see Page 215) and by the External Interrupt
Enable field of the Machine State Register (MSR[EE]; see Machine State Register (MSR) on page 165).
Interrupts and Exceptions on page 159 provides more information on the handling of Decrementer interrupts.
The Decrementer interrupt handler software should clear TSR[DIS] before re-enabling MSR[EE], in order to
avoid another Decrementer interrupt due to the same exception (unless TCR[DIE] is cleared instead).
The behavior of the DEC itself upon a decrement from a DEC value of 1 depends on which of two modes it is
operating in -- normal, or auto-reload. The mode is controlled by the Auto-Reload Enable (ARE) field of the
TCR. When operating in normal mode (TCR[ARE]=0), the DEC simply decrements to the value 0 and then
stops decrementing until it is re-initialized by software.
When operating in auto-reload mode (TCR[ARE]=1), however, instead of decrementing to the value 0, the
DEC is reloaded with the value in the Decrementer Auto-Reload (DECAR) register (see Figure 7-5 on
page 212), and continues to decrement with the next time base clock (assuming the DECAR value was non-
zero). The DECAR register is a 32-bit privileged, write-only SPR, and is written using
mtspr.
The auto-reload feature of the DEC is disabled upon reset, and must be enabled by software.
Figure 7-4 illustrates the DEC.
Figure 7-5 illustrates the DECAR.
Figure 7-4. Decrementer (DEC)
0:31
Decrement value
0
31
Содержание PPC440X5 CPU Core
Страница 1: ...PPC440x5 CPU Core User s Manual Preliminary SA14 2613 02 September 12 2002 Title Page...
Страница 22: ...User s Manual PPC440x5 CPU Core Preliminary Page 22 of 583 ppc440x5LOT fm September 12 2002...
Страница 26: ...User s Manual PPC440x5 CPU Core Preliminary Page 26 of 589 preface fm September 12 2002...
Страница 38: ...User s Manual PPC440x5 CPU Core Preliminary Page 38 of 589 overview fm September 12 2002...
Страница 94: ...User s Manual PPC440x5 CPU Core Preliminary Page 94 of 589 init fm September 12 2002...
Страница 132: ...User s Manual PPC440x5 CPU Core Preliminary Page 132 of 589 cache fm September 12 2002...
Страница 158: ...User s Manual PPC440x5 CPU Core Preliminary Page 158 of 589 mmu fm September 12 2002...
Страница 218: ...User s Manual PPC440x5 CPU Core Preliminary Page 218 of 589 timers fm September 12 2002...
Страница 248: ...User s Manual PPC440x5 CPU Core Preliminary Page 248 of 589 debug fm September 12 2002...
Страница 458: ...User s Manual PPC440x5 CPU Core Preliminary Page 458 of 589 regsummIntro fm September 12 2002...
Страница 568: ...User s Manual PPC440x5 CPU Core Preliminary Page 568 of 589 instalfa fm September 12 2002...
Страница 588: ...User s Manual PPC440x5 CPU Core Preliminary Page 588 of 583 ppc440x5IX fm September 12 2002...
Страница 590: ......