File: /usr/src/linux/include/asm-s390x/smp.h
1 /*
2 * include/asm-s390/smp.h
3 *
4 * S390 version
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
7 * Martin Schwidefsky (schwidefsky@de.ibm.com)
8 */
9 #ifndef __ASM_SMP_H
10 #define __ASM_SMP_H
11
12 #include <linux/config.h>
13
14 #if defined(__KERNEL__) && defined(CONFIG_SMP) && !defined(__ASSEMBLY__)
15
16 #include <asm/lowcore.h>
17
18 /*
19 s390 specific smp.c headers
20 */
21 typedef struct
22 {
23 int intresting;
24 sigp_ccode ccode;
25 __u32 status;
26 __u16 cpu;
27 } sigp_info;
28
29 #define NO_PROC_ID 0xFF /* No processor magic marker */
30
31 /*
32 * This magic constant controls our willingness to transfer
33 * a process across CPUs. Such a transfer incurs misses on the L1
34 * cache, and on a P6 or P5 with multiple L2 caches L2 hits. My
35 * gut feeling is this will vary by board in value. For a board
36 * with separate L2 cache it probably depends also on the RSS, and
37 * for a board with shared L2 cache it ought to decay fast as other
38 * processes are run.
39 */
40
41 #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */
42
43 #define smp_processor_id() (current->processor)
44
45 extern __inline__ int cpu_logical_map(int cpu)
46 {
47 return cpu;
48 }
49
50 extern __inline__ int cpu_number_map(int cpu)
51 {
52 return cpu;
53 }
54
55 extern __inline__ __u16 hard_smp_processor_id(void)
56 {
57 __u16 cpu_address;
58
59 __asm__ ("stap %0\n" : "=m" (cpu_address));
60 return cpu_address;
61 }
62
63 #define cpu_logical_map(cpu) (cpu)
64
65 void smp_local_timer_interrupt(struct pt_regs * regs);
66
67 sigp_ccode smp_ext_call(int cpu, void (*cb)(void *info), void *info, int wait);
68 void smp_ext_call_others(void (*cb)(void *info), void *info, int wait);
69 sigp_ccode smp_ext_bitcall(int cpu, ec_bit_sig sig);
70 void smp_ext_bitcall_others(ec_bit_sig sig);
71
72 int smp_signal_others(sigp_order_code order_code,__u32 parameter,
73 int spin,sigp_info *info);
74 #endif
75 #endif
76