From: James S. <jsi...@us...> - 2002-01-28 20:32:29
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv7656/arch/mips/kernel Modified Files: Makefile smp.c Log Message: Big overhaul of 64-bit kernel along the lines of what we already have for the 64-bit kernel just more radical. Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/Makefile,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Makefile 2002/01/19 21:17:35 1.18 +++ Makefile 2002/01/28 20:31:56 1.19 @@ -60,13 +60,13 @@ obj-$(CONFIG_BINFMT_IRIX) += irixelf.o irixioctl.o irixsig.o sysirix.o \ irixinv.o obj-$(CONFIG_REMOTE_DEBUG) += gdb-low.o gdb-stub.o -obj-$(CONFIG_PCI) += pci-dma.o obj-$(CONFIG_PROC_FS) += proc.o -ifdef CONFIG_PCI -obj-$(CONFIG_NEW_PCI) += pci.o -obj-$(CONFIG_PCI_AUTO) += pci_auto.o +obj-$(CONFIG_NEW_PCI) += pci.o +ifndef CONFIG_MAPPED_PCI_IO +obj-y += pci-dma.o endif +obj-$(CONFIG_PCI_AUTO) += pci_auto.o entry.o: entry.S head.o: head.S Index: smp.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/smp.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- smp.c 2002/01/02 20:42:11 1.12 +++ smp.c 2002/01/28 20:31:56 1.13 @@ -46,9 +46,10 @@ int smp_num_cpus = 1; /* Number that came online. */ cpumask_t cpu_online_map; /* Bitmask of currently online CPUs */ struct cpuinfo_mips cpu_data[NR_CPUS]; -void (*volatile smp_cpu0_finalize)(void) = NULL; +void (*volatile smp_cpu0_finalize)(void); -static atomic_t cpus_booted = ATOMIC_INIT(0); +// static atomic_t cpus_booted = ATOMIC_INIT(0); +atomic_t cpus_booted = ATOMIC_INIT(0); /* These are defined by the board-specific code. */ @@ -106,76 +107,6 @@ return 0; } -void __init smp_boot_cpus(void) -{ - int i; - - smp_num_cpus = prom_setup_smp(); - init_new_context(current, &init_mm); - current->processor = 0; - cpu_data[0].udelay_val = loops_per_jiffy; - cpu_data[0].asid_cache = ASID_FIRST_VERSION; - CPUMASK_CLRALL(cpu_online_map); - CPUMASK_SETB(cpu_online_map, 0); - atomic_set(&cpus_booted, 1); /* Master CPU is already booted... */ - init_idle(); - for (i = 1; i < smp_num_cpus; i++) { - struct task_struct *p; - struct pt_regs regs; - printk("Starting CPU %d... ", i); - - /* Spawn a new process normally. Grab a pointer to - its task struct so we can mess with it */ - do_fork(CLONE_VM|CLONE_PID, 0, ®s, 0); - p = init_task.prev_task; - - /* Schedule the first task manually */ - p->processor = i; - p->cpus_runnable = 1 << i; /* we schedule the first task manually */ - - /* Attach to the address space of init_task. */ - atomic_inc(&init_mm.mm_count); - p->active_mm = &init_mm; - init_tasks[i] = p; - - del_from_runqueue(p); - unhash_process(p); - - prom_boot_secondary(i, - (unsigned long)p + KERNEL_STACK_SIZE - 32, - (unsigned long)p); - -#if 0 - /* This is copied from the ip-27 code in the mips64 tree */ - - struct task_struct *p; - - /* - * The following code is purely to make sure - * Linux can schedule processes on this slave. - */ - kernel_thread(0, NULL, CLONE_PID); - p = init_task.prev_task; - sprintf(p->comm, "%s%d", "Idle", i); - init_tasks[i] = p; - p->processor = i; - p->cpus_runnable = 1 << i; /* we schedule the first task manually */ - del_from_runqueue(p); - unhash_process(p); - /* Attach to the address space of init_task. */ - atomic_inc(&init_mm.mm_count); - p->active_mm = &init_mm; - prom_boot_secondary(i, - (unsigned long)p + KERNEL_STACK_SIZE - 32, - (unsigned long)p); -#endif - } - - /* Wait for everyone to come up */ - while (atomic_read(&cpus_booted) != smp_num_cpus); - smp_threads_ready = 1; -} - void __init smp_commence(void) { /* Not sure what to do here yet */ @@ -238,7 +169,9 @@ void (*func) (void *info) = call_data->func; void *info = call_data->info; int wait = call_data->wait; + int cpu = smp_processor_id(); + irq_enter(cpu, 0); /* XXX choose an irq number? */ /* * Notify initiating CPU that I've grabbed the data * and am about to execute the function @@ -254,6 +187,7 @@ mb(); atomic_inc(&call_data->finished); } + irq_exit(cpu, 0); /* XXX choose an irq number? */ } static void stop_this_cpu(void *dummy) |