uml: start fixing os_read_file and os_write_file
[powerpc.git] / arch / um / kernel / smp.c
index c8d8d0a..47b6908 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/percpu.h"
 #include "asm/pgalloc.h"
 #include "asm/tlb.h"
@@ -22,7 +21,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 #include "asm/smp.h"
 #include "asm/processor.h"
 #include "asm/spinlock.h"
-#include "user_util.h"
 #include "kern_util.h"
 #include "kern.h"
 #include "irq_user.h"
@@ -49,7 +47,7 @@ struct task_struct *idle_threads[NR_CPUS];
 
 void smp_send_reschedule(int cpu)
 {
-       os_write_file(cpu_data[cpu].ipi_pipe[1], "R", 1);
+       os_write_file_k(cpu_data[cpu].ipi_pipe[1], "R", 1);
        num_reschedules_sent++;
 }
 
@@ -61,7 +59,7 @@ void smp_send_stop(void)
        for(i = 0; i < num_online_cpus(); i++){
                if(i == current_thread->cpu)
                        continue;
-               os_write_file(cpu_data[i].ipi_pipe[1], "S", 1);
+               os_write_file_k(cpu_data[i].ipi_pipe[1], "S", 1);
        }
        printk("done\n");
 }
@@ -110,8 +108,8 @@ static struct task_struct *idle_thread(int cpu)
                          { .pid =      new_task->thread.mode.tt.extern_pid,
                            .task =     new_task } );
        idle_threads[cpu] = new_task;
-       CHOOSE_MODE(os_write_file(new_task->thread.mode.tt.switch_pipe[1], &c,
-                         sizeof(c)),
+       CHOOSE_MODE(os_write_file_k(new_task->thread.mode.tt.switch_pipe[1], &c,
+                                   sizeof(c)),
                    ({ panic("skas mode doesn't support SMP"); }));
        return(new_task);
 }
@@ -143,7 +141,6 @@ void smp_prepare_cpus(unsigned int maxcpus)
                idle = idle_thread(cpu);
 
                init_idle(idle, cpu);
-               unhash_process(idle);
 
                waittime = 200000000;
                while (waittime-- && !cpu_isset(cpu, cpu_callin_map))
@@ -182,7 +179,7 @@ void IPI_handler(int cpu)
        int fd;
 
        fd = cpu_data[cpu].ipi_pipe[0];
-       while (os_read_file(fd, &c, 1) == 1) {
+       while (os_read_file_k(fd, &c, 1) == 1) {
                switch (c) {
                case 'C':
                        smp_call_function_slave(cpu);
@@ -242,7 +239,7 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
        info = _info;
 
        for_each_online_cpu(i)
-               os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
+               os_write_file_k(cpu_data[i].ipi_pipe[1], "C", 1);
 
        while (atomic_read(&scf_started) != cpus)
                barrier();