aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r--arch/s390/include/asm/lowcore.h100
-rw-r--r--arch/s390/include/asm/sigp.h132
-rw-r--r--arch/s390/include/asm/smp.h63
-rw-r--r--arch/s390/include/asm/vdso.h4
4 files changed, 75 insertions, 224 deletions
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index 0831449e87a3..4e69563bc956 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright IBM Corp. 1999,2010 2 * Copyright IBM Corp. 1999,2012
3 * Author(s): Hartmut Penner <hp@de.ibm.com>, 3 * Author(s): Hartmut Penner <hp@de.ibm.com>,
4 * Martin Schwidefsky <schwidefsky@de.ibm.com>, 4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 * Denis Joseph Barrow, 5 * Denis Joseph Barrow,
@@ -12,14 +12,6 @@
12#include <asm/ptrace.h> 12#include <asm/ptrace.h>
13#include <asm/cpu.h> 13#include <asm/cpu.h>
14 14
15void restart_int_handler(void);
16void ext_int_handler(void);
17void system_call(void);
18void pgm_check_handler(void);
19void mcck_int_handler(void);
20void io_int_handler(void);
21void psw_restart_int_handler(void);
22
23#ifdef CONFIG_32BIT 15#ifdef CONFIG_32BIT
24 16
25#define LC_ORDER 0 17#define LC_ORDER 0
@@ -117,32 +109,37 @@ struct _lowcore {
117 __u64 steal_timer; /* 0x0288 */ 109 __u64 steal_timer; /* 0x0288 */
118 __u64 last_update_timer; /* 0x0290 */ 110 __u64 last_update_timer; /* 0x0290 */
119 __u64 last_update_clock; /* 0x0298 */ 111 __u64 last_update_clock; /* 0x0298 */
112 __u64 int_clock; /* 0x02a0 */
113 __u64 mcck_clock; /* 0x02a8 */
114 __u64 clock_comparator; /* 0x02b0 */
120 115
121 /* Current process. */ 116 /* Current process. */
122 __u32 current_task; /* 0x02a0 */ 117 __u32 current_task; /* 0x02b8 */
123 __u32 thread_info; /* 0x02a4 */ 118 __u32 thread_info; /* 0x02bc */
124 __u32 kernel_stack; /* 0x02a8 */ 119 __u32 kernel_stack; /* 0x02c0 */
120
121 /* Interrupt, panic and restart stack. */
122 __u32 async_stack; /* 0x02c4 */
123 __u32 panic_stack; /* 0x02c8 */
124 __u32 restart_stack; /* 0x02cc */
125 125
126 /* Interrupt and panic stack. */ 126 /* Restart function and parameter. */
127 __u32 async_stack; /* 0x02ac */ 127 __u32 restart_fn; /* 0x02d0 */
128 __u32 panic_stack; /* 0x02b0 */ 128 __u32 restart_data; /* 0x02d4 */
129 __u32 restart_source; /* 0x02d8 */
129 130
130 /* Address space pointer. */ 131 /* Address space pointer. */
131 __u32 kernel_asce; /* 0x02b4 */ 132 __u32 kernel_asce; /* 0x02dc */
132 __u32 user_asce; /* 0x02b8 */ 133 __u32 user_asce; /* 0x02e0 */
133 __u32 current_pid; /* 0x02bc */ 134 __u32 current_pid; /* 0x02e4 */
134 135
135 /* SMP info area */ 136 /* SMP info area */
136 __u32 cpu_nr; /* 0x02c0 */ 137 __u32 cpu_nr; /* 0x02e8 */
137 __u32 softirq_pending; /* 0x02c4 */ 138 __u32 softirq_pending; /* 0x02ec */
138 __u32 percpu_offset; /* 0x02c8 */ 139 __u32 percpu_offset; /* 0x02f0 */
139 __u32 ext_call_fast; /* 0x02cc */ 140 __u32 machine_flags; /* 0x02f4 */
140 __u64 int_clock; /* 0x02d0 */ 141 __u32 ftrace_func; /* 0x02f8 */
141 __u64 mcck_clock; /* 0x02d8 */ 142 __u8 pad_0x02fc[0x0300-0x02fc]; /* 0x02fc */
142 __u64 clock_comparator; /* 0x02e0 */
143 __u32 machine_flags; /* 0x02e8 */
144 __u32 ftrace_func; /* 0x02ec */
145 __u8 pad_0x02f8[0x0300-0x02f0]; /* 0x02f0 */
146 143
147 /* Interrupt response block */ 144 /* Interrupt response block */
148 __u8 irb[64]; /* 0x0300 */ 145 __u8 irb[64]; /* 0x0300 */
@@ -254,34 +251,39 @@ struct _lowcore {
254 __u64 steal_timer; /* 0x02e0 */ 251 __u64 steal_timer; /* 0x02e0 */
255 __u64 last_update_timer; /* 0x02e8 */ 252 __u64 last_update_timer; /* 0x02e8 */
256 __u64 last_update_clock; /* 0x02f0 */ 253 __u64 last_update_clock; /* 0x02f0 */
254 __u64 int_clock; /* 0x02f8 */
255 __u64 mcck_clock; /* 0x0300 */
256 __u64 clock_comparator; /* 0x0308 */
257 257
258 /* Current process. */ 258 /* Current process. */
259 __u64 current_task; /* 0x02f8 */ 259 __u64 current_task; /* 0x0310 */
260 __u64 thread_info; /* 0x0300 */ 260 __u64 thread_info; /* 0x0318 */
261 __u64 kernel_stack; /* 0x0308 */ 261 __u64 kernel_stack; /* 0x0320 */
262
263 /* Interrupt, panic and restart stack. */
264 __u64 async_stack; /* 0x0328 */
265 __u64 panic_stack; /* 0x0330 */
266 __u64 restart_stack; /* 0x0338 */
262 267
263 /* Interrupt and panic stack. */ 268 /* Restart function and parameter. */
264 __u64 async_stack; /* 0x0310 */ 269 __u64 restart_fn; /* 0x0340 */
265 __u64 panic_stack; /* 0x0318 */ 270 __u64 restart_data; /* 0x0348 */
271 __u64 restart_source; /* 0x0350 */
266 272
267 /* Address space pointer. */ 273 /* Address space pointer. */
268 __u64 kernel_asce; /* 0x0320 */ 274 __u64 kernel_asce; /* 0x0358 */
269 __u64 user_asce; /* 0x0328 */ 275 __u64 user_asce; /* 0x0360 */
270 __u64 current_pid; /* 0x0330 */ 276 __u64 current_pid; /* 0x0368 */
271 277
272 /* SMP info area */ 278 /* SMP info area */
273 __u32 cpu_nr; /* 0x0338 */ 279 __u32 cpu_nr; /* 0x0370 */
274 __u32 softirq_pending; /* 0x033c */ 280 __u32 softirq_pending; /* 0x0374 */
275 __u64 percpu_offset; /* 0x0340 */ 281 __u64 percpu_offset; /* 0x0378 */
276 __u64 ext_call_fast; /* 0x0348 */ 282 __u64 vdso_per_cpu_data; /* 0x0380 */
277 __u64 int_clock; /* 0x0350 */ 283 __u64 machine_flags; /* 0x0388 */
278 __u64 mcck_clock; /* 0x0358 */ 284 __u64 ftrace_func; /* 0x0390 */
279 __u64 clock_comparator; /* 0x0360 */ 285 __u64 gmap; /* 0x0398 */
280 __u64 vdso_per_cpu_data; /* 0x0368 */ 286 __u8 pad_0x03a0[0x0400-0x03a0]; /* 0x03a0 */
281 __u64 machine_flags; /* 0x0370 */
282 __u64 ftrace_func; /* 0x0378 */
283 __u64 gmap; /* 0x0380 */
284 __u8 pad_0x0388[0x0400-0x0388]; /* 0x0388 */
285 287
286 /* Interrupt response block. */ 288 /* Interrupt response block. */
287 __u8 irb[64]; /* 0x0400 */ 289 __u8 irb[64]; /* 0x0400 */
diff --git a/arch/s390/include/asm/sigp.h b/arch/s390/include/asm/sigp.h
deleted file mode 100644
index 7040b8567cd0..000000000000
--- a/arch/s390/include/asm/sigp.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Routines and structures for signalling other processors.
3 *
4 * Copyright IBM Corp. 1999,2010
5 * Author(s): Denis Joseph Barrow,
6 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
7 * Heiko Carstens <heiko.carstens@de.ibm.com>,
8 */
9
10#ifndef __ASM_SIGP_H
11#define __ASM_SIGP_H
12
13#include <asm/system.h>
14
15/* Get real cpu address from logical cpu number. */
16extern unsigned short __cpu_logical_map[];
17
18static inline int cpu_logical_map(int cpu)
19{
20#ifdef CONFIG_SMP
21 return __cpu_logical_map[cpu];
22#else
23 return stap();
24#endif
25}
26
27enum {
28 sigp_sense = 1,
29 sigp_external_call = 2,
30 sigp_emergency_signal = 3,
31 sigp_start = 4,
32 sigp_stop = 5,
33 sigp_restart = 6,
34 sigp_stop_and_store_status = 9,
35 sigp_initial_cpu_reset = 11,
36 sigp_cpu_reset = 12,
37 sigp_set_prefix = 13,
38 sigp_store_status_at_address = 14,
39 sigp_store_extended_status_at_address = 15,
40 sigp_set_architecture = 18,
41 sigp_conditional_emergency_signal = 19,
42 sigp_sense_running = 21,
43};
44
45enum {
46 sigp_order_code_accepted = 0,
47 sigp_status_stored = 1,
48 sigp_busy = 2,
49 sigp_not_operational = 3,
50};
51
52/*
53 * Definitions for external call.
54 */
55enum {
56 ec_schedule = 0,
57 ec_call_function,
58 ec_call_function_single,
59 ec_stop_cpu,
60};
61
62/*
63 * Signal processor.
64 */
65static inline int raw_sigp(u16 cpu, int order)
66{
67 register unsigned long reg1 asm ("1") = 0;
68 int ccode;
69
70 asm volatile(
71 " sigp %1,%2,0(%3)\n"
72 " ipm %0\n"
73 " srl %0,28\n"
74 : "=d" (ccode)
75 : "d" (reg1), "d" (cpu),
76 "a" (order) : "cc" , "memory");
77 return ccode;
78}
79
80/*
81 * Signal processor with parameter.
82 */
83static inline int raw_sigp_p(u32 parameter, u16 cpu, int order)
84{
85 register unsigned int reg1 asm ("1") = parameter;
86 int ccode;
87
88 asm volatile(
89 " sigp %1,%2,0(%3)\n"
90 " ipm %0\n"
91 " srl %0,28\n"
92 : "=d" (ccode)
93 : "d" (reg1), "d" (cpu),
94 "a" (order) : "cc" , "memory");
95 return ccode;
96}
97
98/*
99 * Signal processor with parameter and return status.
100 */
101static inline int raw_sigp_ps(u32 *status, u32 parm, u16 cpu, int order)
102{
103 register unsigned int reg1 asm ("1") = parm;
104 int ccode;
105
106 asm volatile(
107 " sigp %1,%2,0(%3)\n"
108 " ipm %0\n"
109 " srl %0,28\n"
110 : "=d" (ccode), "+d" (reg1)
111 : "d" (cpu), "a" (order)
112 : "cc" , "memory");
113 *status = reg1;
114 return ccode;
115}
116
117static inline int sigp(int cpu, int order)
118{
119 return raw_sigp(cpu_logical_map(cpu), order);
120}
121
122static inline int sigp_p(u32 parameter, int cpu, int order)
123{
124 return raw_sigp_p(parameter, cpu_logical_map(cpu), order);
125}
126
127static inline int sigp_ps(u32 *status, u32 parm, int cpu, int order)
128{
129 return raw_sigp_ps(status, parm, cpu_logical_map(cpu), order);
130}
131
132#endif /* __ASM_SIGP_H */
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index c32e9123b40c..797f78729680 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright IBM Corp. 1999,2009 2 * Copyright IBM Corp. 1999,2012
3 * Author(s): Denis Joseph Barrow, 3 * Author(s): Denis Joseph Barrow,
4 * Martin Schwidefsky <schwidefsky@de.ibm.com>, 4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 * Heiko Carstens <heiko.carstens@de.ibm.com>, 5 * Heiko Carstens <heiko.carstens@de.ibm.com>,
@@ -10,71 +10,52 @@
10#ifdef CONFIG_SMP 10#ifdef CONFIG_SMP
11 11
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/sigp.h>
14
15extern void machine_restart_smp(char *);
16extern void machine_halt_smp(void);
17extern void machine_power_off_smp(void);
18 13
19#define raw_smp_processor_id() (S390_lowcore.cpu_nr) 14#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
20 15
21extern int __cpu_disable (void);
22extern void __cpu_die (unsigned int cpu);
23extern int __cpu_up (unsigned int cpu);
24
25extern struct mutex smp_cpu_state_mutex; 16extern struct mutex smp_cpu_state_mutex;
17extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
18
19extern int __cpu_up(unsigned int cpu);
26 20
27extern void arch_send_call_function_single_ipi(int cpu); 21extern void arch_send_call_function_single_ipi(int cpu);
28extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 22extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
29 23
30extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; 24extern void smp_call_online_cpu(void (*func)(void *), void *);
31 25extern void smp_call_ipl_cpu(void (*func)(void *), void *);
32extern void smp_switch_to_ipl_cpu(void (*func)(void *), void *);
33extern void smp_switch_to_cpu(void (*)(void *), void *, unsigned long sp,
34 int from, int to);
35extern void smp_restart_with_online_cpu(void);
36extern void smp_restart_cpu(void);
37 26
38/* 27extern int smp_find_processor_id(u16 address);
39 * returns 1 if (virtual) cpu is scheduled 28extern int smp_store_status(int cpu);
40 * returns 0 otherwise 29extern int smp_vcpu_scheduled(int cpu);
41 */ 30extern void smp_yield_cpu(int cpu);
42static inline int smp_vcpu_scheduled(int cpu) 31extern void smp_yield(void);
43{ 32extern void smp_stop_cpu(void);
44 u32 status;
45
46 switch (sigp_ps(&status, 0, cpu, sigp_sense_running)) {
47 case sigp_status_stored:
48 /* Check for running status */
49 if (status & 0x400)
50 return 0;
51 break;
52 case sigp_not_operational:
53 return 0;
54 default:
55 break;
56 }
57 return 1;
58}
59 33
60#else /* CONFIG_SMP */ 34#else /* CONFIG_SMP */
61 35
62static inline void smp_switch_to_ipl_cpu(void (*func)(void *), void *data) 36static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
63{ 37{
64 func(data); 38 func(data);
65} 39}
66 40
67static inline void smp_restart_with_online_cpu(void) 41static inline void smp_call_online_cpu(void (*func)(void *), void *data)
68{ 42{
43 func(data);
69} 44}
70 45
71#define smp_vcpu_scheduled (1) 46static inline int smp_find_processor_id(int address) { return 0; }
47static inline int smp_vcpu_scheduled(int cpu) { return 1; }
48static inline void smp_yield_cpu(int cpu) { }
49static inline void smp_yield(void) { }
50static inline void smp_stop_cpu(void) { }
72 51
73#endif /* CONFIG_SMP */ 52#endif /* CONFIG_SMP */
74 53
75#ifdef CONFIG_HOTPLUG_CPU 54#ifdef CONFIG_HOTPLUG_CPU
76extern int smp_rescan_cpus(void); 55extern int smp_rescan_cpus(void);
77extern void __noreturn cpu_die(void); 56extern void __noreturn cpu_die(void);
57extern void __cpu_die(unsigned int cpu);
58extern int __cpu_disable(void);
78#else 59#else
79static inline int smp_rescan_cpus(void) { return 0; } 60static inline int smp_rescan_cpus(void) { return 0; }
80static inline void cpu_die(void) { } 61static inline void cpu_die(void) { }
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
index 533f35751aeb..c4a11cfad3c8 100644
--- a/arch/s390/include/asm/vdso.h
+++ b/arch/s390/include/asm/vdso.h
@@ -40,8 +40,8 @@ struct vdso_per_cpu_data {
40extern struct vdso_data *vdso_data; 40extern struct vdso_data *vdso_data;
41 41
42#ifdef CONFIG_64BIT 42#ifdef CONFIG_64BIT
43int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore); 43int vdso_alloc_per_cpu(struct _lowcore *lowcore);
44void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore); 44void vdso_free_per_cpu(struct _lowcore *lowcore);
45#endif 45#endif
46 46
47#endif /* __ASSEMBLY__ */ 47#endif /* __ASSEMBLY__ */