linux-mips
[Top] [All Lists]

Re: 2.6.19 timer API changes

To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: 2.6.19 timer API changes
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Wed, 20 Dec 2006 18:48:12 +0300
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, danieljlaird@hotmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org, Vitaly Wool <vwool@ru.mvista.com>
In-reply-to: <458948C5.4050909@ru.mvista.com>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20061219.233410.25911550.anemo@mba.ocn.ne.jp> <20061220.000113.59033093.anemo@mba.ocn.ne.jp> <7949125.post@talk.nabble.com> <20061220.021508.97296486.anemo@mba.ocn.ne.jp> <458948C5.4050909@ru.mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
Hello, I wrote:

+
+static void pnx8550_timer_ack(void)
+{
+    write_c0_compare(cycles_per_jiffy);
+}
+
+static cycle_t pnx8550_hpt_read(void)
+{
+    /* FIXME: we should use timer2 or timer3 as freerun counter */
+    return read_c0_count();
+}

I'd suggest read_c0_count2() here, possibly adding an interrupt handler for it since it will interrupt upon hitting compare2 reg. value (but we could probably just mask the IRQ off), and enabling the timer 2, of course (the current code disables it)...

No, we'll have to handle IRQ it once the timer is enabled -- there seems to be no provision to mask it off other than disabling the timer.

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>