From: Pavel Machek <pavel@ucw.cz>
To: torvalds@transmeta.com, kernel list <linux-kernel@vger.kernel.org>
Subject: devicefs support for system timer
Date: Sun, 1 Dec 2002 22:28:26 +0100 [thread overview]
Message-ID: <20021201212825.GA20073@elf.ucw.cz> (raw)
Hi!
Here it is; without this, time runs 50x too slow after resume, please
apply
Pavel
--- clean/arch/i386/kernel/i8259.c 2002-09-30 20:33:40.000000000 +0200
+++ linux-sensors/arch/i386/kernel/i8259.c 2002-12-01 22:26:19.000000000 +0100
@@ -367,6 +367,45 @@
}
}
+static void setup_timer(void)
+{
+ outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
+ udelay(10);
+ outb_p(LATCH & 0xff , 0x40); /* LSB */
+ udelay(10);
+ outb(LATCH >> 8 , 0x40); /* MSB */
+}
+
+static int timer_resume(struct device *dev, u32 level)
+{
+ if (level == RESUME_POWER_ON)
+ setup_timer();
+ return 0;
+}
+
+static struct device_driver timer_driver = {
+ .name = "timer",
+ .bus = &system_bus_type,
+ .resume = timer_resume,
+};
+
+static struct sys_device device_timer = {
+ .name = "timer",
+ .id = 0,
+ .dev = {
+ .name = "timer",
+ .driver = &timer_driver,
+ },
+};
+
+static int __init init_timer_devicefs(void)
+{
+ driver_register(&timer_driver);
+ return sys_device_register(&device_timer);
+}
+
+device_initcall(init_timer_devicefs);
+
void __init init_IRQ(void)
{
int i;
@@ -386,16 +425,15 @@
}
/* setup after call gates are initialised (usually add in
- * the architecture specific gates */
+ * the architecture specific gates)
+ */
intr_init_hook();
/*
* Set the clock to HZ Hz, we already have a valid
* vector now:
*/
- outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
- outb_p(LATCH & 0xff , 0x40); /* LSB */
- outb(LATCH >> 8 , 0x40); /* MSB */
+ setup_timer();
/*
* External FPU? Set up irq13 if so, for
--
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
reply other threads:[~2002-12-01 21:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021201212825.GA20073@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome