smp.c 16 KB

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