Skip to content

Commit d83d2aa

Browse files
cfd-36Linus Torvalds
authored andcommitted
uml: GENERIC_TIME support
Enable CONFIG_GENERIC_TIME. As a side-effect of this, the UML implementations of do_gettimeofday and do_settimeofday go away, as these are provided by generic code. set_time also goes away since it was only used by do_settimeofday. 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>
1 parent 78a26e2 commit d83d2aa

3 files changed

Lines changed: 5 additions & 43 deletions

File tree

‎arch/um/Kconfig‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ config GENERIC_BUG
5555
default y
5656
depends on BUG
5757

58+
config GENERIC_TIME
59+
bool
60+
default y
61+
5862
# Used in kernel/irq/manage.c and include/linux/irq.h
5963
config IRQ_RELEASE_METHOD
6064
bool
@@ -75,6 +79,7 @@ config STATIC_LINK
7579

7680
source "arch/um/Kconfig.arch"
7781
source "mm/Kconfig"
82+
source "kernel/time/Kconfig"
7883

7984
config LD_SCRIPT_STATIC
8085
bool

‎arch/um/kernel/ksyms.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ EXPORT_SYMBOL(run_helper);
6767
EXPORT_SYMBOL(start_thread);
6868
EXPORT_SYMBOL(dump_thread);
6969

70-
EXPORT_SYMBOL(do_gettimeofday);
71-
EXPORT_SYMBOL(do_settimeofday);
72-
7370
#ifdef CONFIG_SMP
7471

7572
/* required for SMP */

‎arch/um/kernel/time.c‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -123,46 +123,6 @@ void time_init(void)
123123
late_time_init = register_timer;
124124
}
125125

126-
void do_gettimeofday(struct timeval *tv)
127-
{
128-
#ifdef CONFIG_UML_REAL_TIME_CLOCK
129-
unsigned long long nsecs = get_time();
130-
#else
131-
unsigned long long nsecs = (unsigned long long) xtime.tv_sec * BILLION +
132-
xtime.tv_nsec;
133-
#endif
134-
tv->tv_sec = nsecs / NSEC_PER_SEC;
135-
/*
136-
* Careful about calculations here - this was originally done as
137-
* (nsecs - tv->tv_sec * NSEC_PER_SEC) / NSEC_PER_USEC
138-
* which gave bogus (> 1000000) values. Dunno why, suspect gcc
139-
* (4.0.0) miscompiled it, or there's a subtle 64/32-bit conversion
140-
* problem that I missed.
141-
*/
142-
nsecs -= tv->tv_sec * NSEC_PER_SEC;
143-
tv->tv_usec = (unsigned long) nsecs / NSEC_PER_USEC;
144-
}
145-
146-
static inline void set_time(unsigned long long nsecs)
147-
{
148-
unsigned long long now;
149-
unsigned long flags;
150-
151-
spin_lock_irqsave(&timer_spinlock, flags);
152-
now = os_nsecs();
153-
local_offset = nsecs - now;
154-
spin_unlock_irqrestore(&timer_spinlock, flags);
155-
156-
clock_was_set();
157-
}
158-
159-
int do_settimeofday(struct timespec *tv)
160-
{
161-
set_time((unsigned long long) tv->tv_sec * NSEC_PER_SEC + tv->tv_nsec);
162-
163-
return 0;
164-
}
165-
166126
void timer_handler(int sig, struct uml_pt_regs *regs)
167127
{
168128
if (current_thread->cpu == 0)

0 commit comments

Comments
 (0)