Ядро Linux в комментариях

       

Include/linux/smp.h


17422 #ifndef __LINUX_SMP_H 17423 #define __LINUX_SMP_H 17424 17425 /* Generic SMP support 17426 * Alan Cox. <alan@cymru.net> 17427 */ 17428 17429 #ifdef __SMP__ 17430 17431 #include <asm/smp.h> 17432 17433 /* main cross-CPU interfaces, handles INIT, TLB flush, 17434 * STOP, etc. (defined in asm header): */ 17435 17436 /* stops all CPUs but the current one: */ 17437 extern void smp_send_stop(void); 17438 17439 /* sends a 'reschedule' event to another CPU: */ 17440 extern void FASTCALL(smp_send_reschedule(int cpu)); 17441 17442 /* Boot processor call to load the other CPU's */ 17443 extern void smp_boot_cpus(void); 17444 17445 /* Processor call in. Must hold processors until .. */ 17446 extern void smp_callin(void); 17447 17448 /* Multiprocessors may now schedule */ 17449 extern void smp_commence(void); 17450 17451 /* True once the per process idle is forked */ 17452 extern int smp_threads_ready; 17453 17454 extern int smp_num_cpus; 17455 17456 extern volatile unsigned long smp_msg_data; 17457 extern volatile int smp_src_cpu; 17458 extern volatile int smp_msg_id; 17459 17460 /* Assume <32768 CPUs */ 17461 #define MSG_ALL_BUT_SELF 0x8000 17462 #define MSG_ALL 0x8001 17463 17464 /* Remote processor TLB invalidate */ 17465 #define MSG_INVALIDATE_TLB 0x0001 17466 /* Sent to shut down slave CPUs when rebooting */ 17467 #define MSG_STOP_CPU 0x0002 17468 /* Reschedule request from master CPU*/ 17469 #define MSG_RESCHEDULE 0x0003 17470 /* Change MTRR */ 17471 #define MSG_MTRR_CHANGE 0x0004 17472 17473 #else 17474 17475 /* These macros fold the SMP functionality into a single 17476 * CPU system */ 17477 17478 #define smp_num_cpus 1 17479 #define smp_processor_id() 0 17480 #define hard_smp_processor_id() 0 17481 #define smp_threads_ready 1 17482 #define kernel_lock() 17483 #define cpu_logical_map(cpu) 0 17484 17485 #endif 17486 #endif



Содержание раздела