All of lore.kernel.org
 help / color / mirror / Atom feed
* usage of disarm_decr[]
@ 2002-12-11 21:13 Xiaogeng (Shawn) Jin
  2002-12-11 21:29 ` Paul Mackerras
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaogeng (Shawn) Jin @ 2002-12-11 21:13 UTC (permalink / raw)
  To: linuxppc-embedded


disarm_decr[] is defined as an unsigned long array but never get
initialized in arch/ppc/kernel/time.c.

What's the purpose of using disarm_decr? I read the timer_interrupt()
code and found the only place where it's referenced.

int timer_interrupt(struct pt_regs * regs)
{
...
	if ( !disarm_decr[smp_processor_id()] )
		set_dec(next_dec);
	last_jiffy_stamp(cpu) = jiffy_stamp;
...
}

So in this case, the value of disarm_decr[] is always zero, right? Then
the decrementer get set each time when the timer interrupt is invoked.

--
Shawn Jin
RedSwitch Inc.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: usage of disarm_decr[]
  2002-12-11 21:13 usage of disarm_decr[] Xiaogeng (Shawn) Jin
@ 2002-12-11 21:29 ` Paul Mackerras
  2002-12-11 22:31   ` Xiaogeng (Shawn) Jin
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2002-12-11 21:29 UTC (permalink / raw)
  To: Xiaogeng (Shawn) Jin; +Cc: linuxppc-embedded


Xiaogeng (Shawn) Jin writes:

> What's the purpose of using disarm_decr? I read the timer_interrupt()
> code and found the only place where it's referenced.

RT-Linux (www.fsmlabs.com) uses it.  RT-Linux takes over all interrupt
handling, including decrementer interrupts, and the disarm_decr thing
is there to give RT-Linux a way to take control of the decrementer
register.

Paul.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: usage of disarm_decr[]
  2002-12-11 21:29 ` Paul Mackerras
@ 2002-12-11 22:31   ` Xiaogeng (Shawn) Jin
  0 siblings, 0 replies; 3+ messages in thread
From: Xiaogeng (Shawn) Jin @ 2002-12-11 22:31 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-embedded


Thank you. I have some further questions regarding to timer_interrupt().

How often is timer_interrupt() invoked? Every 1/HZ seconds? This is
controlled by the decrementer, right? Initially the value of the
decrementer is 'tb_ticks_per_jiffy'. Then it's updated in
timer_interrupt(). Why isn't 'next_dec' the initial value
'tb_ticks_per_jiffy'? It's due to the time drift caused by the accuracy
of external clock (oscillator) or by the precision of software?

	next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)

The timebase register is initialized to zero and then increments
periodically. How does it increment? Each clock (TMBCLK) the increment
is 1? by itself, I mean, hardware itself, or by software?

>>What's the purpose of using disarm_decr? I read the timer_interrupt()
>>code and found the only place where it's referenced.
>
> RT-Linux (www.fsmlabs.com) uses it.  RT-Linux takes over all interrupt
> handling, including decrementer interrupts, and the disarm_decr thing
> is there to give RT-Linux a way to take control of the decrementer
> register.

Thanks.

- Shawn.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-11 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-11 21:13 usage of disarm_decr[] Xiaogeng (Shawn) Jin
2002-12-11 21:29 ` Paul Mackerras
2002-12-11 22:31   ` Xiaogeng (Shawn) Jin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.