Pull acpica into release branch
[pandora-kernel.git] / arch / um / kernel / process_kern.c
index e167cf0..f6a5a50 100644 (file)
@@ -156,9 +156,25 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
                unsigned long stack_top, struct task_struct * p, 
                struct pt_regs *regs)
 {
+       int ret;
+
        p->thread = (struct thread_struct) INIT_THREAD;
-       return(CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr, 
-                               clone_flags, sp, stack_top, p, regs));
+       ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
+                               clone_flags, sp, stack_top, p, regs);
+
+       if (ret || !current->thread.forking)
+               goto out;
+
+       clear_flushed_tls(p);
+
+       /*
+        * Set a new TLS for the child thread?
+        */
+       if (clone_flags & CLONE_SETTLS)
+               ret = arch_copy_tls(p);
+
+out:
+       return ret;
 }
 
 void initial_thread_cb(void (*proc)(void *), void *arg)
@@ -185,10 +201,6 @@ void default_idle(void)
 {
        CHOOSE_MODE(uml_idle_timer(), (void) 0);
 
-       atomic_inc(&init_mm.mm_count);
-       current->mm = &init_mm;
-       current->active_mm = &init_mm;
-
        while(1){
                /* endless idle loop with no priority at all */
 
@@ -287,17 +299,27 @@ EXPORT_SYMBOL(disable_hlt);
 
 void *um_kmalloc(int size)
 {
-       return(kmalloc(size, GFP_KERNEL));
+       return kmalloc(size, GFP_KERNEL);
 }
 
 void *um_kmalloc_atomic(int size)
 {
-       return(kmalloc(size, GFP_ATOMIC));
+       return kmalloc(size, GFP_ATOMIC);
 }
 
 void *um_vmalloc(int size)
 {
-       return(vmalloc(size));
+       return vmalloc(size);
+}
+
+void *um_vmalloc_atomic(int size)
+{
+       return __vmalloc(size, GFP_ATOMIC | __GFP_HIGHMEM, PAGE_KERNEL);
+}
+
+int __cant_sleep(void) {
+       return in_atomic() || irqs_disabled() || in_interrupt();
+       /* Is in_interrupt() really needed? */
 }
 
 unsigned long get_fault_addr(void)
@@ -369,11 +391,6 @@ int smp_sigio_handler(void)
        return(0);
 }
 
-int um_in_interrupt(void)
-{
-       return(in_interrupt());
-}
-
 int cpu(void)
 {
        return(current_thread->cpu);
@@ -402,7 +419,7 @@ static int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int
        return strlen(buf);
 }
 
-static int proc_write_sysemu(struct file *file,const char *buf, unsigned long count,void *data)
+static int proc_write_sysemu(struct file *file,const char __user *buf, unsigned long count,void *data)
 {
        char tmp[2];