[S390] lowcore: Change type of lowcores softirq_pending to __u32.
[linux-2.6/btrfs-unstable.git] / include / asm-s390 / lowcore.h
blob007c8a4941b2e49710c7f11e158fc3477c41d94c
1 /*
2 * include/asm-s390/lowcore.h
4 * S390 version
5 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Hartmut Penner (hp@de.ibm.com),
7 * Martin Schwidefsky (schwidefsky@de.ibm.com),
8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
9 */
11 #ifndef _ASM_S390_LOWCORE_H
12 #define _ASM_S390_LOWCORE_H
14 #ifndef __s390x__
15 #define __LC_EXT_OLD_PSW 0x018
16 #define __LC_SVC_OLD_PSW 0x020
17 #define __LC_PGM_OLD_PSW 0x028
18 #define __LC_MCK_OLD_PSW 0x030
19 #define __LC_IO_OLD_PSW 0x038
20 #define __LC_EXT_NEW_PSW 0x058
21 #define __LC_SVC_NEW_PSW 0x060
22 #define __LC_PGM_NEW_PSW 0x068
23 #define __LC_MCK_NEW_PSW 0x070
24 #define __LC_IO_NEW_PSW 0x078
25 #else /* !__s390x__ */
26 #define __LC_EXT_OLD_PSW 0x0130
27 #define __LC_SVC_OLD_PSW 0x0140
28 #define __LC_PGM_OLD_PSW 0x0150
29 #define __LC_MCK_OLD_PSW 0x0160
30 #define __LC_IO_OLD_PSW 0x0170
31 #define __LC_EXT_NEW_PSW 0x01b0
32 #define __LC_SVC_NEW_PSW 0x01c0
33 #define __LC_PGM_NEW_PSW 0x01d0
34 #define __LC_MCK_NEW_PSW 0x01e0
35 #define __LC_IO_NEW_PSW 0x01f0
36 #endif /* !__s390x__ */
38 #define __LC_IPL_PARMBLOCK_PTR 0x014
39 #define __LC_EXT_PARAMS 0x080
40 #define __LC_CPU_ADDRESS 0x084
41 #define __LC_EXT_INT_CODE 0x086
43 #define __LC_SVC_ILC 0x088
44 #define __LC_SVC_INT_CODE 0x08A
45 #define __LC_PGM_ILC 0x08C
46 #define __LC_PGM_INT_CODE 0x08E
48 #define __LC_PER_ATMID 0x096
49 #define __LC_PER_ADDRESS 0x098
50 #define __LC_PER_ACCESS_ID 0x0A1
51 #define __LC_AR_MODE_ID 0x0A3
53 #define __LC_SUBCHANNEL_ID 0x0B8
54 #define __LC_SUBCHANNEL_NR 0x0BA
55 #define __LC_IO_INT_PARM 0x0BC
56 #define __LC_IO_INT_WORD 0x0C0
57 #define __LC_MCCK_CODE 0x0E8
59 #define __LC_RETURN_PSW 0x200
61 #define __LC_SAVE_AREA 0xC00
63 #ifndef __s390x__
64 #define __LC_IRB 0x208
65 #define __LC_SYNC_ENTER_TIMER 0x248
66 #define __LC_ASYNC_ENTER_TIMER 0x250
67 #define __LC_EXIT_TIMER 0x258
68 #define __LC_LAST_UPDATE_TIMER 0x260
69 #define __LC_USER_TIMER 0x268
70 #define __LC_SYSTEM_TIMER 0x270
71 #define __LC_LAST_UPDATE_CLOCK 0x278
72 #define __LC_STEAL_CLOCK 0x280
73 #define __LC_RETURN_MCCK_PSW 0x288
74 #define __LC_KERNEL_STACK 0xC40
75 #define __LC_THREAD_INFO 0xC44
76 #define __LC_ASYNC_STACK 0xC48
77 #define __LC_KERNEL_ASCE 0xC4C
78 #define __LC_USER_ASCE 0xC50
79 #define __LC_PANIC_STACK 0xC54
80 #define __LC_CPUID 0xC60
81 #define __LC_CPUADDR 0xC68
82 #define __LC_IPLDEV 0xC7C
83 #define __LC_CURRENT 0xC90
84 #define __LC_INT_CLOCK 0xC98
85 #else /* __s390x__ */
86 #define __LC_IRB 0x210
87 #define __LC_SYNC_ENTER_TIMER 0x250
88 #define __LC_ASYNC_ENTER_TIMER 0x258
89 #define __LC_EXIT_TIMER 0x260
90 #define __LC_LAST_UPDATE_TIMER 0x268
91 #define __LC_USER_TIMER 0x270
92 #define __LC_SYSTEM_TIMER 0x278
93 #define __LC_LAST_UPDATE_CLOCK 0x280
94 #define __LC_STEAL_CLOCK 0x288
95 #define __LC_RETURN_MCCK_PSW 0x290
96 #define __LC_KERNEL_STACK 0xD40
97 #define __LC_THREAD_INFO 0xD48
98 #define __LC_ASYNC_STACK 0xD50
99 #define __LC_KERNEL_ASCE 0xD58
100 #define __LC_USER_ASCE 0xD60
101 #define __LC_PANIC_STACK 0xD68
102 #define __LC_CPUID 0xD80
103 #define __LC_CPUADDR 0xD88
104 #define __LC_IPLDEV 0xDB8
105 #define __LC_CURRENT 0xDD8
106 #define __LC_INT_CLOCK 0xDE8
107 #endif /* __s390x__ */
110 #define __LC_PANIC_MAGIC 0xE00
111 #ifndef __s390x__
112 #define __LC_PFAULT_INTPARM 0x080
113 #define __LC_CPU_TIMER_SAVE_AREA 0x0D8
114 #define __LC_CLOCK_COMP_SAVE_AREA 0x0E0
115 #define __LC_PSW_SAVE_AREA 0x100
116 #define __LC_PREFIX_SAVE_AREA 0x108
117 #define __LC_AREGS_SAVE_AREA 0x120
118 #define __LC_FPREGS_SAVE_AREA 0x160
119 #define __LC_GPREGS_SAVE_AREA 0x180
120 #define __LC_CREGS_SAVE_AREA 0x1C0
121 #else /* __s390x__ */
122 #define __LC_PFAULT_INTPARM 0x11B8
123 #define __LC_FPREGS_SAVE_AREA 0x1200
124 #define __LC_GPREGS_SAVE_AREA 0x1280
125 #define __LC_PSW_SAVE_AREA 0x1300
126 #define __LC_PREFIX_SAVE_AREA 0x1318
127 #define __LC_FP_CREG_SAVE_AREA 0x131C
128 #define __LC_TODREG_SAVE_AREA 0x1324
129 #define __LC_CPU_TIMER_SAVE_AREA 0x1328
130 #define __LC_CLOCK_COMP_SAVE_AREA 0x1331
131 #define __LC_AREGS_SAVE_AREA 0x1340
132 #define __LC_CREGS_SAVE_AREA 0x1380
133 #endif /* __s390x__ */
135 #ifndef __ASSEMBLY__
137 #include <asm/processor.h>
138 #include <linux/types.h>
139 #include <asm/sigp.h>
141 void restart_int_handler(void);
142 void ext_int_handler(void);
143 void system_call(void);
144 void pgm_check_handler(void);
145 void mcck_int_handler(void);
146 void io_int_handler(void);
148 struct save_area_s390 {
149 u32 ext_save;
150 u64 timer;
151 u64 clk_cmp;
152 u8 pad1[24];
153 u8 psw[8];
154 u32 pref_reg;
155 u8 pad2[20];
156 u32 acc_regs[16];
157 u64 fp_regs[4];
158 u32 gp_regs[16];
159 u32 ctrl_regs[16];
160 } __attribute__((packed));
162 struct save_area_s390x {
163 u64 fp_regs[16];
164 u64 gp_regs[16];
165 u8 psw[16];
166 u8 pad1[8];
167 u32 pref_reg;
168 u32 fp_ctrl_reg;
169 u8 pad2[4];
170 u32 tod_reg;
171 u64 timer;
172 u64 clk_cmp;
173 u8 pad3[8];
174 u32 acc_regs[16];
175 u64 ctrl_regs[16];
176 } __attribute__((packed));
178 union save_area {
179 struct save_area_s390 s390;
180 struct save_area_s390x s390x;
183 #define SAVE_AREA_BASE_S390 0xd4
184 #define SAVE_AREA_BASE_S390X 0x1200
186 #ifndef __s390x__
187 #define SAVE_AREA_SIZE sizeof(struct save_area_s390)
188 #define SAVE_AREA_BASE SAVE_AREA_BASE_S390
189 #else
190 #define SAVE_AREA_SIZE sizeof(struct save_area_s390x)
191 #define SAVE_AREA_BASE SAVE_AREA_BASE_S390X
192 #endif
194 struct _lowcore
196 #ifndef __s390x__
197 /* prefix area: defined by architecture */
198 psw_t restart_psw; /* 0x000 */
199 __u32 ccw2[4]; /* 0x008 */
200 psw_t external_old_psw; /* 0x018 */
201 psw_t svc_old_psw; /* 0x020 */
202 psw_t program_old_psw; /* 0x028 */
203 psw_t mcck_old_psw; /* 0x030 */
204 psw_t io_old_psw; /* 0x038 */
205 __u8 pad1[0x58-0x40]; /* 0x040 */
206 psw_t external_new_psw; /* 0x058 */
207 psw_t svc_new_psw; /* 0x060 */
208 psw_t program_new_psw; /* 0x068 */
209 psw_t mcck_new_psw; /* 0x070 */
210 psw_t io_new_psw; /* 0x078 */
211 __u32 ext_params; /* 0x080 */
212 __u16 cpu_addr; /* 0x084 */
213 __u16 ext_int_code; /* 0x086 */
214 __u16 svc_ilc; /* 0x088 */
215 __u16 svc_code; /* 0x08a */
216 __u16 pgm_ilc; /* 0x08c */
217 __u16 pgm_code; /* 0x08e */
218 __u32 trans_exc_code; /* 0x090 */
219 __u16 mon_class_num; /* 0x094 */
220 __u16 per_perc_atmid; /* 0x096 */
221 __u32 per_address; /* 0x098 */
222 __u32 monitor_code; /* 0x09c */
223 __u8 exc_access_id; /* 0x0a0 */
224 __u8 per_access_id; /* 0x0a1 */
225 __u8 pad2[0xB8-0xA2]; /* 0x0a2 */
226 __u16 subchannel_id; /* 0x0b8 */
227 __u16 subchannel_nr; /* 0x0ba */
228 __u32 io_int_parm; /* 0x0bc */
229 __u32 io_int_word; /* 0x0c0 */
230 __u8 pad3[0xc8-0xc4]; /* 0x0c4 */
231 __u32 stfl_fac_list; /* 0x0c8 */
232 __u8 pad4[0xd4-0xcc]; /* 0x0cc */
233 __u32 extended_save_area_addr; /* 0x0d4 */
234 __u32 cpu_timer_save_area[2]; /* 0x0d8 */
235 __u32 clock_comp_save_area[2]; /* 0x0e0 */
236 __u32 mcck_interruption_code[2]; /* 0x0e8 */
237 __u8 pad5[0xf4-0xf0]; /* 0x0f0 */
238 __u32 external_damage_code; /* 0x0f4 */
239 __u32 failing_storage_address; /* 0x0f8 */
240 __u8 pad6[0x100-0xfc]; /* 0x0fc */
241 __u32 st_status_fixed_logout[4];/* 0x100 */
242 __u8 pad7[0x120-0x110]; /* 0x110 */
243 __u32 access_regs_save_area[16];/* 0x120 */
244 __u32 floating_pt_save_area[8]; /* 0x160 */
245 __u32 gpregs_save_area[16]; /* 0x180 */
246 __u32 cregs_save_area[16]; /* 0x1c0 */
248 psw_t return_psw; /* 0x200 */
249 __u8 irb[64]; /* 0x208 */
250 __u64 sync_enter_timer; /* 0x248 */
251 __u64 async_enter_timer; /* 0x250 */
252 __u64 exit_timer; /* 0x258 */
253 __u64 last_update_timer; /* 0x260 */
254 __u64 user_timer; /* 0x268 */
255 __u64 system_timer; /* 0x270 */
256 __u64 last_update_clock; /* 0x278 */
257 __u64 steal_clock; /* 0x280 */
258 psw_t return_mcck_psw; /* 0x288 */
259 __u8 pad8[0xc00-0x290]; /* 0x290 */
261 /* System info area */
262 __u32 save_area[16]; /* 0xc00 */
263 __u32 kernel_stack; /* 0xc40 */
264 __u32 thread_info; /* 0xc44 */
265 __u32 async_stack; /* 0xc48 */
266 __u32 kernel_asce; /* 0xc4c */
267 __u32 user_asce; /* 0xc50 */
268 __u32 panic_stack; /* 0xc54 */
269 __u32 user_exec_asce; /* 0xc58 */
270 __u8 pad10[0xc60-0xc5c]; /* 0xc5c */
271 /* entry.S sensitive area start */
272 struct cpuinfo_S390 cpu_data; /* 0xc60 */
273 __u32 ipl_device; /* 0xc7c */
274 /* entry.S sensitive area end */
276 /* SMP info area: defined by DJB */
277 __u64 clock_comparator; /* 0xc80 */
278 __u32 ext_call_fast; /* 0xc88 */
279 __u32 percpu_offset; /* 0xc8c */
280 __u32 current_task; /* 0xc90 */
281 __u32 softirq_pending; /* 0xc94 */
282 __u64 int_clock; /* 0xc98 */
283 __u8 pad11[0xe00-0xca0]; /* 0xca0 */
285 /* 0xe00 is used as indicator for dump tools */
286 /* whether the kernel died with panic() or not */
287 __u32 panic_magic; /* 0xe00 */
289 /* Align to the top 1k of prefix area */
290 __u8 pad12[0x1000-0xe04]; /* 0xe04 */
291 #else /* !__s390x__ */
292 /* prefix area: defined by architecture */
293 __u32 ccw1[2]; /* 0x000 */
294 __u32 ccw2[4]; /* 0x008 */
295 __u8 pad1[0x80-0x18]; /* 0x018 */
296 __u32 ext_params; /* 0x080 */
297 __u16 cpu_addr; /* 0x084 */
298 __u16 ext_int_code; /* 0x086 */
299 __u16 svc_ilc; /* 0x088 */
300 __u16 svc_code; /* 0x08a */
301 __u16 pgm_ilc; /* 0x08c */
302 __u16 pgm_code; /* 0x08e */
303 __u32 data_exc_code; /* 0x090 */
304 __u16 mon_class_num; /* 0x094 */
305 __u16 per_perc_atmid; /* 0x096 */
306 addr_t per_address; /* 0x098 */
307 __u8 exc_access_id; /* 0x0a0 */
308 __u8 per_access_id; /* 0x0a1 */
309 __u8 op_access_id; /* 0x0a2 */
310 __u8 ar_access_id; /* 0x0a3 */
311 __u8 pad2[0xA8-0xA4]; /* 0x0a4 */
312 addr_t trans_exc_code; /* 0x0A0 */
313 addr_t monitor_code; /* 0x09c */
314 __u16 subchannel_id; /* 0x0b8 */
315 __u16 subchannel_nr; /* 0x0ba */
316 __u32 io_int_parm; /* 0x0bc */
317 __u32 io_int_word; /* 0x0c0 */
318 __u8 pad3[0xc8-0xc4]; /* 0x0c4 */
319 __u32 stfl_fac_list; /* 0x0c8 */
320 __u8 pad4[0xe8-0xcc]; /* 0x0cc */
321 __u32 mcck_interruption_code[2]; /* 0x0e8 */
322 __u8 pad5[0xf4-0xf0]; /* 0x0f0 */
323 __u32 external_damage_code; /* 0x0f4 */
324 addr_t failing_storage_address; /* 0x0f8 */
325 __u8 pad6[0x120-0x100]; /* 0x100 */
326 psw_t restart_old_psw; /* 0x120 */
327 psw_t external_old_psw; /* 0x130 */
328 psw_t svc_old_psw; /* 0x140 */
329 psw_t program_old_psw; /* 0x150 */
330 psw_t mcck_old_psw; /* 0x160 */
331 psw_t io_old_psw; /* 0x170 */
332 __u8 pad7[0x1a0-0x180]; /* 0x180 */
333 psw_t restart_psw; /* 0x1a0 */
334 psw_t external_new_psw; /* 0x1b0 */
335 psw_t svc_new_psw; /* 0x1c0 */
336 psw_t program_new_psw; /* 0x1d0 */
337 psw_t mcck_new_psw; /* 0x1e0 */
338 psw_t io_new_psw; /* 0x1f0 */
339 psw_t return_psw; /* 0x200 */
340 __u8 irb[64]; /* 0x210 */
341 __u64 sync_enter_timer; /* 0x250 */
342 __u64 async_enter_timer; /* 0x258 */
343 __u64 exit_timer; /* 0x260 */
344 __u64 last_update_timer; /* 0x268 */
345 __u64 user_timer; /* 0x270 */
346 __u64 system_timer; /* 0x278 */
347 __u64 last_update_clock; /* 0x280 */
348 __u64 steal_clock; /* 0x288 */
349 psw_t return_mcck_psw; /* 0x290 */
350 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */
351 /* System info area */
352 __u64 save_area[16]; /* 0xc00 */
353 __u8 pad9[0xd40-0xc80]; /* 0xc80 */
354 __u64 kernel_stack; /* 0xd40 */
355 __u64 thread_info; /* 0xd48 */
356 __u64 async_stack; /* 0xd50 */
357 __u64 kernel_asce; /* 0xd58 */
358 __u64 user_asce; /* 0xd60 */
359 __u64 panic_stack; /* 0xd68 */
360 __u64 user_exec_asce; /* 0xd70 */
361 __u8 pad10[0xd80-0xd78]; /* 0xd78 */
362 /* entry.S sensitive area start */
363 struct cpuinfo_S390 cpu_data; /* 0xd80 */
364 __u32 ipl_device; /* 0xdb8 */
365 __u32 pad11; /* 0xdbc */
366 /* entry.S sensitive area end */
368 /* SMP info area: defined by DJB */
369 __u64 clock_comparator; /* 0xdc0 */
370 __u64 ext_call_fast; /* 0xdc8 */
371 __u64 percpu_offset; /* 0xdd0 */
372 __u64 current_task; /* 0xdd8 */
373 __u32 softirq_pending; /* 0xde0 */
374 __u32 pad_0x0de4; /* 0xde4 */
375 __u64 int_clock; /* 0xde8 */
376 __u8 pad12[0xe00-0xdf0]; /* 0xdf0 */
378 /* 0xe00 is used as indicator for dump tools */
379 /* whether the kernel died with panic() or not */
380 __u32 panic_magic; /* 0xe00 */
382 __u8 pad13[0x1200-0xe04]; /* 0xe04 */
384 /* System info area */
386 __u64 floating_pt_save_area[16]; /* 0x1200 */
387 __u64 gpregs_save_area[16]; /* 0x1280 */
388 __u32 st_status_fixed_logout[4]; /* 0x1300 */
389 __u8 pad14[0x1318-0x1310]; /* 0x1310 */
390 __u32 prefixreg_save_area; /* 0x1318 */
391 __u32 fpt_creg_save_area; /* 0x131c */
392 __u8 pad15[0x1324-0x1320]; /* 0x1320 */
393 __u32 tod_progreg_save_area; /* 0x1324 */
394 __u32 cpu_timer_save_area[2]; /* 0x1328 */
395 __u32 clock_comp_save_area[2]; /* 0x1330 */
396 __u8 pad16[0x1340-0x1338]; /* 0x1338 */
397 __u32 access_regs_save_area[16]; /* 0x1340 */
398 __u64 cregs_save_area[16]; /* 0x1380 */
400 /* align to the top of the prefix area */
402 __u8 pad17[0x2000-0x1400]; /* 0x1400 */
403 #endif /* !__s390x__ */
404 } __attribute__((packed)); /* End structure*/
406 #define S390_lowcore (*((struct _lowcore *) 0))
407 extern struct _lowcore *lowcore_ptr[];
409 static inline void set_prefix(__u32 address)
411 asm volatile("spx %0" : : "m" (address) : "memory");
414 static inline __u32 store_prefix(void)
416 __u32 address;
418 asm volatile("stpx %0" : "=m" (address));
419 return address;
422 #define __PANIC_MAGIC 0xDEADC0DE
424 #endif
426 #endif