From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net,
Blaisorblade <blaisorblade@yahoo.it>,
"Christopher S. Aker" <caker@theshore.net>
Subject: [PATCH 2/6] UML - Fix wall_to_monotonic initialization
Date: Sat, 03 Jun 2006 22:16:13 -0400 [thread overview]
Message-ID: <200606040216.k542GDFU004832@ccure.user-mode-linux.org> (raw)
Initialize wall_to_monotonic correctly. This fixes a problem where sleeps
lasted about one secone less than they should.
This also called for a bit of code restructuring, following a patch which
Blaisorblade had been keeping.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: linux-2.6.17-mm/arch/um/os-Linux/time.c
===================================================================
--- linux-2.6.17-mm.orig/arch/um/os-Linux/time.c 2006-06-01 22:16:24.000000000 -0400
+++ linux-2.6.17-mm/arch/um/os-Linux/time.c 2006-06-02 17:47:11.000000000 -0400
@@ -81,20 +81,12 @@ void uml_idle_timer(void)
set_interval(ITIMER_REAL);
}
-extern void ktime_get_ts(struct timespec *ts);
-#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
-
void time_init(void)
{
- struct timespec now;
-
if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
panic("Couldn't set SIGVTALRM handler");
set_interval(ITIMER_VIRTUAL);
-
- do_posix_clock_monotonic_gettime(&now);
- wall_to_monotonic.tv_sec = -now.tv_sec;
- wall_to_monotonic.tv_nsec = -now.tv_nsec;
+ time_init_kern();
}
unsigned long long os_nsecs(void)
Index: linux-2.6.17-mm/arch/um/include/kern_util.h
===================================================================
--- linux-2.6.17-mm.orig/arch/um/include/kern_util.h 2006-06-02 17:00:00.000000000 -0400
+++ linux-2.6.17-mm/arch/um/include/kern_util.h 2006-06-02 17:46:49.000000000 -0400
@@ -120,20 +120,11 @@ extern int is_syscall(unsigned long addr
extern void free_irq(unsigned int, void *);
extern int cpu(void);
+extern void time_init_kern(void);
+
/* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */
extern int __cant_sleep(void);
extern void segv_handler(int sig, union uml_pt_regs *regs);
extern void sigio_handler(int sig, union uml_pt_regs *regs);
#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
Index: linux-2.6.17-mm/arch/um/kernel/time_kern.c
===================================================================
--- linux-2.6.17-mm.orig/arch/um/kernel/time_kern.c 2006-06-02 16:34:55.000000000 -0400
+++ linux-2.6.17-mm/arch/um/kernel/time_kern.c 2006-06-02 17:46:49.000000000 -0400
@@ -84,6 +84,16 @@ void timer_irq(union uml_pt_regs *regs)
}
}
+
+void time_init_kern(void)
+{
+ unsigned long long nsecs;
+
+ nsecs = os_nsecs();
+ set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION,
+ -nsecs % BILLION);
+}
+
void do_boot_timer_handler(struct sigcontext * sc)
{
struct pt_regs regs;
reply other threads:[~2006-06-04 2:16 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=200606040216.k542GDFU004832@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@osdl.org \
--cc=blaisorblade@yahoo.it \
--cc=caker@theshore.net \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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