aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/Kconfig.common4
-rw-r--r--arch/um/drivers/chan_kern.c8
-rw-r--r--arch/um/drivers/hostaudio_kern.c6
-rw-r--r--arch/um/drivers/net_kern.c10
-rw-r--r--arch/um/include/asm/pgtable-3level.h4
-rw-r--r--arch/um/kernel/ptrace.c21
-rw-r--r--arch/um/kernel/time.c16
7 files changed, 22 insertions, 47 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 0d207e73a758..7c8e277f6d34 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -55,10 +55,6 @@ config GENERIC_BUG
55 default y 55 default y
56 depends on BUG 56 depends on BUG
57 57
58config GENERIC_TIME
59 bool
60 default y
61
62config GENERIC_CLOCKEVENTS 58config GENERIC_CLOCKEVENTS
63 bool 59 bool
64 default y 60 default y
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 6e51424745ab..25e1965df7ce 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -210,9 +210,9 @@ void free_irqs(void)
210 list_for_each(ele, &list) { 210 list_for_each(ele, &list) {
211 chan = list_entry(ele, struct chan, free_list); 211 chan = list_entry(ele, struct chan, free_list);
212 212
213 if (chan->input) 213 if (chan->input && chan->enabled)
214 free_irq(chan->line->driver->read_irq, chan); 214 free_irq(chan->line->driver->read_irq, chan);
215 if (chan->output) 215 if (chan->output && chan->enabled)
216 free_irq(chan->line->driver->write_irq, chan); 216 free_irq(chan->line->driver->write_irq, chan);
217 chan->enabled = 0; 217 chan->enabled = 0;
218 } 218 }
@@ -231,9 +231,9 @@ static void close_one_chan(struct chan *chan, int delay_free_irq)
231 spin_unlock_irqrestore(&irqs_to_free_lock, flags); 231 spin_unlock_irqrestore(&irqs_to_free_lock, flags);
232 } 232 }
233 else { 233 else {
234 if (chan->input) 234 if (chan->input && chan->enabled)
235 free_irq(chan->line->driver->read_irq, chan); 235 free_irq(chan->line->driver->read_irq, chan);
236 if (chan->output) 236 if (chan->output && chan->enabled)
237 free_irq(chan->line->driver->write_irq, chan); 237 free_irq(chan->line->driver->write_irq, chan);
238 chan->enabled = 0; 238 chan->enabled = 0;
239 } 239 }
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index ae42695c3597..68142df76608 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -8,6 +8,7 @@
8#include "linux/slab.h" 8#include "linux/slab.h"
9#include "linux/sound.h" 9#include "linux/sound.h"
10#include "linux/soundcard.h" 10#include "linux/soundcard.h"
11#include "linux/smp_lock.h"
11#include "asm/uaccess.h" 12#include "asm/uaccess.h"
12#include "init.h" 13#include "init.h"
13#include "os.h" 14#include "os.h"
@@ -198,7 +199,10 @@ static int hostaudio_open(struct inode *inode, struct file *file)
198 if (file->f_mode & FMODE_WRITE) 199 if (file->f_mode & FMODE_WRITE)
199 w = 1; 200 w = 1;
200 201
202 lock_kernel();
201 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); 203 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
204 unlock_kernel();
205
202 if (ret < 0) { 206 if (ret < 0) {
203 kfree(state); 207 kfree(state);
204 return ret; 208 return ret;
@@ -254,7 +258,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
254 if (file->f_mode & FMODE_WRITE) 258 if (file->f_mode & FMODE_WRITE)
255 w = 1; 259 w = 1;
256 260
261 lock_kernel();
257 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); 262 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
263 unlock_kernel();
258 264
259 if (ret < 0) { 265 if (ret < 0) {
260 printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', " 266 printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', "
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index f05372694233..2ab233ba32c1 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -25,11 +25,6 @@
25#include "net_kern.h" 25#include "net_kern.h"
26#include "net_user.h" 26#include "net_user.h"
27 27
28static inline void set_ether_mac(struct net_device *dev, unsigned char *addr)
29{
30 memcpy(dev->dev_addr, addr, ETH_ALEN);
31}
32
33#define DRIVER_NAME "uml-netdev" 28#define DRIVER_NAME "uml-netdev"
34 29
35static DEFINE_SPINLOCK(opened_lock); 30static DEFINE_SPINLOCK(opened_lock);
@@ -266,7 +261,7 @@ static int uml_net_set_mac(struct net_device *dev, void *addr)
266 struct sockaddr *hwaddr = addr; 261 struct sockaddr *hwaddr = addr;
267 262
268 spin_lock_irq(&lp->lock); 263 spin_lock_irq(&lp->lock);
269 set_ether_mac(dev, hwaddr->sa_data); 264 eth_mac_addr(dev, hwaddr->sa_data);
270 spin_unlock_irq(&lp->lock); 265 spin_unlock_irq(&lp->lock);
271 266
272 return 0; 267 return 0;
@@ -380,7 +375,6 @@ static const struct net_device_ops uml_netdev_ops = {
380 .ndo_tx_timeout = uml_net_tx_timeout, 375 .ndo_tx_timeout = uml_net_tx_timeout,
381 .ndo_set_mac_address = uml_net_set_mac, 376 .ndo_set_mac_address = uml_net_set_mac,
382 .ndo_change_mtu = uml_net_change_mtu, 377 .ndo_change_mtu = uml_net_change_mtu,
383 .ndo_set_mac_address = eth_mac_addr,
384 .ndo_validate_addr = eth_validate_addr, 378 .ndo_validate_addr = eth_validate_addr,
385}; 379};
386 380
@@ -478,7 +472,7 @@ static void eth_configure(int n, void *init, char *mac,
478 ((*transport->user->init)(&lp->user, dev) != 0)) 472 ((*transport->user->init)(&lp->user, dev) != 0))
479 goto out_unregister; 473 goto out_unregister;
480 474
481 set_ether_mac(dev, device->mac); 475 eth_mac_addr(dev, device->mac);
482 dev->mtu = transport->user->mtu; 476 dev->mtu = transport->user->mtu;
483 dev->netdev_ops = &uml_netdev_ops; 477 dev->netdev_ops = &uml_netdev_ops;
484 dev->ethtool_ops = &uml_net_ethtool_ops; 478 dev->ethtool_ops = &uml_net_ethtool_ops;
diff --git a/arch/um/include/asm/pgtable-3level.h b/arch/um/include/asm/pgtable-3level.h
index 084de4a9fc70..0032f9212e74 100644
--- a/arch/um/include/asm/pgtable-3level.h
+++ b/arch/um/include/asm/pgtable-3level.h
@@ -60,7 +60,7 @@
60 set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd))) 60 set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd)))
61 61
62#ifdef CONFIG_64BIT 62#ifdef CONFIG_64BIT
63#define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval)) 63#define set_pud(pudptr, pudval) set_64bit((u64 *) (pudptr), pud_val(pudval))
64#else 64#else
65#define set_pud(pudptr, pudval) (*(pudptr) = (pudval)) 65#define set_pud(pudptr, pudval) (*(pudptr) = (pudval))
66#endif 66#endif
@@ -73,7 +73,7 @@ static inline int pgd_newpage(pgd_t pgd)
73static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } 73static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }
74 74
75#ifdef CONFIG_64BIT 75#ifdef CONFIG_64BIT
76#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) 76#define set_pmd(pmdptr, pmdval) set_64bit((u64 *) (pmdptr), pmd_val(pmdval))
77#else 77#else
78#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) 78#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
79#endif 79#endif
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 484509948ee9..e0510496596c 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -7,9 +7,6 @@
7#include "linux/ptrace.h" 7#include "linux/ptrace.h"
8#include "linux/sched.h" 8#include "linux/sched.h"
9#include "asm/uaccess.h" 9#include "asm/uaccess.h"
10#ifdef CONFIG_PROC_MM
11#include "proc_mm.h"
12#endif
13#include "skas_ptrace.h" 10#include "skas_ptrace.h"
14 11
15 12
@@ -158,24 +155,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
158 break; 155 break;
159 } 156 }
160#endif 157#endif
161#ifdef CONFIG_PROC_MM
162 case PTRACE_SWITCH_MM: {
163 struct mm_struct *old = child->mm;
164 struct mm_struct *new = proc_mm_get_mm(data);
165
166 if (IS_ERR(new)) {
167 ret = PTR_ERR(new);
168 break;
169 }
170
171 atomic_inc(&new->mm_users);
172 child->mm = new;
173 child->active_mm = new;
174 mmput(old);
175 ret = 0;
176 break;
177 }
178#endif
179#ifdef PTRACE_ARCH_PRCTL 158#ifdef PTRACE_ARCH_PRCTL
180 case PTRACE_ARCH_PRCTL: 159 case PTRACE_ARCH_PRCTL:
181 /* XXX Calls ptrace on the host - needs some SMP thinking */ 160 /* XXX Calls ptrace on the host - needs some SMP thinking */
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index c8b9c469fcd7..a08d9fab81f2 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -102,16 +102,16 @@ static void __init setup_itimer(void)
102 clockevents_register_device(&itimer_clockevent); 102 clockevents_register_device(&itimer_clockevent);
103} 103}
104 104
105void __init time_init(void) 105void read_persistent_clock(struct timespec *ts)
106{ 106{
107 long long nsecs; 107 long long nsecs = os_nsecs();
108
109 timer_init();
110 108
111 nsecs = os_nsecs(); 109 set_normalized_timespec(ts, nsecs / NSEC_PER_SEC,
112 set_normalized_timespec(&wall_to_monotonic, -nsecs / NSEC_PER_SEC,
113 -nsecs % NSEC_PER_SEC);
114 set_normalized_timespec(&xtime, nsecs / NSEC_PER_SEC,
115 nsecs % NSEC_PER_SEC); 110 nsecs % NSEC_PER_SEC);
111}
112
113void __init time_init(void)
114{
115 timer_init();
116 late_time_init = setup_itimer; 116 late_time_init = setup_itimer;
117} 117}