VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / arch / parisc / kernel / smp.c
1 /*
2 ** SMP Support
3 **
4 ** Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
5 ** Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
6 ** Copyright (C) 2001,2004 Grant Grundler <grundler@parisc-linux.org>
7 ** 
8 ** Lots of stuff stolen from arch/alpha/kernel/smp.c
9 ** ...and then parisc stole from arch/ia64/kernel/smp.c. Thanks David! :^)
10 **
11 ** Thanks to John Curry and Ullas Ponnadi. I learned alot from their work.
12 ** -grant (1/12/2001)
13 **
14 **      This program is free software; you can redistribute it and/or modify
15 **      it under the terms of the GNU General Public License as published by
16 **      the Free Software Foundation; either version 2 of the License, or
17 **      (at your option) any later version.
18 */
19 #undef ENTRY_SYS_CPUS   /* syscall support for iCOD-like functionality */
20
21 #include <linux/autoconf.h>
22
23 #include <linux/types.h>
24 #include <linux/spinlock.h>
25 #include <linux/slab.h>
26
27 #include <linux/kernel.h>
28 #include <linux/module.h>
29 #include <linux/sched.h>
30 #include <linux/init.h>
31 #include <linux/interrupt.h>
32 #include <linux/smp.h>
33 #include <linux/kernel_stat.h>
34 #include <linux/mm.h>
35 #include <linux/delay.h>
36
37 #include <asm/system.h>
38 #include <asm/atomic.h>
39 #include <asm/bitops.h>
40 #include <asm/current.h>
41 #include <asm/delay.h>
42 #include <asm/pgalloc.h>        /* for flush_tlb_all() proto/macro */
43
44 #include <asm/io.h>
45 #include <asm/irq.h>            /* for CPU_IRQ_REGION and friends */
46 #include <asm/mmu_context.h>
47 #include <asm/page.h>
48 #include <asm/pgtable.h>
49 #include <asm/pgalloc.h>
50 #include <asm/processor.h>
51 #include <asm/ptrace.h>
52 #include <asm/unistd.h>
53 #include <asm/cacheflush.h>
54
55 #define kDEBUG 0
56
57 spinlock_t smp_lock = SPIN_LOCK_UNLOCKED;
58
59 volatile struct task_struct *smp_init_current_idle_task;
60
61 static volatile int cpu_now_booting = 0;        /* track which CPU is booting */
62
63 unsigned long cache_decay_ticks;        /* declared by include/linux/sched.h */
64
65 static int parisc_max_cpus = 1;
66
67 /* online cpus are ones that we've managed to bring up completely
68  * possible cpus are all valid cpu 
69  * present cpus are all detected cpu
70  *
71  * On startup we bring up the "possible" cpus. Since we discover
72  * CPUs later, we add them as hotplug, so the possible cpu mask is
73  * empty in the beginning.
74  */
75
76 cpumask_t cpu_online_map = CPU_MASK_NONE;       /* Bitmap of online CPUs */
77 cpumask_t cpu_possible_map = CPU_MASK_ALL;      /* Bitmap of Present CPUs */
78
79 EXPORT_SYMBOL(cpu_online_map);
80 EXPORT_SYMBOL(cpu_possible_map);
81
82
83 struct smp_call_struct {
84         void (*func) (void *info);
85         void *info;
86         long wait;
87         atomic_t unstarted_count;
88         atomic_t unfinished_count;
89 };
90 static volatile struct smp_call_struct *smp_call_function_data;
91
92 enum ipi_message_type {
93         IPI_NOP=0,
94         IPI_RESCHEDULE=1,
95         IPI_CALL_FUNC,
96         IPI_CPU_START,
97         IPI_CPU_STOP,
98         IPI_CPU_TEST
99 };
100
101
102 /********** SMP inter processor interrupt and communication routines */
103
104 #undef PER_CPU_IRQ_REGION
105 #ifdef PER_CPU_IRQ_REGION
106 /* XXX REVISIT Ignore for now.
107 **    *May* need this "hook" to register IPI handler
108 **    once we have perCPU ExtIntr switch tables.
109 */
110 static void
111 ipi_init(int cpuid)
112 {
113
114         /* If CPU is present ... */
115 #ifdef ENTRY_SYS_CPUS
116         /* *and* running (not stopped) ... */
117 #error iCOD support wants state checked here.
118 #endif
119
120 #error verify IRQ_OFFSET(IPI_IRQ) is ipi_interrupt() in new IRQ region
121
122         if(cpu_online(cpuid) )
123         {
124                 switch_to_idle_task(current);
125         }
126
127         return;
128 }
129 #endif
130
131
132 /*
133 ** Yoink this CPU from the runnable list... 
134 **
135 */
136 static void
137 halt_processor(void) 
138 {
139 #ifdef ENTRY_SYS_CPUS
140 #error halt_processor() needs rework
141 /*
142 ** o migrate I/O interrupts off this CPU.
143 ** o leave IPI enabled - __cli() will disable IPI.
144 ** o leave CPU in online map - just change the state
145 */
146         cpu_data[this_cpu].state = STATE_STOPPED;
147         mark_bh(IPI_BH);
148 #else
149         /* REVISIT : redirect I/O Interrupts to another CPU? */
150         /* REVISIT : does PM *know* this CPU isn't available? */
151         cpu_clear(smp_processor_id(), cpu_online_map);
152         local_irq_disable();
153         for (;;)
154                 ;
155 #endif
156 }
157
158
159 irqreturn_t
160 ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) 
161 {
162         int this_cpu = smp_processor_id();
163         struct cpuinfo_parisc *p = &cpu_data[this_cpu];
164         unsigned long ops;
165         unsigned long flags;
166
167         /* Count this now; we may make a call that never returns. */
168         p->ipi_count++;
169
170         mb();   /* Order interrupt and bit testing. */
171
172         for (;;) {
173                 spin_lock_irqsave(&(p->lock),flags);
174                 ops = p->pending_ipi;
175                 p->pending_ipi = 0;
176                 spin_unlock_irqrestore(&(p->lock),flags);
177
178                 mb(); /* Order bit clearing and data access. */
179
180                 if (!ops)
181                     break;
182
183                 while (ops) {
184                         unsigned long which = ffz(~ops);
185
186                         switch (which) {
187                         case IPI_RESCHEDULE:
188 #if (kDEBUG>=100)
189                                 printk(KERN_DEBUG "CPU%d IPI_RESCHEDULE\n",this_cpu);
190 #endif /* kDEBUG */
191                                 ops &= ~(1 << IPI_RESCHEDULE);
192                                 /*
193                                  * Reschedule callback.  Everything to be
194                                  * done is done by the interrupt return path.
195                                  */
196                                 break;
197
198                         case IPI_CALL_FUNC:
199 #if (kDEBUG>=100)
200                                 printk(KERN_DEBUG "CPU%d IPI_CALL_FUNC\n",this_cpu);
201 #endif /* kDEBUG */
202                                 ops &= ~(1 << IPI_CALL_FUNC);
203                                 {
204                                         volatile struct smp_call_struct *data;
205                                         void (*func)(void *info);
206                                         void *info;
207                                         int wait;
208
209                                         data = smp_call_function_data;
210                                         func = data->func;
211                                         info = data->info;
212                                         wait = data->wait;
213
214                                         mb();
215                                         atomic_dec ((atomic_t *)&data->unstarted_count);
216
217                                         /* At this point, *data can't
218                                          * be relied upon.
219                                          */
220
221                                         (*func)(info);
222
223                                         /* Notify the sending CPU that the
224                                          * task is done.
225                                          */
226                                         mb();
227                                         if (wait)
228                                                 atomic_dec ((atomic_t *)&data->unfinished_count);
229                                 }
230                                 break;
231
232                         case IPI_CPU_START:
233 #if (kDEBUG>=100)
234                                 printk(KERN_DEBUG "CPU%d IPI_CPU_START\n",this_cpu);
235 #endif /* kDEBUG */
236                                 ops &= ~(1 << IPI_CPU_START);
237 #ifdef ENTRY_SYS_CPUS
238                                 p->state = STATE_RUNNING;
239 #endif
240                                 break;
241
242                         case IPI_CPU_STOP:
243 #if (kDEBUG>=100)
244                                 printk(KERN_DEBUG "CPU%d IPI_CPU_STOP\n",this_cpu);
245 #endif /* kDEBUG */
246                                 ops &= ~(1 << IPI_CPU_STOP);
247 #ifdef ENTRY_SYS_CPUS
248 #else
249                                 halt_processor();
250 #endif
251                                 break;
252
253                         case IPI_CPU_TEST:
254 #if (kDEBUG>=100)
255                                 printk(KERN_DEBUG "CPU%d is alive!\n",this_cpu);
256 #endif /* kDEBUG */
257                                 ops &= ~(1 << IPI_CPU_TEST);
258                                 break;
259
260                         default:
261                                 printk(KERN_CRIT "Unknown IPI num on CPU%d: %lu\n",
262                                         this_cpu, which);
263                                 ops &= ~(1 << which);
264                                 return IRQ_NONE;
265                         } /* Switch */
266                 } /* while (ops) */
267         }
268         return IRQ_HANDLED;
269 }
270
271
272 static inline void
273 ipi_send(int cpu, enum ipi_message_type op)
274 {
275         struct cpuinfo_parisc *p = &cpu_data[cpu];
276         unsigned long flags;
277
278         spin_lock_irqsave(&(p->lock),flags);
279         p->pending_ipi |= 1 << op;
280         __raw_writel(IRQ_OFFSET(IPI_IRQ), cpu_data[cpu].hpa);
281         spin_unlock_irqrestore(&(p->lock),flags);
282 }
283
284
285 static inline void
286 send_IPI_single(int dest_cpu, enum ipi_message_type op)
287 {
288         if (dest_cpu == NO_PROC_ID) {
289                 BUG();
290                 return;
291         }
292
293         ipi_send(dest_cpu, op);
294 }
295
296 static inline void
297 send_IPI_allbutself(enum ipi_message_type op)
298 {
299         int i;
300         
301         for (i = 0; i < NR_CPUS; i++) {
302                 if (cpu_online(i) && i != smp_processor_id())
303                         send_IPI_single(i, op);
304         }
305 }
306
307
308 inline void 
309 smp_send_stop(void)     { send_IPI_allbutself(IPI_CPU_STOP); }
310
311 static inline void
312 smp_send_start(void)    { send_IPI_allbutself(IPI_CPU_START); }
313
314 void 
315 smp_send_reschedule(int cpu) { send_IPI_single(cpu, IPI_RESCHEDULE); }
316
317
318 /**
319  * Run a function on all other CPUs.
320  *  <func>      The function to run. This must be fast and non-blocking.
321  *  <info>      An arbitrary pointer to pass to the function.
322  *  <retry>     If true, keep retrying until ready.
323  *  <wait>      If true, wait until function has completed on other CPUs.
324  *  [RETURNS]   0 on success, else a negative status code.
325  *
326  * Does not return until remote CPUs are nearly ready to execute <func>
327  * or have executed.
328  */
329
330 int
331 smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
332 {
333         struct smp_call_struct data;
334         unsigned long timeout;
335         static spinlock_t lock = SPIN_LOCK_UNLOCKED;
336
337         if (num_online_cpus() < 2)
338                 return 0;
339
340         /* Can deadlock when called with interrupts disabled */
341         WARN_ON(irqs_disabled());
342         
343         data.func = func;
344         data.info = info;
345         data.wait = wait;
346         atomic_set(&data.unstarted_count, num_online_cpus() - 1);
347         atomic_set(&data.unfinished_count, num_online_cpus() - 1);
348
349         if (retry) {
350                 spin_lock (&lock);
351                 while (smp_call_function_data != 0)
352                         barrier();
353         }
354         else {
355                 spin_lock (&lock);
356                 if (smp_call_function_data) {
357                         spin_unlock (&lock);
358                         return -EBUSY;
359                 }
360         }
361
362         smp_call_function_data = &data;
363         spin_unlock (&lock);
364         
365         /*  Send a message to all other CPUs and wait for them to respond  */
366         send_IPI_allbutself(IPI_CALL_FUNC);
367
368         /*  Wait for response  */
369         timeout = jiffies + HZ;
370         while ( (atomic_read (&data.unstarted_count) > 0) &&
371                 time_before (jiffies, timeout) )
372                 barrier ();
373
374         /* We either got one or timed out. Release the lock */
375
376         mb();
377         smp_call_function_data = NULL;
378         if (atomic_read (&data.unstarted_count) > 0) {
379                 printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d)\n",
380                       smp_processor_id());
381                 return -ETIMEDOUT;
382         }
383
384         while (wait && atomic_read (&data.unfinished_count) > 0)
385                         barrier ();
386
387         return 0;
388 }
389
390 EXPORT_SYMBOL(smp_call_function);
391
392 /*
393  * Flush all other CPU's tlb and then mine.  Do this with on_each_cpu()
394  * as we want to ensure all TLB's flushed before proceeding.
395  */
396
397 extern void flush_tlb_all_local(void);
398
399 void
400 smp_flush_tlb_all(void)
401 {
402         on_each_cpu((void (*)(void *))flush_tlb_all_local, NULL, 1, 1);
403 }
404
405
406 void 
407 smp_do_timer(struct pt_regs *regs)
408 {
409         int cpu = smp_processor_id();
410         struct cpuinfo_parisc *data = &cpu_data[cpu];
411
412         if (!--data->prof_counter) {
413                 data->prof_counter = data->prof_multiplier;
414                 update_process_times(user_mode(regs));
415         }
416 }
417
418 /*
419  * Called by secondaries to update state and initialize CPU registers.
420  */
421 static void __init
422 smp_cpu_init(int cpunum)
423 {
424         extern int init_per_cpu(int);  /* arch/parisc/kernel/setup.c */
425         extern void init_IRQ(void);    /* arch/parisc/kernel/irq.c */
426
427         /* Set modes and Enable floating point coprocessor */
428         (void) init_per_cpu(cpunum);
429
430         disable_sr_hashing();
431
432         mb();
433
434         /* Well, support 2.4 linux scheme as well. */
435         if (cpu_test_and_set(cpunum, cpu_online_map))
436         {
437                 extern void machine_halt(void); /* arch/parisc.../process.c */
438
439                 printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);
440                 machine_halt();
441         }  
442
443         /* Initialise the idle task for this CPU */
444         atomic_inc(&init_mm.mm_count);
445         current->active_mm = &init_mm;
446         if(current->mm)
447                 BUG();
448         enter_lazy_tlb(&init_mm, current);
449
450         init_IRQ();   /* make sure no IRQ's are enabled or pending */
451 }
452
453
454 /*
455  * Slaves start using C here. Indirectly called from smp_slave_stext.
456  * Do what start_kernel() and main() do for boot strap processor (aka monarch)
457  */
458 void __init smp_callin(void)
459 {
460         extern void cpu_idle(void);     /* arch/parisc/kernel/process.c */
461         int slave_id = cpu_now_booting;
462 #if 0
463         void *istack;
464 #endif
465
466         smp_cpu_init(slave_id);
467
468 #if 0   /* NOT WORKING YET - see entry.S */
469         istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER);
470         if (istack == NULL) {
471             printk(KERN_CRIT "Failed to allocate interrupt stack for cpu %d\n",slave_id);
472             BUG();
473         }
474         mtctl(istack,31);
475 #endif
476
477         flush_cache_all_local(); /* start with known state */
478         flush_tlb_all_local();
479
480         local_irq_enable();  /* Interrupts have been off until now */
481
482         cpu_idle();      /* Wait for timer to schedule some work */
483
484         /* NOTREACHED */
485         panic("smp_callin() AAAAaaaaahhhh....\n");
486 }
487
488 /*
489  * Create the idle task for a new Slave CPU.  DO NOT use kernel_thread()
490  * because that could end up calling schedule(). If it did, the new idle
491  * task could get scheduled before we had a chance to remove it from the
492  * run-queue...
493  */
494 static struct task_struct *fork_by_hand(void)
495 {
496         struct pt_regs regs;  
497
498         /*
499          * don't care about the regs settings since
500          * we'll never reschedule the forked task.
501          */
502         return copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
503 }
504
505
506 /*
507  * Bring one cpu online.
508  */
509 int __init smp_boot_one_cpu(int cpuid)
510 {
511         struct task_struct *idle;
512         long timeout;
513
514         /* 
515          * Create an idle task for this CPU.  Note the address wed* give 
516          * to kernel_thread is irrelevant -- it's going to start
517          * where OS_BOOT_RENDEVZ vector in SAL says to start.  But
518          * this gets all the other task-y sort of data structures set
519          * up like we wish.   We need to pull the just created idle task 
520          * off the run queue and stuff it into the init_tasks[] array.  
521          * Sheesh . . .
522          */
523
524         idle = fork_by_hand();
525         if (IS_ERR(idle))
526                 panic("SMP: fork failed for CPU:%d", cpuid);
527
528         wake_up_forked_process(idle);
529         init_idle(idle, cpuid);
530         unhash_process(idle);
531         idle->thread_info->cpu = cpuid;
532
533         /* Let _start know what logical CPU we're booting
534         ** (offset into init_tasks[],cpu_data[])
535         */
536         cpu_now_booting = cpuid;
537
538         /* 
539         ** boot strap code needs to know the task address since
540         ** it also contains the process stack.
541         */
542         smp_init_current_idle_task = idle ;
543         mb();
544
545         printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa);
546
547         /*
548         ** This gets PDC to release the CPU from a very tight loop.
549         **
550         ** From the PA-RISC 2.0 Firmware Architecture Reference Specification:
551         ** "The MEM_RENDEZ vector specifies the location of OS_RENDEZ which 
552         ** is executed after receiving the rendezvous signal (an interrupt to 
553         ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the 
554         ** contents of memory are valid."
555         */
556         __raw_writel(IRQ_OFFSET(TIMER_IRQ), cpu_data[cpuid].hpa);
557         mb();
558
559         /* 
560          * OK, wait a bit for that CPU to finish staggering about. 
561          * Slave will set a bit when it reaches smp_cpu_init().
562          * Once the "monarch CPU" sees the bit change, it can move on.
563          */
564         for (timeout = 0; timeout < 10000; timeout++) {
565                 if(cpu_online(cpuid)) {
566                         /* Which implies Slave has started up */
567                         cpu_now_booting = 0;
568                         smp_init_current_idle_task = NULL;
569                         goto alive ;
570                 }
571                 udelay(100);
572                 barrier();
573         }
574
575         put_task_struct(idle);
576         idle = NULL;
577
578         printk(KERN_CRIT "SMP: CPU:%d is stuck.\n", cpuid);
579         return -1;
580
581 alive:
582         /* Remember the Slave data */
583 #if (kDEBUG>=100)
584         printk(KERN_DEBUG "SMP: CPU:%d came alive after %ld _us\n",
585                 cpuid, timeout * 100);
586 #endif /* kDEBUG */
587 #ifdef ENTRY_SYS_CPUS
588         cpu_data[cpuid].state = STATE_RUNNING;
589 #endif
590         return 0;
591 }
592
593 void __devinit smp_prepare_boot_cpu(void)
594 {
595         int bootstrap_processor=cpu_data[0].cpuid;      /* CPU ID of BSP */
596
597 #ifdef ENTRY_SYS_CPUS
598         cpu_data[0].state = STATE_RUNNING;
599 #endif
600
601         /* Setup BSP mappings */
602         printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
603
604         cpu_set(bootstrap_processor, cpu_online_map);
605         cpu_set(bootstrap_processor, cpu_present_map);
606
607         cache_decay_ticks = HZ/100;     /* FIXME very rough.  */
608 }
609
610
611
612 /*
613 ** inventory.c:do_inventory() hasn't yet been run and thus we
614 ** don't 'discover' the additional CPU's until later.
615 */
616 void __init smp_prepare_cpus(unsigned int max_cpus)
617 {
618         cpus_clear(cpu_present_map);
619         cpu_set(0, cpu_present_map);
620
621         parisc_max_cpus = max_cpus;
622         if (!max_cpus)
623                 printk(KERN_INFO "SMP mode deactivated.\n");
624 }
625
626
627 void smp_cpus_done(unsigned int cpu_max)
628 {
629         return;
630 }
631
632
633 int __devinit __cpu_up(unsigned int cpu)
634 {
635         if (cpu != 0 && cpu < parisc_max_cpus)
636                 smp_boot_one_cpu(cpu);
637
638         return cpu_online(cpu) ? 0 : -ENOSYS;
639 }
640
641
642
643 #ifdef ENTRY_SYS_CPUS
644 /* Code goes along with:
645 **    entry.s:        ENTRY_NAME(sys_cpus)   / * 215, for cpu stat * /
646 */
647 int sys_cpus(int argc, char **argv)
648 {
649         int i,j=0;
650         extern int current_pid(int cpu);
651
652         if( argc > 2 ) {
653                 printk("sys_cpus:Only one argument supported\n");
654                 return (-1);
655         }
656         if ( argc == 1 ){
657         
658 #ifdef DUMP_MORE_STATE
659                 for(i=0; i<NR_CPUS; i++) {
660                         int cpus_per_line = 4;
661                         if(cpu_online(i)) {
662                                 if (j++ % cpus_per_line)
663                                         printk(" %3d",i);
664                                 else
665                                         printk("\n %3d",i);
666                         }
667                 }
668                 printk("\n"); 
669 #else
670                 printk("\n 0\n"); 
671 #endif
672         } else if((argc==2) && !(strcmp(argv[1],"-l"))) {
673                 printk("\nCPUSTATE  TASK CPUNUM CPUID HARDCPU(HPA)\n");
674 #ifdef DUMP_MORE_STATE
675                 for(i=0;i<NR_CPUS;i++) {
676                         if (!cpu_online(i))
677                                 continue;
678                         if (cpu_data[i].cpuid != NO_PROC_ID) {
679                                 switch(cpu_data[i].state) {
680                                         case STATE_RENDEZVOUS:
681                                                 printk("RENDEZVS ");
682                                                 break;
683                                         case STATE_RUNNING:
684                                                 printk((current_pid(i)!=0) ? "RUNNING  " : "IDLING   ");
685                                                 break;
686                                         case STATE_STOPPED:
687                                                 printk("STOPPED  ");
688                                                 break;
689                                         case STATE_HALTED:
690                                                 printk("HALTED   ");
691                                                 break;
692                                         default:
693                                                 printk("%08x?", cpu_data[i].state);
694                                                 break;
695                                 }
696                                 if(cpu_online(i)) {
697                                         printk(" %4d",current_pid(i));
698                                 }       
699                                 printk(" %6d",cpu_number_map(i));
700                                 printk(" %5d",i);
701                                 printk(" 0x%lx\n",cpu_data[i].hpa);
702                         }       
703                 }
704 #else
705                 printk("\n%s  %4d      0     0 --------",
706                         (current->pid)?"RUNNING ": "IDLING  ",current->pid); 
707 #endif
708         } else if ((argc==2) && !(strcmp(argv[1],"-s"))) { 
709 #ifdef DUMP_MORE_STATE
710                 printk("\nCPUSTATE   CPUID\n");
711                 for (i=0;i<NR_CPUS;i++) {
712                         if (!cpu_online(i))
713                                 continue;
714                         if (cpu_data[i].cpuid != NO_PROC_ID) {
715                                 switch(cpu_data[i].state) {
716                                         case STATE_RENDEZVOUS:
717                                                 printk("RENDEZVS");break;
718                                         case STATE_RUNNING:
719                                                 printk((current_pid(i)!=0) ? "RUNNING " : "IDLING");
720                                                 break;
721                                         case STATE_STOPPED:
722                                                 printk("STOPPED ");break;
723                                         case STATE_HALTED:
724                                                 printk("HALTED  ");break;
725                                         default:
726                                 }
727                                 printk("  %5d\n",i);
728                         }       
729                 }
730 #else
731                 printk("\n%s    CPU0",(current->pid==0)?"RUNNING ":"IDLING  "); 
732 #endif
733         } else {
734                 printk("sys_cpus:Unknown request\n");
735                 return (-1);
736         }
737         return 0;
738 }
739 #endif /* ENTRY_SYS_CPUS */
740
741 #ifdef CONFIG_PROC_FS
742 int __init
743 setup_profiling_timer(unsigned int multiplier)
744 {
745         return -EINVAL;
746 }
747 #endif