diff options
Diffstat (limited to 'arch/um/kernel')
| -rw-r--r-- | arch/um/kernel/irq.c | 11 | ||||
| -rw-r--r-- | arch/um/kernel/irq_user.c | 2 | ||||
| -rw-r--r-- | arch/um/kernel/main.c | 1 | ||||
| -rw-r--r-- | arch/um/kernel/mem.c | 1 | ||||
| -rw-r--r-- | arch/um/kernel/process_kern.c | 14 | ||||
| -rw-r--r-- | arch/um/kernel/reboot.c | 9 | ||||
| -rw-r--r-- | arch/um/kernel/skas/Makefile | 4 | ||||
| -rw-r--r-- | arch/um/kernel/skas/include/mode-skas.h | 1 | ||||
| -rw-r--r-- | arch/um/kernel/skas/process_kern.c | 15 | ||||
| -rw-r--r-- | arch/um/kernel/skas/time.c | 30 | ||||
| -rw-r--r-- | arch/um/kernel/syscall_kern.c | 19 | ||||
| -rw-r--r-- | arch/um/kernel/time.c | 31 | ||||
| -rw-r--r-- | arch/um/kernel/time_kern.c | 2 | ||||
| -rw-r--r-- | arch/um/kernel/tt/Makefile | 19 | ||||
| -rw-r--r-- | arch/um/kernel/tt/gdb.c | 4 | ||||
| -rw-r--r-- | arch/um/kernel/tt/gdb_kern.c | 2 | ||||
| -rw-r--r-- | arch/um/kernel/tt/include/debug.h | 17 | ||||
| -rw-r--r-- | arch/um/kernel/tt/include/mode-tt.h | 1 | ||||
| -rw-r--r-- | arch/um/kernel/tt/process_kern.c | 17 | ||||
| -rw-r--r-- | arch/um/kernel/tt/time.c | 28 | ||||
| -rw-r--r-- | arch/um/kernel/tt/unmap.c | 31 | ||||
| -rw-r--r-- | arch/um/kernel/uml.lds.S | 15 |
22 files changed, 53 insertions, 221 deletions
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index d44fb5282547..9f18061ef4c9 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
| @@ -124,14 +124,16 @@ void irq_unlock(unsigned long flags) | |||
| 124 | spin_unlock_irqrestore(&irq_spinlock, flags); | 124 | spin_unlock_irqrestore(&irq_spinlock, flags); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | /* presently hw_interrupt_type must define (startup || enable) && | 127 | /* hw_interrupt_type must define (startup || enable) && |
| 128 | * disable && end */ | 128 | * (shutdown || disable) && end */ |
| 129 | static void dummy(unsigned int irq) | 129 | static void dummy(unsigned int irq) |
| 130 | { | 130 | { |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static struct hw_interrupt_type SIGIO_irq_type = { | 133 | /* This is used for everything else than the timer. */ |
| 134 | static struct hw_interrupt_type normal_irq_type = { | ||
| 134 | .typename = "SIGIO", | 135 | .typename = "SIGIO", |
| 136 | .release = free_irq_by_irq_and_dev, | ||
| 135 | .disable = dummy, | 137 | .disable = dummy, |
| 136 | .enable = dummy, | 138 | .enable = dummy, |
| 137 | .ack = dummy, | 139 | .ack = dummy, |
| @@ -140,6 +142,7 @@ static struct hw_interrupt_type SIGIO_irq_type = { | |||
| 140 | 142 | ||
| 141 | static struct hw_interrupt_type SIGVTALRM_irq_type = { | 143 | static struct hw_interrupt_type SIGVTALRM_irq_type = { |
| 142 | .typename = "SIGVTALRM", | 144 | .typename = "SIGVTALRM", |
| 145 | .release = free_irq_by_irq_and_dev, | ||
| 143 | .shutdown = dummy, /* never called */ | 146 | .shutdown = dummy, /* never called */ |
| 144 | .disable = dummy, | 147 | .disable = dummy, |
| 145 | .enable = dummy, | 148 | .enable = dummy, |
| @@ -160,7 +163,7 @@ void __init init_IRQ(void) | |||
| 160 | irq_desc[i].status = IRQ_DISABLED; | 163 | irq_desc[i].status = IRQ_DISABLED; |
| 161 | irq_desc[i].action = NULL; | 164 | irq_desc[i].action = NULL; |
| 162 | irq_desc[i].depth = 1; | 165 | irq_desc[i].depth = 1; |
| 163 | irq_desc[i].handler = &SIGIO_irq_type; | 166 | irq_desc[i].handler = &normal_irq_type; |
| 164 | enable_irq(i); | 167 | enable_irq(i); |
| 165 | } | 168 | } |
| 166 | } | 169 | } |
diff --git a/arch/um/kernel/irq_user.c b/arch/um/kernel/irq_user.c index b3074cbaa479..c3ccaf24f3e0 100644 --- a/arch/um/kernel/irq_user.c +++ b/arch/um/kernel/irq_user.c | |||
| @@ -85,8 +85,6 @@ void sigio_handler(int sig, union uml_pt_regs *regs) | |||
| 85 | next = irq_fd->next; | 85 | next = irq_fd->next; |
| 86 | if(irq_fd->freed){ | 86 | if(irq_fd->freed){ |
| 87 | free_irq(irq_fd->irq, irq_fd->id); | 87 | free_irq(irq_fd->irq, irq_fd->id); |
| 88 | free_irq_by_irq_and_dev(irq_fd->irq, | ||
| 89 | irq_fd->id); | ||
| 90 | } | 88 | } |
| 91 | } | 89 | } |
| 92 | } | 90 | } |
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c index e59f58152678..1e1a87f1c510 100644 --- a/arch/um/kernel/main.c +++ b/arch/um/kernel/main.c | |||
| @@ -69,7 +69,6 @@ static __init void do_uml_initcalls(void) | |||
| 69 | 69 | ||
| 70 | static void last_ditch_exit(int sig) | 70 | static void last_ditch_exit(int sig) |
| 71 | { | 71 | { |
| 72 | kmalloc_ok = 0; | ||
| 73 | signal(SIGINT, SIG_DFL); | 72 | signal(SIGINT, SIG_DFL); |
| 74 | signal(SIGTERM, SIG_DFL); | 73 | signal(SIGTERM, SIG_DFL); |
| 75 | signal(SIGHUP, SIG_DFL); | 74 | signal(SIGHUP, SIG_DFL); |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index c22825f13e40..5597bd39e6b5 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
| @@ -53,7 +53,6 @@ static void setup_highmem(unsigned long highmem_start, | |||
| 53 | for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){ | 53 | for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){ |
| 54 | page = &mem_map[highmem_pfn + i]; | 54 | page = &mem_map[highmem_pfn + i]; |
| 55 | ClearPageReserved(page); | 55 | ClearPageReserved(page); |
| 56 | set_bit(PG_highmem, &page->flags); | ||
| 57 | set_page_count(page, 1); | 56 | set_page_count(page, 1); |
| 58 | __free_page(page); | 57 | __free_page(page); |
| 59 | } | 58 | } |
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index 804c6bbdf67c..d4036ed680bc 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "linux/kernel.h" | 8 | #include "linux/kernel.h" |
| 9 | #include "linux/sched.h" | 9 | #include "linux/sched.h" |
| 10 | #include "linux/interrupt.h" | 10 | #include "linux/interrupt.h" |
| 11 | #include "linux/string.h" | ||
| 11 | #include "linux/mm.h" | 12 | #include "linux/mm.h" |
| 12 | #include "linux/slab.h" | 13 | #include "linux/slab.h" |
| 13 | #include "linux/utsname.h" | 14 | #include "linux/utsname.h" |
| @@ -95,8 +96,8 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
| 95 | 96 | ||
| 96 | current->thread.request.u.thread.proc = fn; | 97 | current->thread.request.u.thread.proc = fn; |
| 97 | current->thread.request.u.thread.arg = arg; | 98 | current->thread.request.u.thread.arg = arg; |
| 98 | pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0, NULL, 0, NULL, | 99 | pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0, |
| 99 | NULL); | 100 | ¤t->thread.regs, 0, NULL, NULL); |
| 100 | if(pid < 0) | 101 | if(pid < 0) |
| 101 | panic("do_fork failed in kernel_thread, errno = %d", pid); | 102 | panic("do_fork failed in kernel_thread, errno = %d", pid); |
| 102 | return(pid); | 103 | return(pid); |
| @@ -168,7 +169,7 @@ int current_pid(void) | |||
| 168 | 169 | ||
| 169 | void default_idle(void) | 170 | void default_idle(void) |
| 170 | { | 171 | { |
| 171 | uml_idle_timer(); | 172 | CHOOSE_MODE(uml_idle_timer(), (void) 0); |
| 172 | 173 | ||
| 173 | atomic_inc(&init_mm.mm_count); | 174 | atomic_inc(&init_mm.mm_count); |
| 174 | current->mm = &init_mm; | 175 | current->mm = &init_mm; |
| @@ -322,12 +323,7 @@ void do_uml_exitcalls(void) | |||
| 322 | 323 | ||
| 323 | char *uml_strdup(char *string) | 324 | char *uml_strdup(char *string) |
| 324 | { | 325 | { |
| 325 | char *new; | 326 | return kstrdup(string, GFP_KERNEL); |
| 326 | |||
| 327 | new = kmalloc(strlen(string) + 1, GFP_KERNEL); | ||
| 328 | if(new == NULL) return(NULL); | ||
| 329 | strcpy(new, string); | ||
| 330 | return(new); | ||
| 331 | } | 327 | } |
| 332 | 328 | ||
| 333 | int copy_to_user_proc(void __user *to, void *from, int size) | 329 | int copy_to_user_proc(void __user *to, void *from, int size) |
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 207f89d74908..fcec51da1d37 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c | |||
| @@ -38,14 +38,14 @@ static void kill_off_processes(void) | |||
| 38 | 38 | ||
| 39 | void uml_cleanup(void) | 39 | void uml_cleanup(void) |
| 40 | { | 40 | { |
| 41 | kill_off_processes(); | 41 | kmalloc_ok = 0; |
| 42 | do_uml_exitcalls(); | 42 | do_uml_exitcalls(); |
| 43 | kill_off_processes(); | ||
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | void machine_restart(char * __unused) | 46 | void machine_restart(char * __unused) |
| 46 | { | 47 | { |
| 47 | do_uml_exitcalls(); | 48 | uml_cleanup(); |
| 48 | kill_off_processes(); | ||
| 49 | CHOOSE_MODE(reboot_tt(), reboot_skas()); | 49 | CHOOSE_MODE(reboot_tt(), reboot_skas()); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| @@ -53,8 +53,7 @@ EXPORT_SYMBOL(machine_restart); | |||
| 53 | 53 | ||
| 54 | void machine_power_off(void) | 54 | void machine_power_off(void) |
| 55 | { | 55 | { |
| 56 | do_uml_exitcalls(); | 56 | uml_cleanup(); |
| 57 | kill_off_processes(); | ||
| 58 | CHOOSE_MODE(halt_tt(), halt_skas()); | 57 | CHOOSE_MODE(halt_tt(), halt_skas()); |
| 59 | } | 58 | } |
| 60 | 59 | ||
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 | ||
| 6 | obj-y := exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ | 6 | obj-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 | ||
| 9 | subdir- := util | 9 | subdir- := util |
| 10 | 10 | ||
| 11 | USER_OBJS := process.o time.o | 11 | USER_OBJS := process.o |
| 12 | 12 | ||
| 13 | include arch/um/scripts/Makefile.rules | 13 | include 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[]; | |||
| 13 | extern unsigned long exec_fpx_regs[]; | 13 | extern unsigned long exec_fpx_regs[]; |
| 14 | extern int have_fpx_regs; | 14 | extern int have_fpx_regs; |
| 15 | 15 | ||
| 16 | extern void user_time_init_skas(void); | ||
| 17 | extern void sig_handler_common_skas(int sig, void *sc_ptr); | 16 | extern void sig_handler_common_skas(int sig, void *sc_ptr); |
| 18 | extern void halt_skas(void); | 17 | extern void halt_skas(void); |
| 19 | extern void reboot_skas(void); | 18 | extern void reboot_skas(void); |
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c index fc71ef295782..0a7b8aa55db8 100644 --- a/arch/um/kernel/skas/process_kern.c +++ b/arch/um/kernel/skas/process_kern.c | |||
| @@ -111,8 +111,7 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp, | |||
| 111 | void (*handler)(int); | 111 | void (*handler)(int); |
| 112 | 112 | ||
| 113 | if(current->thread.forking){ | 113 | if(current->thread.forking){ |
| 114 | memcpy(&p->thread.regs.regs.skas, | 114 | memcpy(&p->thread.regs.regs.skas, ®s->regs.skas, |
| 115 | ¤t->thread.regs.regs.skas, | ||
| 116 | sizeof(p->thread.regs.regs.skas)); | 115 | sizeof(p->thread.regs.regs.skas)); |
| 117 | REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.skas.regs, 0); | 116 | REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.skas.regs, 0); |
| 118 | if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp; | 117 | if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp; |
| @@ -181,7 +180,6 @@ int start_uml_skas(void) | |||
| 181 | start_userspace(0); | 180 | start_userspace(0); |
| 182 | 181 | ||
| 183 | init_new_thread_signals(1); | 182 | init_new_thread_signals(1); |
| 184 | uml_idle_timer(); | ||
| 185 | 183 | ||
| 186 | init_task.thread.request.u.thread.proc = start_kernel_proc; | 184 | init_task.thread.request.u.thread.proc = start_kernel_proc; |
| 187 | init_task.thread.request.u.thread.arg = NULL; | 185 | init_task.thread.request.u.thread.arg = NULL; |
| @@ -201,14 +199,3 @@ int thread_pid_skas(struct task_struct *task) | |||
| 201 | #warning Need to look up userspace_pid by cpu | 199 | #warning Need to look up userspace_pid by cpu |
| 202 | return(userspace_pid[0]); | 200 | return(userspace_pid[0]); |
| 203 | } | 201 | } |
| 204 | |||
| 205 | /* | ||
| 206 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 207 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 208 | * adjust the settings for this buffer only. This must remain at the end | ||
| 209 | * of the file. | ||
| 210 | * --------------------------------------------------------------------------- | ||
| 211 | * Local variables: | ||
| 212 | * c-file-style: "linux" | ||
| 213 | * End: | ||
| 214 | */ | ||
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 | |||
| 12 | void 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/syscall_kern.c b/arch/um/kernel/syscall_kern.c index b7a55251e897..8e1a3501ff46 100644 --- a/arch/um/kernel/syscall_kern.c +++ b/arch/um/kernel/syscall_kern.c | |||
| @@ -31,7 +31,8 @@ long sys_fork(void) | |||
| 31 | long ret; | 31 | long ret; |
| 32 | 32 | ||
| 33 | current->thread.forking = 1; | 33 | current->thread.forking = 1; |
| 34 | ret = do_fork(SIGCHLD, 0, NULL, 0, NULL, NULL); | 34 | ret = do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), |
| 35 | ¤t->thread.regs, 0, NULL, NULL); | ||
| 35 | current->thread.forking = 0; | 36 | current->thread.forking = 0; |
| 36 | return(ret); | 37 | return(ret); |
| 37 | } | 38 | } |
| @@ -41,8 +42,9 @@ long sys_vfork(void) | |||
| 41 | long ret; | 42 | long ret; |
| 42 | 43 | ||
| 43 | current->thread.forking = 1; | 44 | current->thread.forking = 1; |
| 44 | ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, NULL, 0, NULL, | 45 | ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, |
| 45 | NULL); | 46 | UPT_SP(¤t->thread.regs.regs), |
| 47 | ¤t->thread.regs, 0, NULL, NULL); | ||
| 46 | current->thread.forking = 0; | 48 | current->thread.forking = 0; |
| 47 | return(ret); | 49 | return(ret); |
| 48 | } | 50 | } |
| @@ -162,14 +164,3 @@ int next_syscall_index(int limit) | |||
| 162 | spin_unlock(&syscall_lock); | 164 | spin_unlock(&syscall_lock); |
| 163 | return(ret); | 165 | return(ret); |
| 164 | } | 166 | } |
| 165 | |||
| 166 | /* | ||
| 167 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 168 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 169 | * adjust the settings for this buffer only. This must remain at the end | ||
| 170 | * of the file. | ||
| 171 | * --------------------------------------------------------------------------- | ||
| 172 | * Local variables: | ||
| 173 | * c-file-style: "linux" | ||
| 174 | * End: | ||
| 175 | */ | ||
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 | ||
| 36 | void set_interval(int timer_type) | 36 | static 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 | ||
| 46 | void enable_timer(void) | 46 | void 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 | ||
| 56 | void disable_timer(void) | 51 | void 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 | 155 | void 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 c3faea21a996..6939e5af8472 100644 --- a/arch/um/kernel/tt/Makefile +++ b/arch/um/kernel/tt/Makefile | |||
| @@ -3,27 +3,12 @@ | |||
| 3 | # Licensed under the GPL | 3 | # Licensed under the GPL |
| 4 | # | 4 | # |
| 5 | 5 | ||
| 6 | extra-y := unmap_fin.o | ||
| 7 | targets := unmap.o | ||
| 8 | clean-files := unmap_tmp.o | ||
| 9 | |||
| 10 | obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ | 6 | obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ |
| 11 | 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 \ |
| 12 | uaccess.o uaccess_user.o | 8 | uaccess.o uaccess_user.o |
| 13 | 9 | ||
| 14 | obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/ | 10 | obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/ |
| 15 | 11 | ||
| 16 | USER_OBJS := gdb.o time.o tracer.o | 12 | USER_OBJS := gdb.o tracer.o |
| 17 | 13 | ||
| 18 | include arch/um/scripts/Makefile.rules | 14 | include arch/um/scripts/Makefile.rules |
| 19 | |||
| 20 | UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS)) | ||
| 21 | UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS)) | ||
| 22 | |||
| 23 | #XXX: partially copied from arch/um/scripts/Makefile.rules | ||
| 24 | $(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS) | ||
| 25 | |||
| 26 | $(obj)/unmap_fin.o : $(obj)/unmap.o | ||
| 27 | $(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a) | ||
| 28 | $(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo | ||
| 29 | |||
diff --git a/arch/um/kernel/tt/gdb.c b/arch/um/kernel/tt/gdb.c index 19a0ad7b35b3..37e22d71a0d9 100644 --- a/arch/um/kernel/tt/gdb.c +++ b/arch/um/kernel/tt/gdb.c | |||
| @@ -153,10 +153,10 @@ void remove_gdb_cb(void *unused) | |||
| 153 | exit_debugger_cb(NULL); | 153 | exit_debugger_cb(NULL); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | int gdb_remove(char *unused) | 156 | int gdb_remove(int unused) |
| 157 | { | 157 | { |
| 158 | initial_thread_cb(remove_gdb_cb, NULL); | 158 | initial_thread_cb(remove_gdb_cb, NULL); |
| 159 | return(0); | 159 | return 0; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | void signal_usr1(int sig) | 162 | void signal_usr1(int sig) |
diff --git a/arch/um/kernel/tt/gdb_kern.c b/arch/um/kernel/tt/gdb_kern.c index 93fb121f86af..26506388a6aa 100644 --- a/arch/um/kernel/tt/gdb_kern.c +++ b/arch/um/kernel/tt/gdb_kern.c | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #ifdef CONFIG_MCONSOLE | 10 | #ifdef CONFIG_MCONSOLE |
| 11 | 11 | ||
| 12 | extern int gdb_config(char *str); | 12 | extern int gdb_config(char *str); |
| 13 | extern int gdb_remove(char *unused); | 13 | extern int gdb_remove(int n); |
| 14 | 14 | ||
| 15 | static struct mc_device gdb_mc = { | 15 | static struct mc_device gdb_mc = { |
| 16 | .name = "gdb", | 16 | .name = "gdb", |
diff --git a/arch/um/kernel/tt/include/debug.h b/arch/um/kernel/tt/include/debug.h index 8eff674107ca..738435461e13 100644 --- a/arch/um/kernel/tt/include/debug.h +++ b/arch/um/kernel/tt/include/debug.h | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | * Licensed under the GPL | 4 | * Licensed under the GPL |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #ifndef __DEBUG_H | 7 | #ifndef __UML_TT_DEBUG_H |
| 8 | #define __DEBUG_H | 8 | #define __UML_TT_DEBUG_H |
| 9 | 9 | ||
| 10 | extern int debugger_proxy(int status, pid_t pid); | 10 | extern int debugger_proxy(int status, pid_t pid); |
| 11 | extern void child_proxy(pid_t pid, int status); | 11 | extern void child_proxy(pid_t pid, int status); |
| @@ -13,17 +13,6 @@ extern void init_proxy (pid_t pid, int waiting, int status); | |||
| 13 | extern int start_debugger(char *prog, int startup, int stop, int *debugger_fd); | 13 | extern int start_debugger(char *prog, int startup, int stop, int *debugger_fd); |
| 14 | extern void fake_child_exit(void); | 14 | extern void fake_child_exit(void); |
| 15 | extern int gdb_config(char *str); | 15 | extern int gdb_config(char *str); |
| 16 | extern int gdb_remove(char *unused); | 16 | extern int gdb_remove(int unused); |
| 17 | 17 | ||
| 18 | #endif | 18 | #endif |
| 19 | |||
| 20 | /* | ||
| 21 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 22 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 23 | * adjust the settings for this buffer only. This must remain at the end | ||
| 24 | * of the file. | ||
| 25 | * --------------------------------------------------------------------------- | ||
| 26 | * Local variables: | ||
| 27 | * c-file-style: "linux" | ||
| 28 | * End: | ||
| 29 | */ | ||
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 }; | |||
| 13 | extern int tracing_pid; | 13 | extern int tracing_pid; |
| 14 | 14 | ||
| 15 | extern int tracer(int (*init_proc)(void *), void *sp); | 15 | extern int tracer(int (*init_proc)(void *), void *sp); |
| 16 | extern void user_time_init_tt(void); | ||
| 17 | extern void sig_handler_common_tt(int sig, void *sc); | 16 | extern void sig_handler_common_tt(int sig, void *sc); |
| 18 | extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); | 17 | extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); |
| 19 | extern void reboot_tt(void); | 18 | extern void reboot_tt(void); |
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c index 776310fd5b8b..a189a2b92935 100644 --- a/arch/um/kernel/tt/process_kern.c +++ b/arch/um/kernel/tt/process_kern.c | |||
| @@ -266,10 +266,10 @@ int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp, | |||
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | if(current->thread.forking){ | 268 | if(current->thread.forking){ |
| 269 | sc_to_sc(UPT_SC(&p->thread.regs.regs), | 269 | sc_to_sc(UPT_SC(&p->thread.regs.regs), UPT_SC(®s->regs)); |
| 270 | UPT_SC(¤t->thread.regs.regs)); | ||
| 271 | SC_SET_SYSCALL_RETURN(UPT_SC(&p->thread.regs.regs), 0); | 270 | SC_SET_SYSCALL_RETURN(UPT_SC(&p->thread.regs.regs), 0); |
| 272 | if(sp != 0) SC_SP(UPT_SC(&p->thread.regs.regs)) = sp; | 271 | if(sp != 0) |
| 272 | SC_SP(UPT_SC(&p->thread.regs.regs)) = sp; | ||
| 273 | } | 273 | } |
| 274 | p->thread.mode.tt.extern_pid = new_pid; | 274 | p->thread.mode.tt.extern_pid = new_pid; |
| 275 | 275 | ||
| @@ -459,14 +459,3 @@ int is_valid_pid(int pid) | |||
| 459 | read_unlock(&tasklist_lock); | 459 | read_unlock(&tasklist_lock); |
| 460 | return(0); | 460 | return(0); |
| 461 | } | 461 | } |
| 462 | |||
| 463 | /* | ||
| 464 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 465 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 466 | * adjust the settings for this buffer only. This must remain at the end | ||
| 467 | * of the file. | ||
| 468 | * --------------------------------------------------------------------------- | ||
| 469 | * Local variables: | ||
| 470 | * c-file-style: "linux" | ||
| 471 | * End: | ||
| 472 | */ | ||
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 | |||
| 12 | void 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 | */ | ||
diff --git a/arch/um/kernel/tt/unmap.c b/arch/um/kernel/tt/unmap.c deleted file mode 100644 index 3f7aecdbe532..000000000000 --- a/arch/um/kernel/tt/unmap.c +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
| 3 | * Licensed under the GPL | ||
| 4 | */ | ||
| 5 | |||
| 6 | #include <sys/mman.h> | ||
| 7 | |||
| 8 | int switcheroo(int fd, int prot, void *from, void *to, int size) | ||
| 9 | { | ||
| 10 | if(munmap(to, size) < 0){ | ||
| 11 | return(-1); | ||
| 12 | } | ||
| 13 | if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ | ||
| 14 | return(-1); | ||
| 15 | } | ||
| 16 | if(munmap(from, size) < 0){ | ||
| 17 | return(-1); | ||
| 18 | } | ||
| 19 | return(0); | ||
| 20 | } | ||
| 21 | |||
| 22 | /* | ||
| 23 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 24 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 25 | * adjust the settings for this buffer only. This must remain at the end | ||
| 26 | * of the file. | ||
| 27 | * --------------------------------------------------------------------------- | ||
| 28 | * Local variables: | ||
| 29 | * c-file-style: "linux" | ||
| 30 | * End: | ||
| 31 | */ | ||
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S index dd5355500bdc..61dfd4fef752 100644 --- a/arch/um/kernel/uml.lds.S +++ b/arch/um/kernel/uml.lds.S | |||
| @@ -14,19 +14,10 @@ SECTIONS | |||
| 14 | /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start | 14 | /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start |
| 15 | * is remapped.*/ | 15 | * is remapped.*/ |
| 16 | __binary_start = .; | 16 | __binary_start = .; |
| 17 | #ifdef MODE_TT | ||
| 18 | .thread_private : { | ||
| 19 | __start_thread_private = .; | ||
| 20 | errno = .; | ||
| 21 | . += 4; | ||
| 22 | arch/um/kernel/tt/unmap_fin.o (.data) | ||
| 23 | __end_thread_private = .; | ||
| 24 | } | ||
| 25 | . = ALIGN(4096); | ||
| 26 | .remap : { arch/um/kernel/tt/unmap_fin.o (.text) } | ||
| 27 | 17 | ||
| 28 | /* We want it only if we are in MODE_TT. In both cases, however, when MODE_TT | 18 | #ifdef MODE_TT |
| 29 | * is off the resulting binary segfaults.*/ | 19 | .remap_data : { arch/um/sys-SUBARCH/unmap_fin.o (.data .bss) } |
| 20 | .remap : { arch/um/sys-SUBARCH/unmap_fin.o (.text) } | ||
| 30 | 21 | ||
| 31 | . = ALIGN(4096); /* Init code and data */ | 22 | . = ALIGN(4096); /* Init code and data */ |
| 32 | #endif | 23 | #endif |
