smp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  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. #include <linux/types.h>
  21. #include <linux/spinlock.h>
  22. #include <linux/slab.h>
  23. #include <linux/kernel.h>
  24. #include <linux/module.h>
  25. #include <linux/sched.h>
  26. #include <linux/init.h>
  27. #include <linux/interrupt.h>
  28. #include <linux/smp.h>
  29. #include <linux/kernel_stat.h>
  30. #include <linux/mm.h>
  31. #include <linux/delay.h>
  32. #include <linux/bitops.h>
  33. #include <asm/system.h>
  34. #include <asm/atomic.h>
  35. #include <asm/current.h>
  36. #include <asm/delay.h>
  37. #include <asm/tlbflush.h>
  38. #include <asm/io.h>
  39. #include <asm/irq.h> /* for CPU_IRQ_REGION and friends */
  40. #include <asm/mmu_context.h>
  41. #include <asm/page.h>
  42. #include <asm/pgtable.h>
  43. #include <asm/pgalloc.h>
  44. #include <asm/processor.h>
  45. #include <asm/ptrace.h>
  46. #include <asm/unistd.h>
  47. #include <asm/cacheflush.h>
  48. #undef DEBUG_SMP
  49. #ifdef DEBUG_SMP
  50. static int smp_debug_lvl = 0;
  51. #define smp_debug(lvl, printargs...) \
  52. if (lvl >= smp_debug_lvl) \
  53. printk(printargs);
  54. #else
  55. #define smp_debug(lvl, ...)
  56. #endif /* DEBUG_SMP */
  57. DEFINE_SPINLOCK(smp_lock);
  58. volatile struct task_struct *smp_init_current_idle_task;
  59. static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is booting */
  60. static int parisc_max_cpus __read_mostly = 1;
  61. /* online cpus are ones that we've managed to bring up completely
  62. * possible cpus are all valid cpu
  63. * present cpus are all detected cpu
  64. *
  65. * On startup we bring up the "possible" cpus. Since we discover
  66. * CPUs later, we add them as hotplug, so the possible cpu mask is
  67. * empty in the beginning.
  68. */
  69. cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; /* Bitmap of online CPUs */
  70. cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; /* Bitmap of Present CPUs */
  71. EXPORT_SYMBOL(cpu_online_map);
  72. EXPORT_SYMBOL(cpu_possible_map);
  73. DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;
  74. struct smp_call_struct {
  75. void (*func) (void *info);
  76. void *info;
  77. long wait;
  78. atomic_t unstarted_count;
  79. atomic_t unfinished_count;
  80. };
  81. static volatile struct smp_call_struct *smp_call_function_data;
  82. enum ipi_message_type {
  83. IPI_NOP=0,
  84. IPI_RESCHEDULE=1,
  85. IPI_CALL_FUNC,
  86. IPI_CPU_START,
  87. IPI_CPU_STOP,
  88. IPI_CPU_TEST
  89. };
  90. /********** SMP inter processor interrupt and communication routines */
  91. #undef PER_CPU_IRQ_REGION
  92. #ifdef PER_CPU_IRQ_REGION
  93. /* XXX REVISIT Ignore for now.
  94. ** *May* need this "hook" to register IPI handler
  95. ** once we have perCPU ExtIntr switch tables.
  96. */
  97. static void
  98. ipi_init(int cpuid)
  99. {
  100. /* If CPU is present ... */
  101. #ifdef ENTRY_SYS_CPUS
  102. /* *and* running (not stopped) ... */
  103. #error iCOD support wants state checked here.
  104. #endif
  105. #error verify IRQ_OFFSET(IPI_IRQ) is ipi_interrupt() in new IRQ region
  106. if(cpu_online(cpuid) )
  107. {
  108. switch_to_idle_task(current);
  109. }
  110. return;
  111. }
  112. #endif
  113. /*
  114. ** Yoink this CPU from the runnable list...
  115. **
  116. */
  117. static void
  118. halt_processor(void)
  119. {
  120. #ifdef ENTRY_SYS_CPUS
  121. #error halt_processor() needs rework
  122. /*
  123. ** o migrate I/O interrupts off this CPU.
  124. ** o leave IPI enabled - __cli() will disable IPI.
  125. ** o leave CPU in online map - just change the state
  126. */
  127. cpu_data[this_cpu].state = STATE_STOPPED;
  128. mark_bh(IPI_BH);
  129. #else
  130. /* REVISIT : redirect I/O Interrupts to another CPU? */
  131. /* REVISIT : does PM *know* this CPU isn't available? */
  132. cpu_clear(smp_processor_id(), cpu_online_map);
  133. local_irq_disable();
  134. for (;;)
  135. ;
  136. #endif
  137. }
  138. irqreturn_t
  139. ipi_interrupt(int irq, void *dev_id)
  140. {
  141. int this_cpu = smp_processor_id();
  142. struct cpuinfo_parisc *p = &cpu_data[this_cpu];
  143. unsigned long ops;
  144. unsigned long flags;
  145. /* Count this now; we may make a call that never returns. */
  146. p->ipi_count++;
  147. mb(); /* Order interrupt and bit testing. */
  148. for (;;) {
  149. spinlock_t *lock = &per_cpu(ipi_lock, this_cpu);
  150. spin_lock_irqsave(lock, flags);
  151. ops = p->pending_ipi;
  152. p->pending_ipi = 0;
  153. spin_unlock_irqrestore(lock, flags);
  154. mb(); /* Order bit clearing and data access. */
  155. if (!ops)
  156. break;
  157. while (ops) {
  158. unsigned long which = ffz(~ops);
  159. ops &= ~(1 << which);
  160. switch (which) {
  161. case IPI_NOP:
  162. smp_debug(100, KERN_DEBUG "CPU%d IPI_NOP\n", this_cpu);
  163. break;
  164. case IPI_RESCHEDULE:
  165. smp_debug(100, KERN_DEBUG "CPU%d IPI_RESCHEDULE\n", this_cpu);
  166. /*
  167. * Reschedule callback. Everything to be
  168. * done is done by the interrupt return path.
  169. */
  170. break;
  171. case IPI_CALL_FUNC:
  172. smp_debug(100, KERN_DEBUG "CPU%d IPI_CALL_FUNC\n", this_cpu);
  173. {
  174. volatile struct smp_call_struct *data;
  175. void (*func)(void *info);
  176. void *info;
  177. int wait;
  178. data = smp_call_function_data;
  179. func = data->func;
  180. info = data->info;
  181. wait = data->wait;
  182. mb();
  183. atomic_dec ((atomic_t *)&data->unstarted_count);
  184. /* At this point, *data can't
  185. * be relied upon.
  186. */
  187. (*func)(info);
  188. /* Notify the sending CPU that the
  189. * task is done.
  190. */
  191. mb();
  192. if (wait)
  193. atomic_dec ((atomic_t *)&data->unfinished_count);
  194. }
  195. break;
  196. case IPI_CPU_START:
  197. smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_START\n", this_cpu);
  198. #ifdef ENTRY_SYS_CPUS
  199. p->state = STATE_RUNNING;
  200. #endif
  201. break;
  202. case IPI_CPU_STOP:
  203. smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_STOP\n", this_cpu);
  204. #ifdef ENTRY_SYS_CPUS
  205. #else
  206. halt_processor();
  207. #endif
  208. break;
  209. case IPI_CPU_TEST:
  210. smp_debug(100, KERN_DEBUG "CPU%d is alive!\n", this_cpu);
  211. break;
  212. default:
  213. printk(KERN_CRIT "Unknown IPI num on CPU%d: %lu\n",
  214. this_cpu, which);
  215. return IRQ_NONE;
  216. } /* Switch */
  217. /* let in any pending interrupts */
  218. local_irq_enable();
  219. local_irq_disable();
  220. } /* while (ops) */
  221. }
  222. return IRQ_HANDLED;
  223. }
  224. static inline void
  225. ipi_send(int cpu, enum ipi_message_type op)
  226. {
  227. struct cpuinfo_parisc *p = &cpu_data[cpu];
  228. spinlock_t *lock = &per_cpu(ipi_lock, cpu);
  229. unsigned long flags;
  230. spin_lock_irqsave(lock, flags);
  231. p->pending_ipi |= 1 << op;
  232. gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa);
  233. spin_unlock_irqrestore(lock, flags);
  234. }
  235. static inline void
  236. send_IPI_single(int dest_cpu, enum ipi_message_type op)
  237. {
  238. if (dest_cpu == NO_PROC_ID) {
  239. BUG();
  240. return;
  241. }
  242. ipi_send(dest_cpu, op);
  243. }
  244. static inline void
  245. send_IPI_allbutself(enum ipi_message_type op)
  246. {
  247. int i;
  248. for_each_online_cpu(i) {
  249. if (i != smp_processor_id())
  250. send_IPI_single(i, op);
  251. }
  252. }
  253. inline void
  254. smp_send_stop(void) { send_IPI_allbutself(IPI_CPU_STOP); }
  255. static inline void
  256. smp_send_start(void) { send_IPI_allbutself(IPI_CPU_START); }
  257. void
  258. smp_send_reschedule(int cpu) { send_IPI_single(cpu, IPI_RESCHEDULE); }
  259. void
  260. smp_send_all_nop(void)
  261. {
  262. send_IPI_allbutself(IPI_NOP);
  263. }
  264. /**
  265. * Run a function on all other CPUs.
  266. * <func> The function to run. This must be fast and non-blocking.
  267. * <info> An arbitrary pointer to pass to the function.
  268. * <retry> If true, keep retrying until ready.
  269. * <wait> If true, wait until function has completed on other CPUs.
  270. * [RETURNS] 0 on success, else a negative status code.
  271. *
  272. * Does not return until remote CPUs are nearly ready to execute <func>
  273. * or have executed.
  274. */
  275. int
  276. smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
  277. {
  278. struct smp_call_struct data;
  279. unsigned long timeout;
  280. static DEFINE_SPINLOCK(lock);
  281. int retries = 0;
  282. if (num_online_cpus() < 2)
  283. return 0;
  284. /* Can deadlock when called with interrupts disabled */
  285. WARN_ON(irqs_disabled());
  286. /* can also deadlock if IPIs are disabled */
  287. WARN_ON((get_eiem() & (1UL<<(CPU_IRQ_MAX - IPI_IRQ))) == 0);
  288. data.func = func;
  289. data.info = info;
  290. data.wait = wait;
  291. atomic_set(&data.unstarted_count, num_online_cpus() - 1);
  292. atomic_set(&data.unfinished_count, num_online_cpus() - 1);
  293. if (retry) {
  294. spin_lock (&lock);
  295. while (smp_call_function_data != 0)
  296. barrier();
  297. }
  298. else {
  299. spin_lock (&lock);
  300. if (smp_call_function_data) {
  301. spin_unlock (&lock);
  302. return -EBUSY;
  303. }
  304. }
  305. smp_call_function_data = &data;
  306. spin_unlock (&lock);
  307. /* Send a message to all other CPUs and wait for them to respond */
  308. send_IPI_allbutself(IPI_CALL_FUNC);
  309. retry:
  310. /* Wait for response */
  311. timeout = jiffies + HZ;
  312. while ( (atomic_read (&data.unstarted_count) > 0) &&
  313. time_before (jiffies, timeout) )
  314. barrier ();
  315. if (atomic_read (&data.unstarted_count) > 0) {
  316. printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d), try %d\n",
  317. smp_processor_id(), ++retries);
  318. goto retry;
  319. }
  320. /* We either got one or timed out. Release the lock */
  321. mb();
  322. smp_call_function_data = NULL;
  323. while (wait && atomic_read (&data.unfinished_count) > 0)
  324. barrier ();
  325. return 0;
  326. }
  327. EXPORT_SYMBOL(smp_call_function);
  328. /*
  329. * Flush all other CPU's tlb and then mine. Do this with on_each_cpu()
  330. * as we want to ensure all TLB's flushed before proceeding.
  331. */
  332. void
  333. smp_flush_tlb_all(void)
  334. {
  335. on_each_cpu(flush_tlb_all_local, NULL, 1, 1);
  336. }
  337. /*
  338. * Called by secondaries to update state and initialize CPU registers.
  339. */
  340. static void __init
  341. smp_cpu_init(int cpunum)
  342. {
  343. extern int init_per_cpu(int); /* arch/parisc/kernel/processor.c */
  344. extern void init_IRQ(void); /* arch/parisc/kernel/irq.c */
  345. extern void start_cpu_itimer(void); /* arch/parisc/kernel/time.c */
  346. /* Set modes and Enable floating point coprocessor */
  347. (void) init_per_cpu(cpunum);
  348. disable_sr_hashing();
  349. mb();
  350. /* Well, support 2.4 linux scheme as well. */
  351. if (cpu_test_and_set(cpunum, cpu_online_map))
  352. {
  353. extern void machine_halt(void); /* arch/parisc.../process.c */
  354. printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);
  355. machine_halt();
  356. }
  357. /* Initialise the idle task for this CPU */
  358. atomic_inc(&init_mm.mm_count);
  359. current->active_mm = &init_mm;
  360. if(current->mm)
  361. BUG();
  362. enter_lazy_tlb(&init_mm, current);
  363. init_IRQ(); /* make sure no IRQ's are enabled or pending */
  364. start_cpu_itimer();
  365. }
  366. /*
  367. * Slaves start using C here. Indirectly called from smp_slave_stext.
  368. * Do what start_kernel() and main() do for boot strap processor (aka monarch)
  369. */
  370. void __init smp_callin(void)
  371. {
  372. int slave_id = cpu_now_booting;
  373. #if 0
  374. void *istack;
  375. #endif
  376. smp_cpu_init(slave_id);
  377. preempt_disable();
  378. #if 0 /* NOT WORKING YET - see entry.S */
  379. istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER);
  380. if (istack == NULL) {
  381. printk(KERN_CRIT "Failed to allocate interrupt stack for cpu %d\n",slave_id);
  382. BUG();
  383. }
  384. mtctl(istack,31);
  385. #endif
  386. flush_cache_all_local(); /* start with known state */
  387. flush_tlb_all_local(NULL);
  388. local_irq_enable(); /* Interrupts have been off until now */
  389. cpu_idle(); /* Wait for timer to schedule some work */
  390. /* NOTREACHED */
  391. panic("smp_callin() AAAAaaaaahhhh....\n");
  392. }
  393. /*
  394. * Bring one cpu online.
  395. */
  396. int __init smp_boot_one_cpu(int cpuid)
  397. {
  398. struct task_struct *idle;
  399. long timeout;
  400. /*
  401. * Create an idle task for this CPU. Note the address wed* give
  402. * to kernel_thread is irrelevant -- it's going to start
  403. * where OS_BOOT_RENDEVZ vector in SAL says to start. But
  404. * this gets all the other task-y sort of data structures set
  405. * up like we wish. We need to pull the just created idle task
  406. * off the run queue and stuff it into the init_tasks[] array.
  407. * Sheesh . . .
  408. */
  409. idle = fork_idle(cpuid);
  410. if (IS_ERR(idle))
  411. panic("SMP: fork failed for CPU:%d", cpuid);
  412. task_thread_info(idle)->cpu = cpuid;
  413. /* Let _start know what logical CPU we're booting
  414. ** (offset into init_tasks[],cpu_data[])
  415. */
  416. cpu_now_booting = cpuid;
  417. /*
  418. ** boot strap code needs to know the task address since
  419. ** it also contains the process stack.
  420. */
  421. smp_init_current_idle_task = idle ;
  422. mb();
  423. printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa);
  424. /*
  425. ** This gets PDC to release the CPU from a very tight loop.
  426. **
  427. ** From the PA-RISC 2.0 Firmware Architecture Reference Specification:
  428. ** "The MEM_RENDEZ vector specifies the location of OS_RENDEZ which
  429. ** is executed after receiving the rendezvous signal (an interrupt to
  430. ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the
  431. ** contents of memory are valid."
  432. */
  433. gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, cpu_data[cpuid].hpa);
  434. mb();
  435. /*
  436. * OK, wait a bit for that CPU to finish staggering about.
  437. * Slave will set a bit when it reaches smp_cpu_init().
  438. * Once the "monarch CPU" sees the bit change, it can move on.
  439. */
  440. for (timeout = 0; timeout < 10000; timeout++) {
  441. if(cpu_online(cpuid)) {
  442. /* Which implies Slave has started up */
  443. cpu_now_booting = 0;
  444. smp_init_current_idle_task = NULL;
  445. goto alive ;
  446. }
  447. udelay(100);
  448. barrier();
  449. }
  450. put_task_struct(idle);
  451. idle = NULL;
  452. printk(KERN_CRIT "SMP: CPU:%d is stuck.\n", cpuid);
  453. return -1;
  454. alive:
  455. /* Remember the Slave data */
  456. smp_debug(100, KERN_DEBUG "SMP: CPU:%d came alive after %ld _us\n",
  457. cpuid, timeout * 100);
  458. #ifdef ENTRY_SYS_CPUS
  459. cpu_data[cpuid].state = STATE_RUNNING;
  460. #endif
  461. return 0;
  462. }
  463. void __devinit smp_prepare_boot_cpu(void)
  464. {
  465. int bootstrap_processor=cpu_data[0].cpuid; /* CPU ID of BSP */
  466. #ifdef ENTRY_SYS_CPUS
  467. cpu_data[0].state = STATE_RUNNING;
  468. #endif
  469. /* Setup BSP mappings */
  470. printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
  471. cpu_set(bootstrap_processor, cpu_online_map);
  472. cpu_set(bootstrap_processor, cpu_present_map);
  473. }
  474. /*
  475. ** inventory.c:do_inventory() hasn't yet been run and thus we
  476. ** don't 'discover' the additional CPU's until later.
  477. */
  478. void __init smp_prepare_cpus(unsigned int max_cpus)
  479. {
  480. cpus_clear(cpu_present_map);
  481. cpu_set(0, cpu_present_map);
  482. parisc_max_cpus = max_cpus;
  483. if (!max_cpus)
  484. printk(KERN_INFO "SMP mode deactivated.\n");
  485. }
  486. void smp_cpus_done(unsigned int cpu_max)
  487. {
  488. return;
  489. }
  490. int __cpuinit __cpu_up(unsigned int cpu)
  491. {
  492. if (cpu != 0 && cpu < parisc_max_cpus)
  493. smp_boot_one_cpu(cpu);
  494. return cpu_online(cpu) ? 0 : -ENOSYS;
  495. }
  496. #ifdef ENTRY_SYS_CPUS
  497. /* Code goes along with:
  498. ** entry.s: ENTRY_NAME(sys_cpus) / * 215, for cpu stat * /
  499. */
  500. int sys_cpus(int argc, char **argv)
  501. {
  502. int i,j=0;
  503. extern int current_pid(int cpu);
  504. if( argc > 2 ) {
  505. printk("sys_cpus:Only one argument supported\n");
  506. return (-1);
  507. }
  508. if ( argc == 1 ){
  509. #ifdef DUMP_MORE_STATE
  510. for_each_online_cpu(i) {
  511. int cpus_per_line = 4;
  512. if (j++ % cpus_per_line)
  513. printk(" %3d",i);
  514. else
  515. printk("\n %3d",i);
  516. }
  517. printk("\n");
  518. #else
  519. printk("\n 0\n");
  520. #endif
  521. } else if((argc==2) && !(strcmp(argv[1],"-l"))) {
  522. printk("\nCPUSTATE TASK CPUNUM CPUID HARDCPU(HPA)\n");
  523. #ifdef DUMP_MORE_STATE
  524. for_each_online_cpu(i) {
  525. if (cpu_data[i].cpuid != NO_PROC_ID) {
  526. switch(cpu_data[i].state) {
  527. case STATE_RENDEZVOUS:
  528. printk("RENDEZVS ");
  529. break;
  530. case STATE_RUNNING:
  531. printk((current_pid(i)!=0) ? "RUNNING " : "IDLING ");
  532. break;
  533. case STATE_STOPPED:
  534. printk("STOPPED ");
  535. break;
  536. case STATE_HALTED:
  537. printk("HALTED ");
  538. break;
  539. default:
  540. printk("%08x?", cpu_data[i].state);
  541. break;
  542. }
  543. if(cpu_online(i)) {
  544. printk(" %4d",current_pid(i));
  545. }
  546. printk(" %6d",cpu_number_map(i));
  547. printk(" %5d",i);
  548. printk(" 0x%lx\n",cpu_data[i].hpa);
  549. }
  550. }
  551. #else
  552. printk("\n%s %4d 0 0 --------",
  553. (current->pid)?"RUNNING ": "IDLING ",current->pid);
  554. #endif
  555. } else if ((argc==2) && !(strcmp(argv[1],"-s"))) {
  556. #ifdef DUMP_MORE_STATE
  557. printk("\nCPUSTATE CPUID\n");
  558. for_each_online_cpu(i) {
  559. if (cpu_data[i].cpuid != NO_PROC_ID) {
  560. switch(cpu_data[i].state) {
  561. case STATE_RENDEZVOUS:
  562. printk("RENDEZVS");break;
  563. case STATE_RUNNING:
  564. printk((current_pid(i)!=0) ? "RUNNING " : "IDLING");
  565. break;
  566. case STATE_STOPPED:
  567. printk("STOPPED ");break;
  568. case STATE_HALTED:
  569. printk("HALTED ");break;
  570. default:
  571. }
  572. printk(" %5d\n",i);
  573. }
  574. }
  575. #else
  576. printk("\n%s CPU0",(current->pid==0)?"RUNNING ":"IDLING ");
  577. #endif
  578. } else {
  579. printk("sys_cpus:Unknown request\n");
  580. return (-1);
  581. }
  582. return 0;
  583. }
  584. #endif /* ENTRY_SYS_CPUS */
  585. #ifdef CONFIG_PROC_FS
  586. int __init
  587. setup_profiling_timer(unsigned int multiplier)
  588. {
  589. return -EINVAL;
  590. }
  591. #endif