diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Kconfig | 2 | ||||
-rw-r--r-- | arch/um/drivers/chan_kern.c | 12 | ||||
-rw-r--r-- | arch/um/drivers/daemon_user.c | 17 | ||||
-rw-r--r-- | arch/um/drivers/line.c | 6 | ||||
-rw-r--r-- | arch/um/drivers/mcast_user.c | 10 | ||||
-rw-r--r-- | arch/um/drivers/mconsole_kern.c | 3 | ||||
-rw-r--r-- | arch/um/drivers/ssl.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/stdio_console.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 13 | ||||
-rw-r--r-- | arch/um/include/mconsole.h | 2 | ||||
-rw-r--r-- | arch/um/include/os.h | 3 | ||||
-rw-r--r-- | arch/um/include/sysdep-x86_64/ptrace.h | 4 | ||||
-rw-r--r-- | arch/um/kernel/irq.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/mem.c | 3 | ||||
-rw-r--r-- | arch/um/os-Linux/process.c | 3 | ||||
-rw-r--r-- | arch/um/os-Linux/signal.c | 5 | ||||
-rw-r--r-- | arch/um/os-Linux/skas/mem.c | 10 | ||||
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 6 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-i386/registers.c | 5 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-x86_64/registers.c | 4 | ||||
-rw-r--r-- | arch/um/scripts/Makefile.rules | 4 | ||||
-rw-r--r-- | arch/um/sys-i386/delay.c | 11 | ||||
-rw-r--r-- | arch/um/sys-i386/ldt.c | 3 | ||||
-rw-r--r-- | arch/um/sys-x86_64/delay.c | 11 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 6 |
25 files changed, 72 insertions, 76 deletions
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index b3a21ba77cd2..354cc6b70530 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -44,7 +44,7 @@ config LOCKDEP_SUPPORT | |||
44 | 44 | ||
45 | config STACKTRACE_SUPPORT | 45 | config STACKTRACE_SUPPORT |
46 | bool | 46 | bool |
47 | default y | 47 | default n |
48 | 48 | ||
49 | config GENERIC_CALIBRATE_DELAY | 49 | config GENERIC_CALIBRATE_DELAY |
50 | bool | 50 | bool |
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 7b8baf146acc..9fdfad649536 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -236,11 +236,11 @@ void free_irqs(void) | |||
236 | struct chan *chan; | 236 | struct chan *chan; |
237 | LIST_HEAD(list); | 237 | LIST_HEAD(list); |
238 | struct list_head *ele; | 238 | struct list_head *ele; |
239 | unsigned long flags; | ||
239 | 240 | ||
240 | spin_lock_irq(&irqs_to_free_lock); | 241 | spin_lock_irqsave(&irqs_to_free_lock, flags); |
241 | list_splice_init(&irqs_to_free, &list); | 242 | list_splice_init(&irqs_to_free, &list); |
242 | INIT_LIST_HEAD(&irqs_to_free); | 243 | spin_unlock_irqrestore(&irqs_to_free_lock, flags); |
243 | spin_unlock_irq(&irqs_to_free_lock); | ||
244 | 244 | ||
245 | list_for_each(ele, &list){ | 245 | list_for_each(ele, &list){ |
246 | chan = list_entry(ele, struct chan, free_list); | 246 | chan = list_entry(ele, struct chan, free_list); |
@@ -255,13 +255,15 @@ void free_irqs(void) | |||
255 | 255 | ||
256 | static void close_one_chan(struct chan *chan, int delay_free_irq) | 256 | static void close_one_chan(struct chan *chan, int delay_free_irq) |
257 | { | 257 | { |
258 | unsigned long flags; | ||
259 | |||
258 | if(!chan->opened) | 260 | if(!chan->opened) |
259 | return; | 261 | return; |
260 | 262 | ||
261 | if(delay_free_irq){ | 263 | if(delay_free_irq){ |
262 | spin_lock_irq(&irqs_to_free_lock); | 264 | spin_lock_irqsave(&irqs_to_free_lock, flags); |
263 | list_add(&chan->free_list, &irqs_to_free); | 265 | list_add(&chan->free_list, &irqs_to_free); |
264 | spin_unlock_irq(&irqs_to_free_lock); | 266 | spin_unlock_irqrestore(&irqs_to_free_lock, flags); |
265 | } | 267 | } |
266 | else { | 268 | else { |
267 | if(chan->input) | 269 | if(chan->input) |
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c index 310af0f1e49e..021b82c7a759 100644 --- a/arch/um/drivers/daemon_user.c +++ b/arch/um/drivers/daemon_user.c | |||
@@ -56,30 +56,31 @@ static int connect_to_switch(struct daemon_data *pri) | |||
56 | 56 | ||
57 | pri->control = socket(AF_UNIX, SOCK_STREAM, 0); | 57 | pri->control = socket(AF_UNIX, SOCK_STREAM, 0); |
58 | if(pri->control < 0){ | 58 | if(pri->control < 0){ |
59 | err = -errno; | ||
59 | printk("daemon_open : control socket failed, errno = %d\n", | 60 | printk("daemon_open : control socket failed, errno = %d\n", |
60 | errno); | 61 | -err); |
61 | return(-errno); | 62 | return err; |
62 | } | 63 | } |
63 | 64 | ||
64 | if(connect(pri->control, (struct sockaddr *) ctl_addr, | 65 | if(connect(pri->control, (struct sockaddr *) ctl_addr, |
65 | sizeof(*ctl_addr)) < 0){ | 66 | sizeof(*ctl_addr)) < 0){ |
66 | printk("daemon_open : control connect failed, errno = %d\n", | ||
67 | errno); | ||
68 | err = -errno; | 67 | err = -errno; |
68 | printk("daemon_open : control connect failed, errno = %d\n", | ||
69 | -err); | ||
69 | goto out; | 70 | goto out; |
70 | } | 71 | } |
71 | 72 | ||
72 | fd = socket(AF_UNIX, SOCK_DGRAM, 0); | 73 | fd = socket(AF_UNIX, SOCK_DGRAM, 0); |
73 | if(fd < 0){ | 74 | if(fd < 0){ |
74 | printk("daemon_open : data socket failed, errno = %d\n", | ||
75 | errno); | ||
76 | err = -errno; | 75 | err = -errno; |
76 | printk("daemon_open : data socket failed, errno = %d\n", | ||
77 | -err); | ||
77 | goto out; | 78 | goto out; |
78 | } | 79 | } |
79 | if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){ | 80 | if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){ |
80 | printk("daemon_open : data bind failed, errno = %d\n", | ||
81 | errno); | ||
82 | err = -errno; | 81 | err = -errno; |
82 | printk("daemon_open : data bind failed, errno = %d\n", | ||
83 | -err); | ||
83 | goto out_close; | 84 | goto out_close; |
84 | } | 85 | } |
85 | 86 | ||
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 01d4ab6b0ef1..f75d7b05c481 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -370,10 +370,10 @@ static irqreturn_t line_write_interrupt(int irq, void *data) | |||
370 | struct tty_struct *tty = line->tty; | 370 | struct tty_struct *tty = line->tty; |
371 | int err; | 371 | int err; |
372 | 372 | ||
373 | /* Interrupts are enabled here because we registered the interrupt with | 373 | /* Interrupts are disabled here because we registered the interrupt with |
374 | * IRQF_DISABLED (see line_setup_irq).*/ | 374 | * IRQF_DISABLED (see line_setup_irq).*/ |
375 | 375 | ||
376 | spin_lock_irq(&line->lock); | 376 | spin_lock(&line->lock); |
377 | err = flush_buffer(line); | 377 | err = flush_buffer(line); |
378 | if (err == 0) { | 378 | if (err == 0) { |
379 | return IRQ_NONE; | 379 | return IRQ_NONE; |
@@ -381,7 +381,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data) | |||
381 | line->head = line->buffer; | 381 | line->head = line->buffer; |
382 | line->tail = line->buffer; | 382 | line->tail = line->buffer; |
383 | } | 383 | } |
384 | spin_unlock_irq(&line->lock); | 384 | spin_unlock(&line->lock); |
385 | 385 | ||
386 | if(tty == NULL) | 386 | if(tty == NULL) |
387 | return IRQ_NONE; | 387 | return IRQ_NONE; |
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c index 8138f5ea1bf7..b827e82884c9 100644 --- a/arch/um/drivers/mcast_user.c +++ b/arch/um/drivers/mcast_user.c | |||
@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev) | |||
50 | pri->dev = dev; | 50 | pri->dev = dev; |
51 | } | 51 | } |
52 | 52 | ||
53 | static void mcast_remove(void *data) | ||
54 | { | ||
55 | struct mcast_data *pri = data; | ||
56 | |||
57 | kfree(pri->mcast_addr); | ||
58 | pri->mcast_addr = NULL; | ||
59 | } | ||
60 | |||
53 | static int mcast_open(void *data) | 61 | static int mcast_open(void *data) |
54 | { | 62 | { |
55 | struct mcast_data *pri = data; | 63 | struct mcast_data *pri = data; |
@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = { | |||
157 | .init = mcast_user_init, | 165 | .init = mcast_user_init, |
158 | .open = mcast_open, | 166 | .open = mcast_open, |
159 | .close = mcast_close, | 167 | .close = mcast_close, |
160 | .remove = NULL, | 168 | .remove = mcast_remove, |
161 | .set_mtu = mcast_set_mtu, | 169 | .set_mtu = mcast_set_mtu, |
162 | .add_address = NULL, | 170 | .add_address = NULL, |
163 | .delete_address = NULL, | 171 | .delete_address = NULL, |
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 178b2eff4a8c..65ad2932672c 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
@@ -615,6 +615,9 @@ void mconsole_remove(struct mc_request *req) | |||
615 | err_msg = NULL; | 615 | err_msg = NULL; |
616 | err = (*dev->remove)(n, &err_msg); | 616 | err = (*dev->remove)(n, &err_msg); |
617 | switch(err){ | 617 | switch(err){ |
618 | case 0: | ||
619 | err_msg = ""; | ||
620 | break; | ||
618 | case -ENODEV: | 621 | case -ENODEV: |
619 | if(err_msg == NULL) | 622 | if(err_msg == NULL) |
620 | err_msg = "Device doesn't exist"; | 623 | err_msg = "Device doesn't exist"; |
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index fc22b9bd9153..4b382a6e710f 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c | |||
@@ -179,7 +179,7 @@ static struct console ssl_cons = { | |||
179 | .write = ssl_console_write, | 179 | .write = ssl_console_write, |
180 | .device = ssl_console_device, | 180 | .device = ssl_console_device, |
181 | .setup = ssl_console_setup, | 181 | .setup = ssl_console_setup, |
182 | .flags = CON_PRINTBUFFER, | 182 | .flags = CON_PRINTBUFFER|CON_ANYTIME, |
183 | .index = -1, | 183 | .index = -1, |
184 | }; | 184 | }; |
185 | 185 | ||
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 7ff0b0fc37e7..76d1f1c980ef 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c | |||
@@ -153,7 +153,7 @@ static struct console stdiocons = { | |||
153 | .write = uml_console_write, | 153 | .write = uml_console_write, |
154 | .device = uml_console_device, | 154 | .device = uml_console_device, |
155 | .setup = uml_console_setup, | 155 | .setup = uml_console_setup, |
156 | .flags = CON_PRINTBUFFER, | 156 | .flags = CON_PRINTBUFFER|CON_ANYTIME, |
157 | .index = -1, | 157 | .index = -1, |
158 | }; | 158 | }; |
159 | 159 | ||
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index f98d26e51381..8bd9204ac1ab 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -109,10 +109,6 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data) | |||
109 | 109 | ||
110 | static DEFINE_MUTEX(ubd_lock); | 110 | static DEFINE_MUTEX(ubd_lock); |
111 | 111 | ||
112 | /* XXX - this made sense in 2.4 days, now it's only used as a boolean, and | ||
113 | * probably it doesn't make sense even for that. */ | ||
114 | static int do_ubd; | ||
115 | |||
116 | static int ubd_open(struct inode * inode, struct file * filp); | 112 | static int ubd_open(struct inode * inode, struct file * filp); |
117 | static int ubd_release(struct inode * inode, struct file * file); | 113 | static int ubd_release(struct inode * inode, struct file * file); |
118 | static int ubd_ioctl(struct inode * inode, struct file * file, | 114 | static int ubd_ioctl(struct inode * inode, struct file * file, |
@@ -169,6 +165,7 @@ struct ubd { | |||
169 | struct platform_device pdev; | 165 | struct platform_device pdev; |
170 | struct request_queue *queue; | 166 | struct request_queue *queue; |
171 | spinlock_t lock; | 167 | spinlock_t lock; |
168 | int active; | ||
172 | }; | 169 | }; |
173 | 170 | ||
174 | #define DEFAULT_COW { \ | 171 | #define DEFAULT_COW { \ |
@@ -190,6 +187,7 @@ struct ubd { | |||
190 | .shared = 0, \ | 187 | .shared = 0, \ |
191 | .cow = DEFAULT_COW, \ | 188 | .cow = DEFAULT_COW, \ |
192 | .lock = SPIN_LOCK_UNLOCKED, \ | 189 | .lock = SPIN_LOCK_UNLOCKED, \ |
190 | .active = 0, \ | ||
193 | } | 191 | } |
194 | 192 | ||
195 | /* Protected by ubd_lock */ | 193 | /* Protected by ubd_lock */ |
@@ -507,7 +505,6 @@ static void ubd_handler(void) | |||
507 | struct ubd *dev; | 505 | struct ubd *dev; |
508 | int n; | 506 | int n; |
509 | 507 | ||
510 | do_ubd = 0; | ||
511 | n = os_read_file(thread_fd, &req, sizeof(req)); | 508 | n = os_read_file(thread_fd, &req, sizeof(req)); |
512 | if(n != sizeof(req)){ | 509 | if(n != sizeof(req)){ |
513 | printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, " | 510 | printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, " |
@@ -517,6 +514,7 @@ static void ubd_handler(void) | |||
517 | 514 | ||
518 | rq = req.req; | 515 | rq = req.req; |
519 | dev = rq->rq_disk->private_data; | 516 | dev = rq->rq_disk->private_data; |
517 | dev->active = 0; | ||
520 | 518 | ||
521 | ubd_finish(rq, req.error); | 519 | ubd_finish(rq, req.error); |
522 | reactivate_fd(thread_fd, UBD_IRQ); | 520 | reactivate_fd(thread_fd, UBD_IRQ); |
@@ -1081,11 +1079,12 @@ static void do_ubd_request(request_queue_t *q) | |||
1081 | } | 1079 | } |
1082 | } | 1080 | } |
1083 | else { | 1081 | else { |
1084 | if(do_ubd || (req = elv_next_request(q)) == NULL) | 1082 | struct ubd *dev = q->queuedata; |
1083 | if(dev->active || (req = elv_next_request(q)) == NULL) | ||
1085 | return; | 1084 | return; |
1086 | err = prepare_request(req, &io_req); | 1085 | err = prepare_request(req, &io_req); |
1087 | if(!err){ | 1086 | if(!err){ |
1088 | do_ubd = 1; | 1087 | dev->active = 1; |
1089 | n = os_write_file(thread_fd, (char *) &io_req, | 1088 | n = os_write_file(thread_fd, (char *) &io_req, |
1090 | sizeof(io_req)); | 1089 | sizeof(io_req)); |
1091 | if(n != sizeof(io_req)) | 1090 | if(n != sizeof(io_req)) |
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h index 2666815b6af5..b282839c1625 100644 --- a/arch/um/include/mconsole.h +++ b/arch/um/include/mconsole.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #define u32 uint32_t | 12 | #define u32 uint32_t |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #include "sysdep/ptrace.h" | ||
16 | |||
15 | #define MCONSOLE_MAGIC (0xcafebabe) | 17 | #define MCONSOLE_MAGIC (0xcafebabe) |
16 | #define MCONSOLE_MAX_DATA (512) | 18 | #define MCONSOLE_MAX_DATA (512) |
17 | #define MCONSOLE_VERSION 2 | 19 | #define MCONSOLE_VERSION 2 |
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index 8629bd191492..5c74da410451 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -192,7 +192,9 @@ extern int os_process_parent(int pid); | |||
192 | extern void os_stop_process(int pid); | 192 | extern void os_stop_process(int pid); |
193 | extern void os_kill_process(int pid, int reap_child); | 193 | extern void os_kill_process(int pid, int reap_child); |
194 | extern void os_kill_ptraced_process(int pid, int reap_child); | 194 | extern void os_kill_ptraced_process(int pid, int reap_child); |
195 | #ifdef UML_CONFIG_MODE_TT | ||
195 | extern void os_usr1_process(int pid); | 196 | extern void os_usr1_process(int pid); |
197 | #endif | ||
196 | extern long os_ptrace_ldt(long pid, long addr, long data); | 198 | extern long os_ptrace_ldt(long pid, long addr, long data); |
197 | 199 | ||
198 | extern int os_getpid(void); | 200 | extern int os_getpid(void); |
@@ -261,7 +263,6 @@ extern void block_signals(void); | |||
261 | extern void unblock_signals(void); | 263 | extern void unblock_signals(void); |
262 | extern int get_signals(void); | 264 | extern int get_signals(void); |
263 | extern int set_signals(int enable); | 265 | extern int set_signals(int enable); |
264 | extern void os_usr1_signal(int on); | ||
265 | 266 | ||
266 | /* trap.c */ | 267 | /* trap.c */ |
267 | extern void os_fill_handlinfo(struct kern_handlers h); | 268 | extern void os_fill_handlinfo(struct kern_handlers h); |
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h index 66cb400c2c92..62403bd99661 100644 --- a/arch/um/include/sysdep-x86_64/ptrace.h +++ b/arch/um/include/sysdep-x86_64/ptrace.h | |||
@@ -104,10 +104,6 @@ union uml_pt_regs { | |||
104 | #endif | 104 | #endif |
105 | #ifdef UML_CONFIG_MODE_SKAS | 105 | #ifdef UML_CONFIG_MODE_SKAS |
106 | struct skas_regs { | 106 | struct skas_regs { |
107 | /* x86_64 ptrace uses sizeof(user_regs_struct) as its register | ||
108 | * file size, while i386 uses FRAME_SIZE. Therefore, we need | ||
109 | * to use UM_FRAME_SIZE here instead of HOST_FRAME_SIZE. | ||
110 | */ | ||
111 | unsigned long regs[MAX_REG_NR]; | 107 | unsigned long regs[MAX_REG_NR]; |
112 | unsigned long fp[HOST_FP_SIZE]; | 108 | unsigned long fp[HOST_FP_SIZE]; |
113 | struct faultinfo faultinfo; | 109 | struct faultinfo faultinfo; |
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 50a288bb875a..dbf2f5bc842f 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -142,6 +142,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
142 | .events = events, | 142 | .events = events, |
143 | .current_events = 0 } ); | 143 | .current_events = 0 } ); |
144 | 144 | ||
145 | err = -EBUSY; | ||
145 | spin_lock_irqsave(&irq_lock, flags); | 146 | spin_lock_irqsave(&irq_lock, flags); |
146 | for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { | 147 | for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { |
147 | if ((irq_fd->fd == fd) && (irq_fd->type == type)) { | 148 | if ((irq_fd->fd == fd) && (irq_fd->type == type)) { |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index e85d65deea0d..df7d662b98ce 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -64,8 +64,6 @@ static void setup_highmem(unsigned long highmem_start, | |||
64 | 64 | ||
65 | void mem_init(void) | 65 | void mem_init(void) |
66 | { | 66 | { |
67 | max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; | ||
68 | |||
69 | /* clear the zero-page */ | 67 | /* clear the zero-page */ |
70 | memset((void *) empty_zero_page, 0, PAGE_SIZE); | 68 | memset((void *) empty_zero_page, 0, PAGE_SIZE); |
71 | 69 | ||
@@ -80,6 +78,7 @@ void mem_init(void) | |||
80 | 78 | ||
81 | /* this will put all low memory onto the freelists */ | 79 | /* this will put all low memory onto the freelists */ |
82 | totalram_pages = free_all_bootmem(); | 80 | totalram_pages = free_all_bootmem(); |
81 | max_low_pfn = totalram_pages; | ||
83 | #ifdef CONFIG_HIGHMEM | 82 | #ifdef CONFIG_HIGHMEM |
84 | totalhigh_pages = highmem >> PAGE_SHIFT; | 83 | totalhigh_pages = highmem >> PAGE_SHIFT; |
85 | totalram_pages += totalhigh_pages; | 84 | totalram_pages += totalhigh_pages; |
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index c692a192957a..76bdd6712417 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "longjmp.h" | 21 | #include "longjmp.h" |
22 | #include "skas_ptrace.h" | 22 | #include "skas_ptrace.h" |
23 | #include "kern_constants.h" | 23 | #include "kern_constants.h" |
24 | #include "uml-config.h" | ||
24 | 25 | ||
25 | #define ARBITRARY_ADDR -1 | 26 | #define ARBITRARY_ADDR -1 |
26 | #define FAILURE_PID -1 | 27 | #define FAILURE_PID -1 |
@@ -131,10 +132,12 @@ void os_kill_ptraced_process(int pid, int reap_child) | |||
131 | CATCH_EINTR(waitpid(pid, NULL, 0)); | 132 | CATCH_EINTR(waitpid(pid, NULL, 0)); |
132 | } | 133 | } |
133 | 134 | ||
135 | #ifdef UML_CONFIG_MODE_TT | ||
134 | void os_usr1_process(int pid) | 136 | void os_usr1_process(int pid) |
135 | { | 137 | { |
136 | kill(pid, SIGUSR1); | 138 | kill(pid, SIGUSR1); |
137 | } | 139 | } |
140 | #endif | ||
138 | 141 | ||
139 | /* Don't use the glibc version, which caches the result in TLS. It misses some | 142 | /* Don't use the glibc version, which caches the result in TLS. It misses some |
140 | * syscalls, and also breaks with clone(), which does not unshare the TLS. | 143 | * syscalls, and also breaks with clone(), which does not unshare the TLS. |
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index b897e8592d77..266768629fee 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c | |||
@@ -243,8 +243,3 @@ int set_signals(int enable) | |||
243 | 243 | ||
244 | return ret; | 244 | return ret; |
245 | } | 245 | } |
246 | |||
247 | void os_usr1_signal(int on) | ||
248 | { | ||
249 | change_sig(SIGUSR1, on); | ||
250 | } | ||
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c index b3c11cfa995a..9383e8751ae7 100644 --- a/arch/um/os-Linux/skas/mem.c +++ b/arch/um/os-Linux/skas/mem.c | |||
@@ -48,7 +48,7 @@ int multi_op_count = 0; | |||
48 | static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) | 48 | static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) |
49 | { | 49 | { |
50 | unsigned long regs[MAX_REG_NR]; | 50 | unsigned long regs[MAX_REG_NR]; |
51 | int n; | 51 | int n, i; |
52 | long ret, offset; | 52 | long ret, offset; |
53 | unsigned long * data; | 53 | unsigned long * data; |
54 | unsigned long * syscall; | 54 | unsigned long * syscall; |
@@ -66,9 +66,13 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) | |||
66 | (unsigned long) &__syscall_stub_start); | 66 | (unsigned long) &__syscall_stub_start); |
67 | 67 | ||
68 | n = ptrace_setregs(pid, regs); | 68 | n = ptrace_setregs(pid, regs); |
69 | if(n < 0) | 69 | if(n < 0){ |
70 | printk("Registers - \n"); | ||
71 | for(i = 0; i < MAX_REG_NR; i++) | ||
72 | printk("\t%d\t0x%lx\n", i, regs[i]); | ||
70 | panic("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n", | 73 | panic("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n", |
71 | n); | 74 | -n); |
75 | } | ||
72 | 76 | ||
73 | wait_stub_done(pid, 0, "do_syscall_stub"); | 77 | wait_stub_done(pid, 0, "do_syscall_stub"); |
74 | 78 | ||
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index dda06789bcb0..0564422c155f 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -67,7 +67,7 @@ void wait_stub_done(int pid, int sig, char * fname) | |||
67 | 67 | ||
68 | if((n < 0) || !WIFSTOPPED(status) || | 68 | if((n < 0) || !WIFSTOPPED(status) || |
69 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ | 69 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ |
70 | unsigned long regs[HOST_FRAME_SIZE]; | 70 | unsigned long regs[MAX_REG_NR]; |
71 | 71 | ||
72 | if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) | 72 | if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) |
73 | printk("Failed to get registers from stub, " | 73 | printk("Failed to get registers from stub, " |
@@ -76,7 +76,7 @@ void wait_stub_done(int pid, int sig, char * fname) | |||
76 | int i; | 76 | int i; |
77 | 77 | ||
78 | printk("Stub registers -\n"); | 78 | printk("Stub registers -\n"); |
79 | for(i = 0; i < HOST_FRAME_SIZE; i++) | 79 | for(i = 0; i < ARRAY_SIZE(regs); i++) |
80 | printk("\t%d - %lx\n", i, regs[i]); | 80 | printk("\t%d - %lx\n", i, regs[i]); |
81 | } | 81 | } |
82 | panic("%s : failed to wait for SIGUSR1/SIGTRAP, " | 82 | panic("%s : failed to wait for SIGUSR1/SIGTRAP, " |
@@ -328,7 +328,7 @@ void userspace(union uml_pt_regs *regs) | |||
328 | int copy_context_skas0(unsigned long new_stack, int pid) | 328 | int copy_context_skas0(unsigned long new_stack, int pid) |
329 | { | 329 | { |
330 | int err; | 330 | int err; |
331 | unsigned long regs[HOST_FRAME_SIZE]; | 331 | unsigned long regs[MAX_REG_NR]; |
332 | unsigned long fp_regs[HOST_FP_SIZE]; | 332 | unsigned long fp_regs[HOST_FP_SIZE]; |
333 | unsigned long current_stack = current_stub_stack(); | 333 | unsigned long current_stack = current_stub_stack(); |
334 | struct stub_data *data = (struct stub_data *) current_stack; | 334 | struct stub_data *data = (struct stub_data *) current_stack; |
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c index 79cd93c8c5ed..84b44f9cd42a 100644 --- a/arch/um/os-Linux/sys-i386/registers.c +++ b/arch/um/os-Linux/sys-i386/registers.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | /* These are set once at boot time and not changed thereafter */ | 16 | /* These are set once at boot time and not changed thereafter */ |
17 | 17 | ||
18 | static unsigned long exec_regs[HOST_FRAME_SIZE]; | 18 | static unsigned long exec_regs[MAX_REG_NR]; |
19 | static unsigned long exec_fp_regs[HOST_FP_SIZE]; | 19 | static unsigned long exec_fp_regs[HOST_FP_SIZE]; |
20 | static unsigned long exec_fpx_regs[HOST_XFP_SIZE]; | 20 | static unsigned long exec_fpx_regs[HOST_XFP_SIZE]; |
21 | static int have_fpx_regs = 1; | 21 | static int have_fpx_regs = 1; |
@@ -101,6 +101,7 @@ void init_registers(int pid) | |||
101 | { | 101 | { |
102 | int err; | 102 | int err; |
103 | 103 | ||
104 | memset(exec_regs, 0, sizeof(exec_regs)); | ||
104 | err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); | 105 | err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); |
105 | if(err) | 106 | if(err) |
106 | panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", | 107 | panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", |
@@ -124,7 +125,7 @@ void init_registers(int pid) | |||
124 | 125 | ||
125 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) | 126 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) |
126 | { | 127 | { |
127 | memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); | 128 | memcpy(regs, exec_regs, sizeof(exec_regs)); |
128 | if(fp_regs != NULL) | 129 | if(fp_regs != NULL) |
129 | memcpy(fp_regs, exec_fp_regs, | 130 | memcpy(fp_regs, exec_fp_regs, |
130 | HOST_FP_SIZE * sizeof(unsigned long)); | 131 | HOST_FP_SIZE * sizeof(unsigned long)); |
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c index a2d7e0c603f7..e6fc2179d1bc 100644 --- a/arch/um/os-Linux/sys-x86_64/registers.c +++ b/arch/um/os-Linux/sys-x86_64/registers.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | /* These are set once at boot time and not changed thereafter */ | 15 | /* These are set once at boot time and not changed thereafter */ |
16 | 16 | ||
17 | static unsigned long exec_regs[HOST_FRAME_SIZE]; | 17 | static unsigned long exec_regs[MAX_REG_NR]; |
18 | static unsigned long exec_fp_regs[HOST_FP_SIZE]; | 18 | static unsigned long exec_fp_regs[HOST_FP_SIZE]; |
19 | 19 | ||
20 | void init_thread_registers(union uml_pt_regs *to) | 20 | void init_thread_registers(union uml_pt_regs *to) |
@@ -72,7 +72,7 @@ void init_registers(int pid) | |||
72 | 72 | ||
73 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) | 73 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) |
74 | { | 74 | { |
75 | memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); | 75 | memcpy(regs, exec_regs, sizeof(exec_regs)); |
76 | if(fp_regs != NULL) | 76 | if(fp_regs != NULL) |
77 | memcpy(fp_regs, exec_fp_regs, | 77 | memcpy(fp_regs, exec_fp_regs, |
78 | HOST_FP_SIZE * sizeof(unsigned long)); | 78 | HOST_FP_SIZE * sizeof(unsigned long)); |
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules index 813077fb1e5b..a9a4b85ca516 100644 --- a/arch/um/scripts/Makefile.rules +++ b/arch/um/scripts/Makefile.rules | |||
@@ -10,7 +10,7 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) | |||
10 | $(USER_OBJS:.o=.%): \ | 10 | $(USER_OBJS:.o=.%): \ |
11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) | 11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) |
12 | $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ | 12 | $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ |
13 | -Dunix -D__unix__ -D__$(SUBARCH)__ | 13 | -Dunix -D__unix__ -D__$(SUBARCH)__ $(CF) |
14 | 14 | ||
15 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of | 15 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of |
16 | # using it directly. | 16 | # using it directly. |
@@ -19,7 +19,7 @@ UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file)) | |||
19 | $(UNPROFILE_OBJS:.o=.%): \ | 19 | $(UNPROFILE_OBJS:.o=.%): \ |
20 | c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) | 20 | c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) |
21 | $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ | 21 | $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ |
22 | -Dunix -D__unix__ -D__$(SUBARCH)__ | 22 | -Dunix -D__unix__ -D__$(SUBARCH)__ $(CF) |
23 | 23 | ||
24 | # The stubs and unmap.o can't try to call mcount or update basic block data | 24 | # The stubs and unmap.o can't try to call mcount or update basic block data |
25 | define unprofile | 25 | define unprofile |
diff --git a/arch/um/sys-i386/delay.c b/arch/um/sys-i386/delay.c index 2c11b9770e8b..d623e074f41d 100644 --- a/arch/um/sys-i386/delay.c +++ b/arch/um/sys-i386/delay.c | |||
@@ -27,14 +27,3 @@ void __udelay(unsigned long usecs) | |||
27 | } | 27 | } |
28 | 28 | ||
29 | EXPORT_SYMBOL(__udelay); | 29 | EXPORT_SYMBOL(__udelay); |
30 | |||
31 | void __const_udelay(unsigned long usecs) | ||
32 | { | ||
33 | int i, n; | ||
34 | |||
35 | n = (loops_per_jiffy * HZ * usecs) / MILLION; | ||
36 | for(i=0;i<n;i++) | ||
37 | cpu_relax(); | ||
38 | } | ||
39 | |||
40 | EXPORT_SYMBOL(__const_udelay); | ||
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c index 4a8b4202ef9e..a939a7ef0227 100644 --- a/arch/um/sys-i386/ldt.c +++ b/arch/um/sys-i386/ldt.c | |||
@@ -394,7 +394,8 @@ static short * host_ldt_entries = NULL; | |||
394 | static void ldt_get_host_info(void) | 394 | static void ldt_get_host_info(void) |
395 | { | 395 | { |
396 | long ret; | 396 | long ret; |
397 | struct ldt_entry * ldt, *tmp; | 397 | struct ldt_entry * ldt; |
398 | short *tmp; | ||
398 | int i, size, k, order; | 399 | int i, size, k, order; |
399 | 400 | ||
400 | spin_lock(&host_ldt_lock); | 401 | spin_lock(&host_ldt_lock); |
diff --git a/arch/um/sys-x86_64/delay.c b/arch/um/sys-x86_64/delay.c index 137f4446b439..dee5be66da82 100644 --- a/arch/um/sys-x86_64/delay.c +++ b/arch/um/sys-x86_64/delay.c | |||
@@ -28,14 +28,3 @@ void __udelay(unsigned long usecs) | |||
28 | } | 28 | } |
29 | 29 | ||
30 | EXPORT_SYMBOL(__udelay); | 30 | EXPORT_SYMBOL(__udelay); |
31 | |||
32 | void __const_udelay(unsigned long usecs) | ||
33 | { | ||
34 | unsigned long i, n; | ||
35 | |||
36 | n = (loops_per_jiffy * HZ * usecs) / MILLION; | ||
37 | for(i=0;i<n;i++) | ||
38 | cpu_relax(); | ||
39 | } | ||
40 | |||
41 | EXPORT_SYMBOL(__const_udelay); | ||
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 01b91f9fa789..b3f6350cac44 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -103,6 +103,9 @@ long arch_prctl_skas(struct task_struct *task, int code, | |||
103 | 103 | ||
104 | switch(code){ | 104 | switch(code){ |
105 | case ARCH_SET_FS: | 105 | case ARCH_SET_FS: |
106 | current->thread.arch.fs = (unsigned long) ptr; | ||
107 | save_registers(pid, ¤t->thread.regs.regs); | ||
108 | break; | ||
106 | case ARCH_SET_GS: | 109 | case ARCH_SET_GS: |
107 | save_registers(pid, ¤t->thread.regs.regs); | 110 | save_registers(pid, ¤t->thread.regs.regs); |
108 | break; | 111 | break; |
@@ -140,9 +143,8 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
140 | 143 | ||
141 | void arch_switch_to_skas(struct task_struct *from, struct task_struct *to) | 144 | void arch_switch_to_skas(struct task_struct *from, struct task_struct *to) |
142 | { | 145 | { |
143 | if(to->thread.arch.fs == 0) | 146 | if((to->thread.arch.fs == 0) || (to->mm == NULL)) |
144 | return; | 147 | return; |
145 | 148 | ||
146 | arch_prctl_skas(to, ARCH_SET_FS, (void __user *) to->thread.arch.fs); | 149 | arch_prctl_skas(to, ARCH_SET_FS, (void __user *) to->thread.arch.fs); |
147 | } | 150 | } |
148 | |||