aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-06-25 17:55:24 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:24:35 -0400
commitfc47a0d18a1994b4a18d2235fcde1b75dfa72552 (patch)
treefd551126b4ae4a4a6e9be99773cf04a7eacc4b72 /arch
parent026549d28469f7d4ca7e5a4707f0d2dc4f2c164c (diff)
[PATCH] uml: time initialization tidying
user_time_init_skas and user_time_init_tt were essentially the same. So, this merges them, deleting the mode-specific functions and declarations. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/include/time_user.h2
-rw-r--r--arch/um/kernel/skas/Makefile4
-rw-r--r--arch/um/kernel/skas/include/mode-skas.h1
-rw-r--r--arch/um/kernel/skas/time.c30
-rw-r--r--arch/um/kernel/time.c31
-rw-r--r--arch/um/kernel/time_kern.c2
-rw-r--r--arch/um/kernel/tt/Makefile4
-rw-r--r--arch/um/kernel/tt/include/mode-tt.h1
-rw-r--r--arch/um/kernel/tt/time.c28
9 files changed, 20 insertions, 83 deletions
diff --git a/arch/um/include/time_user.h b/arch/um/include/time_user.h
index 6793a2fcd0ae..f64ef77019a3 100644
--- a/arch/um/include/time_user.h
+++ b/arch/um/include/time_user.h
@@ -8,11 +8,11 @@
8 8
9extern void timer(void); 9extern void timer(void);
10extern void switch_timers(int to_real); 10extern void switch_timers(int to_real);
11extern void set_interval(int timer_type);
12extern void idle_sleep(int secs); 11extern void idle_sleep(int secs);
13extern void enable_timer(void); 12extern void enable_timer(void);
14extern void disable_timer(void); 13extern void disable_timer(void);
15extern unsigned long time_lock(void); 14extern unsigned long time_lock(void);
16extern void time_unlock(unsigned long); 15extern void time_unlock(unsigned long);
16extern void user_time_init(void);
17 17
18#endif 18#endif
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile
index d37d1bfcd6f7..ff69c4b312c0 100644
--- a/arch/um/kernel/skas/Makefile
+++ b/arch/um/kernel/skas/Makefile
@@ -4,10 +4,10 @@
4# 4#
5 5
6obj-y := exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ 6obj-y := exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \
7 syscall_kern.o syscall_user.o time.o tlb.o trap_user.o uaccess.o \ 7 syscall_kern.o syscall_user.o tlb.o trap_user.o uaccess.o \
8 8
9subdir- := util 9subdir- := util
10 10
11USER_OBJS := process.o time.o 11USER_OBJS := process.o
12 12
13include arch/um/scripts/Makefile.rules 13include arch/um/scripts/Makefile.rules
diff --git a/arch/um/kernel/skas/include/mode-skas.h b/arch/um/kernel/skas/include/mode-skas.h
index c1e33bd788db..bcd26a6a3888 100644
--- a/arch/um/kernel/skas/include/mode-skas.h
+++ b/arch/um/kernel/skas/include/mode-skas.h
@@ -13,7 +13,6 @@ extern unsigned long exec_fp_regs[];
13extern unsigned long exec_fpx_regs[]; 13extern unsigned long exec_fpx_regs[];
14extern int have_fpx_regs; 14extern int have_fpx_regs;
15 15
16extern void user_time_init_skas(void);
17extern void sig_handler_common_skas(int sig, void *sc_ptr); 16extern void sig_handler_common_skas(int sig, void *sc_ptr);
18extern void halt_skas(void); 17extern void halt_skas(void);
19extern void reboot_skas(void); 18extern void reboot_skas(void);
diff --git a/arch/um/kernel/skas/time.c b/arch/um/kernel/skas/time.c
deleted file mode 100644
index 98091494b897..000000000000
--- a/arch/um/kernel/skas/time.c
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <sys/signal.h>
7#include <sys/time.h>
8#include "time_user.h"
9#include "process.h"
10#include "user.h"
11
12void user_time_init_skas(void)
13{
14 if(signal(SIGALRM, (__sighandler_t) alarm_handler) == SIG_ERR)
15 panic("Couldn't set SIGALRM handler");
16 if(signal(SIGVTALRM, (__sighandler_t) alarm_handler) == SIG_ERR)
17 panic("Couldn't set SIGVTALRM handler");
18 set_interval(ITIMER_VIRTUAL);
19}
20
21/*
22 * Overrides for Emacs so that we follow Linus's tabbing style.
23 * Emacs will notice this stuff at the end of the file and automatically
24 * adjust the settings for this buffer only. This must remain at the end
25 * of the file.
26 * ---------------------------------------------------------------------------
27 * Local variables:
28 * c-file-style: "linux"
29 * End:
30 */
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index c40c86a3f918..f829b309b63c 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -33,7 +33,7 @@ void timer(void)
33 timeradd(&xtime, &local_offset, &xtime); 33 timeradd(&xtime, &local_offset, &xtime);
34} 34}
35 35
36void set_interval(int timer_type) 36static void set_interval(int timer_type)
37{ 37{
38 int usec = 1000000/hz(); 38 int usec = 1000000/hz();
39 struct itimerval interval = ((struct itimerval) { { 0, usec }, 39 struct itimerval interval = ((struct itimerval) { { 0, usec },
@@ -45,12 +45,7 @@ void set_interval(int timer_type)
45 45
46void enable_timer(void) 46void enable_timer(void)
47{ 47{
48 int usec = 1000000/hz(); 48 set_interval(ITIMER_VIRTUAL);
49 struct itimerval enable = ((struct itimerval) { { 0, usec },
50 { 0, usec }});
51 if(setitimer(ITIMER_VIRTUAL, &enable, NULL))
52 printk("enable_timer - setitimer failed, errno = %d\n",
53 errno);
54} 49}
55 50
56void disable_timer(void) 51void disable_timer(void)
@@ -155,13 +150,15 @@ void idle_sleep(int secs)
155 nanosleep(&ts, NULL); 150 nanosleep(&ts, NULL);
156} 151}
157 152
158/* 153/* XXX This partly duplicates init_irq_signals */
159 * Overrides for Emacs so that we follow Linus's tabbing style. 154
160 * Emacs will notice this stuff at the end of the file and automatically 155void user_time_init(void)
161 * adjust the settings for this buffer only. This must remain at the end 156{
162 * of the file. 157 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
163 * --------------------------------------------------------------------------- 158 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
164 * Local variables: 159 SIGALRM, SIGUSR2, -1);
165 * c-file-style: "linux" 160 set_handler(SIGALRM, (__sighandler_t) alarm_handler,
166 * End: 161 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
167 */ 162 SIGVTALRM, SIGUSR2, -1);
163 set_interval(ITIMER_VIRTUAL);
164}
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index 6516fc52afe0..a8b4ef601f59 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -162,7 +162,7 @@ int __init timer_init(void)
162{ 162{
163 int err; 163 int err;
164 164
165 CHOOSE_MODE(user_time_init_tt(), user_time_init_skas()); 165 user_time_init();
166 err = request_irq(TIMER_IRQ, um_timer, SA_INTERRUPT, "timer", NULL); 166 err = request_irq(TIMER_IRQ, um_timer, SA_INTERRUPT, "timer", NULL);
167 if(err != 0) 167 if(err != 0)
168 printk(KERN_ERR "timer_init : request_irq failed - " 168 printk(KERN_ERR "timer_init : request_irq failed - "
diff --git a/arch/um/kernel/tt/Makefile b/arch/um/kernel/tt/Makefile
index 3fd2554e60b6..6939e5af8472 100644
--- a/arch/um/kernel/tt/Makefile
+++ b/arch/um/kernel/tt/Makefile
@@ -4,11 +4,11 @@
4# 4#
5 5
6obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ 6obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
7 syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \ 7 syscall_kern.o syscall_user.o tlb.o tracer.o trap_user.o \
8 uaccess.o uaccess_user.o 8 uaccess.o uaccess_user.o
9 9
10obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/ 10obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/
11 11
12USER_OBJS := gdb.o time.o tracer.o 12USER_OBJS := gdb.o tracer.o
13 13
14include arch/um/scripts/Makefile.rules 14include arch/um/scripts/Makefile.rules
diff --git a/arch/um/kernel/tt/include/mode-tt.h b/arch/um/kernel/tt/include/mode-tt.h
index efe462019069..e171e15fead5 100644
--- a/arch/um/kernel/tt/include/mode-tt.h
+++ b/arch/um/kernel/tt/include/mode-tt.h
@@ -13,7 +13,6 @@ enum { OP_NONE, OP_EXEC, OP_FORK, OP_TRACE_ON, OP_REBOOT, OP_HALT, OP_CB };
13extern int tracing_pid; 13extern int tracing_pid;
14 14
15extern int tracer(int (*init_proc)(void *), void *sp); 15extern int tracer(int (*init_proc)(void *), void *sp);
16extern void user_time_init_tt(void);
17extern void sig_handler_common_tt(int sig, void *sc); 16extern void sig_handler_common_tt(int sig, void *sc);
18extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); 17extern void syscall_handler_tt(int sig, union uml_pt_regs *regs);
19extern void reboot_tt(void); 18extern void reboot_tt(void);
diff --git a/arch/um/kernel/tt/time.c b/arch/um/kernel/tt/time.c
deleted file mode 100644
index 8565b71b07cd..000000000000
--- a/arch/um/kernel/tt/time.c
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <signal.h>
7#include <sys/time.h>
8#include <time_user.h>
9#include "process.h"
10#include "user.h"
11
12void user_time_init_tt(void)
13{
14 if(signal(SIGVTALRM, (__sighandler_t) alarm_handler) == SIG_ERR)
15 panic("Couldn't set SIGVTALRM handler");
16 set_interval(ITIMER_VIRTUAL);
17}
18
19/*
20 * Overrides for Emacs so that we follow Linus's tabbing style.
21 * Emacs will notice this stuff at the end of the file and automatically
22 * adjust the settings for this buffer only. This must remain at the end
23 * of the file.
24 * ---------------------------------------------------------------------------
25 * Local variables:
26 * c-file-style: "linux"
27 * End:
28 */