1616** the Free Software Foundation; either version 2 of the License, or
1717** (at your option) any later version.
1818*/
19- #undef ENTRY_SYS_CPUS /* syscall support for iCOD-like functionality */
20-
21-
2219#include <linux/types.h>
2320#include <linux/spinlock.h>
2421#include <linux/slab.h>
@@ -116,13 +113,6 @@ enum ipi_message_type {
116113static void
117114ipi_init (int cpuid )
118115{
119-
120- /* If CPU is present ... */
121- #ifdef ENTRY_SYS_CPUS
122- /* *and* running (not stopped) ... */
123- #error iCOD support wants state checked here.
124- #endif
125-
126116#error verify IRQ_OFFSET(IPI_IRQ) is ipi_interrupt() in new IRQ region
127117
128118 if (cpu_online (cpuid ) )
@@ -142,23 +132,12 @@ ipi_init(int cpuid)
142132static void
143133halt_processor (void )
144134{
145- #ifdef ENTRY_SYS_CPUS
146- #error halt_processor() needs rework
147- /*
148- ** o migrate I/O interrupts off this CPU.
149- ** o leave IPI enabled - __cli() will disable IPI.
150- ** o leave CPU in online map - just change the state
151- */
152- cpu_data [this_cpu ].state = STATE_STOPPED ;
153- mark_bh (IPI_BH );
154- #else
155135 /* REVISIT : redirect I/O Interrupts to another CPU? */
156136 /* REVISIT : does PM *know* this CPU isn't available? */
157137 cpu_clear (smp_processor_id (), cpu_online_map );
158138 local_irq_disable ();
159139 for (;;)
160140 ;
161- #endif
162141}
163142
164143
@@ -238,17 +217,11 @@ ipi_interrupt(int irq, void *dev_id)
238217
239218 case IPI_CPU_START :
240219 smp_debug (100 , KERN_DEBUG "CPU%d IPI_CPU_START\n" , this_cpu );
241- #ifdef ENTRY_SYS_CPUS
242- p -> state = STATE_RUNNING ;
243- #endif
244220 break ;
245221
246222 case IPI_CPU_STOP :
247223 smp_debug (100 , KERN_DEBUG "CPU%d IPI_CPU_STOP\n" , this_cpu );
248- #ifdef ENTRY_SYS_CPUS
249- #else
250224 halt_processor ();
251- #endif
252225 break ;
253226
254227 case IPI_CPU_TEST :
@@ -561,20 +534,13 @@ int __init smp_boot_one_cpu(int cpuid)
561534 /* Remember the Slave data */
562535 smp_debug (100 , KERN_DEBUG "SMP: CPU:%d came alive after %ld _us\n" ,
563536 cpuid , timeout * 100 );
564- #ifdef ENTRY_SYS_CPUS
565- cpu_data [cpuid ].state = STATE_RUNNING ;
566- #endif
567537 return 0 ;
568538}
569539
570540void __devinit smp_prepare_boot_cpu (void )
571541{
572542 int bootstrap_processor = cpu_data [0 ].cpuid ; /* CPU ID of BSP */
573543
574- #ifdef ENTRY_SYS_CPUS
575- cpu_data [0 ].state = STATE_RUNNING ;
576- #endif
577-
578544 /* Setup BSP mappings */
579545 printk ("SMP: bootstrap CPU ID is %d\n" ,bootstrap_processor );
580546
@@ -613,101 +579,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
613579 return cpu_online (cpu ) ? 0 : - ENOSYS ;
614580}
615581
616-
617-
618- #ifdef ENTRY_SYS_CPUS
619- /* Code goes along with:
620- ** entry.s: ENTRY_NAME(sys_cpus) / * 215, for cpu stat * /
621- */
622- int sys_cpus (int argc , char * * argv )
623- {
624- int i ,j = 0 ;
625- extern int current_pid (int cpu );
626-
627- if ( argc > 2 ) {
628- printk ("sys_cpus:Only one argument supported\n" );
629- return (-1 );
630- }
631- if ( argc == 1 ){
632-
633- #ifdef DUMP_MORE_STATE
634- for_each_online_cpu (i ) {
635- int cpus_per_line = 4 ;
636-
637- if (j ++ % cpus_per_line )
638- printk (" %3d" ,i );
639- else
640- printk ("\n %3d" ,i );
641- }
642- printk ("\n" );
643- #else
644- printk ("\n 0\n" );
645- #endif
646- } else if ((argc == 2 ) && !(strcmp (argv [1 ],"-l" ))) {
647- printk ("\nCPUSTATE TASK CPUNUM CPUID HARDCPU(HPA)\n" );
648- #ifdef DUMP_MORE_STATE
649- for_each_online_cpu (i ) {
650- if (cpu_data [i ].cpuid != NO_PROC_ID ) {
651- switch (cpu_data [i ].state ) {
652- case STATE_RENDEZVOUS :
653- printk ("RENDEZVS " );
654- break ;
655- case STATE_RUNNING :
656- printk ((current_pid (i )!= 0 ) ? "RUNNING " : "IDLING " );
657- break ;
658- case STATE_STOPPED :
659- printk ("STOPPED " );
660- break ;
661- case STATE_HALTED :
662- printk ("HALTED " );
663- break ;
664- default :
665- printk ("%08x?" , cpu_data [i ].state );
666- break ;
667- }
668- if (cpu_online (i )) {
669- printk (" %4d" ,current_pid (i ));
670- }
671- printk (" %6d" ,cpu_number_map (i ));
672- printk (" %5d" ,i );
673- printk (" 0x%lx\n" ,cpu_data [i ].hpa );
674- }
675- }
676- #else
677- printk ("\n%s %4d 0 0 --------" ,
678- (current -> pid )?"RUNNING " : "IDLING " ,current -> pid );
679- #endif
680- } else if ((argc == 2 ) && !(strcmp (argv [1 ],"-s" ))) {
681- #ifdef DUMP_MORE_STATE
682- printk ("\nCPUSTATE CPUID\n" );
683- for_each_online_cpu (i ) {
684- if (cpu_data [i ].cpuid != NO_PROC_ID ) {
685- switch (cpu_data [i ].state ) {
686- case STATE_RENDEZVOUS :
687- printk ("RENDEZVS" );break ;
688- case STATE_RUNNING :
689- printk ((current_pid (i )!= 0 ) ? "RUNNING " : "IDLING" );
690- break ;
691- case STATE_STOPPED :
692- printk ("STOPPED " );break ;
693- case STATE_HALTED :
694- printk ("HALTED " );break ;
695- default :
696- }
697- printk (" %5d\n" ,i );
698- }
699- }
700- #else
701- printk ("\n%s CPU0" ,(current -> pid == 0 )?"RUNNING " :"IDLING " );
702- #endif
703- } else {
704- printk ("sys_cpus:Unknown request\n" );
705- return (-1 );
706- }
707- return 0 ;
708- }
709- #endif /* ENTRY_SYS_CPUS */
710-
711582#ifdef CONFIG_PROC_FS
712583int __init
713584setup_profiling_timer (unsigned int multiplier )
0 commit comments