uml: use *SEC_PER_*SEC constants

There are various uses of powers of 1000, plus the odd BILLION constant in the
time code.  However, there are perfectly good definitions of *SEC_PER_*SEC in
linux/time.h which can be used instaed.

These are replaced directly in kernel code.  Userspace code imports those
constants as UM_*SEC_PER_*SEC and uses these.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jeff Dike
2007-10-16 01:27:28 -07:00
committed by Linus Torvalds
parent 61b63c556c
commit 1a80521990
5 changed files with 22 additions and 17 deletions

View File

@@ -294,8 +294,8 @@ void userspace(struct uml_pt_regs *regs)
if (getitimer(ITIMER_VIRTUAL, &timer))
printk("Failed to get itimer, errno = %d\n", errno);
nsecs = timer.it_value.tv_sec * BILLION +
timer.it_value.tv_usec * 1000;
nsecs = timer.it_value.tv_sec * UM_NSEC_PER_SEC +
timer.it_value.tv_usec * UM_NSEC_PER_USEC;
nsecs += os_nsecs();
while (1) {
@@ -347,8 +347,10 @@ void userspace(struct uml_pt_regs *regs)
block_signals();
(*sig_info[sig])(sig, regs);
unblock_signals();
nsecs = timer.it_value.tv_sec * BILLION +
timer.it_value.tv_usec * 1000;
nsecs = timer.it_value.tv_sec *
UM_NSEC_PER_SEC +
timer.it_value.tv_usec *
UM_NSEC_PER_USEC;
nsecs += os_nsecs();
break;
case SIGIO:
@@ -395,7 +397,7 @@ __initcall(init_thread_regs);
int copy_context_skas0(unsigned long new_stack, int pid)
{
struct timeval tv = { .tv_sec = 0, .tv_usec = 1000000 / UM_HZ };
struct timeval tv = { .tv_sec = 0, .tv_usec = UM_USEC_PER_SEC / UM_HZ };
int err;
unsigned long current_stack = current_stub_stack();
struct stub_data *data = (struct stub_data *) current_stack;