X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-s390%2Fsmp.h;h=444dae5912e6b544d9d31c0c45b0fcc53cefe473;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=7e613240088e985c5664c277f705f07ef5ca3c5d;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index 7e6132400..444dae591 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h @@ -5,6 +5,7 @@ * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), * Martin Schwidefsky (schwidefsky@de.ibm.com) + * Heiko Carstens (heiko.carstens@de.ibm.com) */ #ifndef __ASM_SMP_H #define __ASM_SMP_H @@ -17,6 +18,7 @@ #if defined(__KERNEL__) && defined(CONFIG_SMP) && !defined(__ASSEMBLY__) #include +#include /* s390 specific smp.c headers @@ -29,12 +31,9 @@ typedef struct __u16 cpu; } sigp_info; +extern void smp_setup_cpu_possible_map(void); extern int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic, int wait, int cpu); - -extern cpumask_t cpu_online_map; -extern cpumask_t cpu_possible_map; - #define NO_PROC_ID 0xFF /* No processor magic marker */ /* @@ -49,11 +48,12 @@ extern cpumask_t cpu_possible_map; #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ -#define smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) +#define raw_smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) -#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map) +extern int smp_get_cpu(cpumask_t cpu_map); +extern void smp_put_cpu(int cpu); -extern __inline__ __u16 hard_smp_processor_id(void) +static inline __u16 hard_smp_processor_id(void) { __u16 cpu_address; @@ -61,12 +61,51 @@ extern __inline__ __u16 hard_smp_processor_id(void) return cpu_address; } +/* + * returns 1 if cpu is in stopped/check stopped state or not operational + * returns 0 otherwise + */ +static inline int +smp_cpu_not_running(int cpu) +{ + __u32 status; + + switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { + case sigp_order_code_accepted: + case sigp_status_stored: + /* Check for stopped and check stop state */ + if (status & 0x50) + return 1; + break; + case sigp_not_operational: + return 1; + default: + break; + } + return 0; +} + #define cpu_logical_map(cpu) (cpu) +extern int __cpu_disable (void); +extern void __cpu_die (unsigned int cpu); +extern void cpu_die (void) __attribute__ ((noreturn)); +extern int __cpu_up (unsigned int cpu); + #endif #ifndef CONFIG_SMP -#define smp_call_function_on(func,info,nonatomic,wait,cpu) ({ 0; }) +static inline int +smp_call_function_on(void (*func) (void *info), void *info, + int nonatomic, int wait, int cpu) +{ + func(info); + return 0; +} +#define smp_cpu_not_running(cpu) 1 +#define smp_get_cpu(cpu) ({ 0; }) +#define smp_put_cpu(cpu) ({ 0; }) +#define smp_setup_cpu_possible_map() #endif #endif