From: john stultz <johnstul@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Darren Hart <dvhltc@us.ibm.com>,
Nishanth Aravamudan <nacc@us.ibm.com>,
Frank Sorenson <frank@tuxrocks.com>,
Thomas Gleixner <tglx@linutronix.de>,
George Anzinger <george@mvista.com>,
Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>,
Roman Zippel <zippel@linux-m68k.org>
Subject: [RFC][PATCH 5/11] generic timeofday i386 arch specific changes, part 1
Date: Thu, 29 Sep 2005 17:48:02 -0700 [thread overview]
Message-ID: <1128041282.8195.319.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <1128041188.8195.317.camel@cog.beaverton.ibm.com>
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the first of six, is just a simple
cleanup for the i386 arch in preparation of moving the the generic
timeofday infrastructure. It simply moves some code from timer_pit.c to
i8259.c.
It applies on top of my timeofday-core patch. This patch is part the
timeofday-arch-i386 patchset, so without the following parts it is not
expected to compile (although just this one should).
thanks
-john
i8259.c | 40 ++++++++++++++++++++++++++++++++++++++++
time.c | 1 -
timers/timer_pit.c | 13 -------------
3 files changed, 40 insertions(+), 14 deletions(-)
linux-2.6.14-rc2_timeofday-arch-i386-part1_B6.patch
============================================
diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
--- a/arch/i386/kernel/i8259.c
+++ b/arch/i386/kernel/i8259.c
@@ -23,6 +23,7 @@
#include <asm/apic.h>
#include <asm/arch_hooks.h>
#include <asm/i8259.h>
+#include <asm/i8253.h>
#include <io_ports.h>
@@ -396,6 +397,45 @@ void __init init_ISA_irqs (void)
}
}
+void setup_pit_timer(void)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&i8253_lock, flags);
+ outb_p(0x34,PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */
+ udelay(10);
+ outb_p(LATCH & 0xff , PIT_CH0); /* LSB */
+ udelay(10);
+ outb(LATCH >> 8 , PIT_CH0); /* MSB */
+ spin_unlock_irqrestore(&i8253_lock, flags);
+}
+
+static int timer_resume(struct sys_device *dev)
+{
+ setup_pit_timer();
+ return 0;
+}
+
+static struct sysdev_class timer_sysclass = {
+ set_kset_name("timer_pit"),
+ .resume = timer_resume,
+};
+
+static struct sys_device device_timer = {
+ .id = 0,
+ .cls = &timer_sysclass,
+};
+
+static int __init init_timer_sysfs(void)
+{
+ int error = sysdev_class_register(&timer_sysclass);
+ if (!error)
+ error = sysdev_register(&device_timer);
+ return error;
+}
+
+device_initcall(init_timer_sysfs);
+
void __init init_IRQ(void)
{
int i;
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -404,7 +404,6 @@ static int timer_resume(struct sys_devic
if (is_hpet_enabled())
hpet_reenable();
#endif
- setup_pit_timer();
sec = get_cmos_time() + clock_cmos_diff;
sleep_length = (get_cmos_time() - sleep_start) * HZ;
write_seqlock_irqsave(&xtime_lock, flags);
diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
--- a/arch/i386/kernel/timers/timer_pit.c
+++ b/arch/i386/kernel/timers/timer_pit.c
@@ -161,16 +161,3 @@ struct init_timer_opts __initdata timer_
.init = init_pit,
.opts = &timer_pit,
};
-
-void setup_pit_timer(void)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&i8253_lock, flags);
- outb_p(0x34,PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */
- udelay(10);
- outb_p(LATCH & 0xff , PIT_CH0); /* LSB */
- udelay(10);
- outb(LATCH >> 8 , PIT_CH0); /* MSB */
- spin_unlock_irqrestore(&i8253_lock, flags);
-}
next prev parent reply other threads:[~2005-09-30 0:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1128040851.8195.307.camel@cog.beaverton.ibm.com>
2005-09-30 0:42 ` [RFC][PATCH 1/11] Reduced NTP rework (part 1) john stultz
2005-09-30 0:44 ` [RFC][PATCH 2/11] Reduced NTP rework (part 2) john stultz
2005-09-30 0:45 ` [RFC][PATCH 3/11] timesource management code john stultz
2005-09-30 0:46 ` [PATCH 4/11] generic timeofday core subsystem john stultz
2005-09-30 0:48 ` john stultz [this message]
2005-09-30 0:49 ` [RFC][PATCH 6/11] generic timeofday i386 arch specific changes, part 2 john stultz
2005-09-30 0:49 ` [RFC][PATCH 7/11] generic timeofday i386 arch specific changes, part 3 john stultz
2005-09-30 0:50 ` [RFC][PATCH 8/11] generic timeofday i386 arch specific changes, part 4 john stultz
2005-09-30 0:51 ` [RFC][PATCH 9/11] generic timeofday i386 arch specific changes, part 5 john stultz
2005-09-30 0:52 ` [RFC][PATCH 10/11] generic timeofday i386 arch specific changes, part 6 john stultz
2005-09-30 0:53 ` [RFC][PATCH 11/11] generic timeofday i386 specific timesources john stultz
2005-09-30 1:02 ` [RFC][PATCH] Generic Timekeeping Rework (cumulative - bz'ed) (v. B6) john stultz
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=1128041282.8195.319.camel@cog.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=frank@tuxrocks.com \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nacc@us.ibm.com \
--cc=tglx@linutronix.de \
--cc=ulrich.windl@rz.uni-regensburg.de \
--cc=zippel@linux-m68k.org \
/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
all inboxes | Powered by JetHome®