[S390] Fix comments in lowcore structure
[linux-2.6/x86.git] / arch / s390 / include / asm / lowcore.h
blobf94386ece0d3028cc9724fc629831dae78db3aef
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_LAST_BREAK 0x110
61 #define __LC_RETURN_PSW 0x200
63 #define __LC_SAVE_AREA 0xC00
65 #ifndef __s390x__
66 #define __LC_IRB 0x208
67 #define __LC_SYNC_ENTER_TIMER 0x248
68 #define __LC_ASYNC_ENTER_TIMER 0x250
69 #define __LC_EXIT_TIMER 0x258
70 #define __LC_USER_TIMER 0x260
71 #define __LC_SYSTEM_TIMER 0x268
72 #define __LC_STEAL_TIMER 0x270
73 #define __LC_LAST_UPDATE_TIMER 0x278
74 #define __LC_LAST_UPDATE_CLOCK 0x280
75 #define __LC_RETURN_MCCK_PSW 0x288
76 #define __LC_KERNEL_STACK 0xC40
77 #define __LC_THREAD_INFO 0xC44
78 #define __LC_ASYNC_STACK 0xC48
79 #define __LC_KERNEL_ASCE 0xC4C
80 #define __LC_USER_ASCE 0xC50
81 #define __LC_PANIC_STACK 0xC54
82 #define __LC_CPUID 0xC60
83 #define __LC_CPUADDR 0xC68
84 #define __LC_IPLDEV 0xC7C
85 #define __LC_CURRENT 0xC90
86 #define __LC_INT_CLOCK 0xC98
87 #else /* __s390x__ */
88 #define __LC_IRB 0x210
89 #define __LC_SYNC_ENTER_TIMER 0x250
90 #define __LC_ASYNC_ENTER_TIMER 0x258
91 #define __LC_EXIT_TIMER 0x260
92 #define __LC_USER_TIMER 0x268
93 #define __LC_SYSTEM_TIMER 0x270
94 #define __LC_STEAL_TIMER 0x278
95 #define __LC_LAST_UPDATE_TIMER 0x280
96 #define __LC_LAST_UPDATE_CLOCK 0x288
97 #define __LC_RETURN_MCCK_PSW 0x290
98 #define __LC_KERNEL_STACK 0xD40
99 #define __LC_THREAD_INFO 0xD48
100 #define __LC_ASYNC_STACK 0xD50
101 #define __LC_KERNEL_ASCE 0xD58
102 #define __LC_USER_ASCE 0xD60
103 #define __LC_PANIC_STACK 0xD68
104 #define __LC_CPUID 0xD80
105 #define __LC_CPUADDR 0xD88
106 #define __LC_IPLDEV 0xDB8
107 #define __LC_CURRENT 0xDD8
108 #define __LC_INT_CLOCK 0xDE8
109 #define __LC_VDSO_PER_CPU 0xE38
110 #endif /* __s390x__ */
112 #define __LC_PASTE 0xE40
114 #define __LC_DUMP_REIPL 0xE00
115 #ifndef __s390x__
116 #define __LC_PFAULT_INTPARM 0x080
117 #define __LC_CPU_TIMER_SAVE_AREA 0x0D8
118 #define __LC_CLOCK_COMP_SAVE_AREA 0x0E0
119 #define __LC_PSW_SAVE_AREA 0x100
120 #define __LC_PREFIX_SAVE_AREA 0x108
121 #define __LC_AREGS_SAVE_AREA 0x120
122 #define __LC_FPREGS_SAVE_AREA 0x160
123 #define __LC_GPREGS_SAVE_AREA 0x180
124 #define __LC_CREGS_SAVE_AREA 0x1C0
125 #else /* __s390x__ */
126 #define __LC_PFAULT_INTPARM 0x11B8
127 #define __LC_FPREGS_SAVE_AREA 0x1200
128 #define __LC_GPREGS_SAVE_AREA 0x1280
129 #define __LC_PSW_SAVE_AREA 0x1300
130 #define __LC_PREFIX_SAVE_AREA 0x1318
131 #define __LC_FP_CREG_SAVE_AREA 0x131C
132 #define __LC_TODREG_SAVE_AREA 0x1324
133 #define __LC_CPU_TIMER_SAVE_AREA 0x1328
134 #define __LC_CLOCK_COMP_SAVE_AREA 0x1331
135 #define __LC_AREGS_SAVE_AREA 0x1340
136 #define __LC_CREGS_SAVE_AREA 0x1380
137 #endif /* __s390x__ */
139 #ifndef __ASSEMBLY__
141 #include <asm/processor.h>
142 #include <linux/types.h>
143 #include <asm/sigp.h>
145 void restart_int_handler(void);
146 void ext_int_handler(void);
147 void system_call(void);
148 void pgm_check_handler(void);
149 void mcck_int_handler(void);
150 void io_int_handler(void);
152 struct save_area_s390 {
153 u32 ext_save;
154 u64 timer;
155 u64 clk_cmp;
156 u8 pad1[24];
157 u8 psw[8];
158 u32 pref_reg;
159 u8 pad2[20];
160 u32 acc_regs[16];
161 u64 fp_regs[4];
162 u32 gp_regs[16];
163 u32 ctrl_regs[16];
164 } __attribute__((packed));
166 struct save_area_s390x {
167 u64 fp_regs[16];
168 u64 gp_regs[16];
169 u8 psw[16];
170 u8 pad1[8];
171 u32 pref_reg;
172 u32 fp_ctrl_reg;
173 u8 pad2[4];
174 u32 tod_reg;
175 u64 timer;
176 u64 clk_cmp;
177 u8 pad3[8];
178 u32 acc_regs[16];
179 u64 ctrl_regs[16];
180 } __attribute__((packed));
182 union save_area {
183 struct save_area_s390 s390;
184 struct save_area_s390x s390x;
187 #define SAVE_AREA_BASE_S390 0xd4
188 #define SAVE_AREA_BASE_S390X 0x1200
190 #ifndef __s390x__
191 #define SAVE_AREA_SIZE sizeof(struct save_area_s390)
192 #define SAVE_AREA_BASE SAVE_AREA_BASE_S390
193 #else
194 #define SAVE_AREA_SIZE sizeof(struct save_area_s390x)
195 #define SAVE_AREA_BASE SAVE_AREA_BASE_S390X
196 #endif
198 struct _lowcore
200 #ifndef __s390x__
201 /* prefix area: defined by architecture */
202 psw_t restart_psw; /* 0x000 */
203 __u32 ccw2[4]; /* 0x008 */
204 psw_t external_old_psw; /* 0x018 */
205 psw_t svc_old_psw; /* 0x020 */
206 psw_t program_old_psw; /* 0x028 */
207 psw_t mcck_old_psw; /* 0x030 */
208 psw_t io_old_psw; /* 0x038 */
209 __u8 pad1[0x58-0x40]; /* 0x040 */
210 psw_t external_new_psw; /* 0x058 */
211 psw_t svc_new_psw; /* 0x060 */
212 psw_t program_new_psw; /* 0x068 */
213 psw_t mcck_new_psw; /* 0x070 */
214 psw_t io_new_psw; /* 0x078 */
215 __u32 ext_params; /* 0x080 */
216 __u16 cpu_addr; /* 0x084 */
217 __u16 ext_int_code; /* 0x086 */
218 __u16 svc_ilc; /* 0x088 */
219 __u16 svc_code; /* 0x08a */
220 __u16 pgm_ilc; /* 0x08c */
221 __u16 pgm_code; /* 0x08e */
222 __u32 trans_exc_code; /* 0x090 */
223 __u16 mon_class_num; /* 0x094 */
224 __u16 per_perc_atmid; /* 0x096 */
225 __u32 per_address; /* 0x098 */
226 __u32 monitor_code; /* 0x09c */
227 __u8 exc_access_id; /* 0x0a0 */
228 __u8 per_access_id; /* 0x0a1 */
229 __u8 pad2[0xB8-0xA2]; /* 0x0a2 */
230 __u16 subchannel_id; /* 0x0b8 */
231 __u16 subchannel_nr; /* 0x0ba */
232 __u32 io_int_parm; /* 0x0bc */
233 __u32 io_int_word; /* 0x0c0 */
234 __u8 pad3[0xc8-0xc4]; /* 0x0c4 */
235 __u32 stfl_fac_list; /* 0x0c8 */
236 __u8 pad4[0xd4-0xcc]; /* 0x0cc */
237 __u32 extended_save_area_addr; /* 0x0d4 */
238 __u32 cpu_timer_save_area[2]; /* 0x0d8 */
239 __u32 clock_comp_save_area[2]; /* 0x0e0 */
240 __u32 mcck_interruption_code[2]; /* 0x0e8 */
241 __u8 pad5[0xf4-0xf0]; /* 0x0f0 */
242 __u32 external_damage_code; /* 0x0f4 */
243 __u32 failing_storage_address; /* 0x0f8 */
244 __u8 pad6[0x100-0xfc]; /* 0x0fc */
245 __u32 st_status_fixed_logout[4];/* 0x100 */
246 __u8 pad7[0x120-0x110]; /* 0x110 */
247 __u32 access_regs_save_area[16];/* 0x120 */
248 __u32 floating_pt_save_area[8]; /* 0x160 */
249 __u32 gpregs_save_area[16]; /* 0x180 */
250 __u32 cregs_save_area[16]; /* 0x1c0 */
252 psw_t return_psw; /* 0x200 */
253 __u8 irb[64]; /* 0x208 */
254 __u64 sync_enter_timer; /* 0x248 */
255 __u64 async_enter_timer; /* 0x250 */
256 __u64 exit_timer; /* 0x258 */
257 __u64 user_timer; /* 0x260 */
258 __u64 system_timer; /* 0x268 */
259 __u64 steal_timer; /* 0x270 */
260 __u64 last_update_timer; /* 0x278 */
261 __u64 last_update_clock; /* 0x280 */
262 psw_t return_mcck_psw; /* 0x288 */
263 __u8 pad8[0xc00-0x290]; /* 0x290 */
265 /* System info area */
266 __u32 save_area[16]; /* 0xc00 */
267 __u32 kernel_stack; /* 0xc40 */
268 __u32 thread_info; /* 0xc44 */
269 __u32 async_stack; /* 0xc48 */
270 __u32 kernel_asce; /* 0xc4c */
271 __u32 user_asce; /* 0xc50 */
272 __u32 panic_stack; /* 0xc54 */
273 __u32 user_exec_asce; /* 0xc58 */
274 __u8 pad10[0xc60-0xc5c]; /* 0xc5c */
275 /* entry.S sensitive area start */
276 struct cpuinfo_S390 cpu_data; /* 0xc60 */
277 __u32 ipl_device; /* 0xc7c */
278 /* entry.S sensitive area end */
280 /* SMP info area: defined by DJB */
281 __u64 clock_comparator; /* 0xc80 */
282 __u32 ext_call_fast; /* 0xc88 */
283 __u32 percpu_offset; /* 0xc8c */
284 __u32 current_task; /* 0xc90 */
285 __u32 softirq_pending; /* 0xc94 */
286 __u64 int_clock; /* 0xc98 */
287 __u8 pad11[0xe00-0xca0]; /* 0xca0 */
289 /* 0xe00 contains the address of the IPL Parameter */
290 /* Information block. Dump tools need IPIB for IPL */
291 /* after dump. */
292 __u32 ipib; /* 0xe00 */
293 __u32 ipib_checksum; /* 0xe04 */
295 /* Align to the top 1k of prefix area */
296 __u8 pad12[0x1000-0xe08]; /* 0xe08 */
297 #else /* !__s390x__ */
298 /* prefix area: defined by architecture */
299 __u32 ccw1[2]; /* 0x000 */
300 __u32 ccw2[4]; /* 0x008 */
301 __u8 pad1[0x80-0x18]; /* 0x018 */
302 __u32 ext_params; /* 0x080 */
303 __u16 cpu_addr; /* 0x084 */
304 __u16 ext_int_code; /* 0x086 */
305 __u16 svc_ilc; /* 0x088 */
306 __u16 svc_code; /* 0x08a */
307 __u16 pgm_ilc; /* 0x08c */
308 __u16 pgm_code; /* 0x08e */
309 __u32 data_exc_code; /* 0x090 */
310 __u16 mon_class_num; /* 0x094 */
311 __u16 per_perc_atmid; /* 0x096 */
312 addr_t per_address; /* 0x098 */
313 __u8 exc_access_id; /* 0x0a0 */
314 __u8 per_access_id; /* 0x0a1 */
315 __u8 op_access_id; /* 0x0a2 */
316 __u8 ar_access_id; /* 0x0a3 */
317 __u8 pad2[0xA8-0xA4]; /* 0x0a4 */
318 addr_t trans_exc_code; /* 0x0a8 */
319 addr_t monitor_code; /* 0x0b0 */
320 __u16 subchannel_id; /* 0x0b8 */
321 __u16 subchannel_nr; /* 0x0ba */
322 __u32 io_int_parm; /* 0x0bc */
323 __u32 io_int_word; /* 0x0c0 */
324 __u8 pad3[0xc8-0xc4]; /* 0x0c4 */
325 __u32 stfl_fac_list; /* 0x0c8 */
326 __u8 pad4[0xe8-0xcc]; /* 0x0cc */
327 __u32 mcck_interruption_code[2]; /* 0x0e8 */
328 __u8 pad5[0xf4-0xf0]; /* 0x0f0 */
329 __u32 external_damage_code; /* 0x0f4 */
330 addr_t failing_storage_address; /* 0x0f8 */
331 __u8 pad6[0x120-0x100]; /* 0x100 */
332 psw_t restart_old_psw; /* 0x120 */
333 psw_t external_old_psw; /* 0x130 */
334 psw_t svc_old_psw; /* 0x140 */
335 psw_t program_old_psw; /* 0x150 */
336 psw_t mcck_old_psw; /* 0x160 */
337 psw_t io_old_psw; /* 0x170 */
338 __u8 pad7[0x1a0-0x180]; /* 0x180 */
339 psw_t restart_psw; /* 0x1a0 */
340 psw_t external_new_psw; /* 0x1b0 */
341 psw_t svc_new_psw; /* 0x1c0 */
342 psw_t program_new_psw; /* 0x1d0 */
343 psw_t mcck_new_psw; /* 0x1e0 */
344 psw_t io_new_psw; /* 0x1f0 */
345 psw_t return_psw; /* 0x200 */
346 __u8 irb[64]; /* 0x210 */
347 __u64 sync_enter_timer; /* 0x250 */
348 __u64 async_enter_timer; /* 0x258 */
349 __u64 exit_timer; /* 0x260 */
350 __u64 user_timer; /* 0x268 */
351 __u64 system_timer; /* 0x270 */
352 __u64 steal_timer; /* 0x278 */
353 __u64 last_update_timer; /* 0x280 */
354 __u64 last_update_clock; /* 0x288 */
355 psw_t return_mcck_psw; /* 0x290 */
356 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */
357 /* System info area */
358 __u64 save_area[16]; /* 0xc00 */
359 __u8 pad9[0xd40-0xc80]; /* 0xc80 */
360 __u64 kernel_stack; /* 0xd40 */
361 __u64 thread_info; /* 0xd48 */
362 __u64 async_stack; /* 0xd50 */
363 __u64 kernel_asce; /* 0xd58 */
364 __u64 user_asce; /* 0xd60 */
365 __u64 panic_stack; /* 0xd68 */
366 __u64 user_exec_asce; /* 0xd70 */
367 __u8 pad10[0xd80-0xd78]; /* 0xd78 */
368 /* entry.S sensitive area start */
369 struct cpuinfo_S390 cpu_data; /* 0xd80 */
370 __u32 ipl_device; /* 0xdb8 */
371 __u32 pad11; /* 0xdbc */
372 /* entry.S sensitive area end */
374 /* SMP info area: defined by DJB */
375 __u64 clock_comparator; /* 0xdc0 */
376 __u64 ext_call_fast; /* 0xdc8 */
377 __u64 percpu_offset; /* 0xdd0 */
378 __u64 current_task; /* 0xdd8 */
379 __u32 softirq_pending; /* 0xde0 */
380 __u32 pad_0x0de4; /* 0xde4 */
381 __u64 int_clock; /* 0xde8 */
382 __u8 pad12[0xe00-0xdf0]; /* 0xdf0 */
384 /* 0xe00 contains the address of the IPL Parameter */
385 /* Information block. Dump tools need IPIB for IPL */
386 /* after dump. */
387 __u64 ipib; /* 0xe00 */
388 __u32 ipib_checksum; /* 0xe08 */
390 /* Per cpu primary space access list */
391 __u8 pad_0xe0c[0xe38-0xe0c]; /* 0xe0c */
392 __u64 vdso_per_cpu_data; /* 0xe38 */
393 __u32 paste[16]; /* 0xe40 */
395 __u8 pad13[0x11b8-0xe80]; /* 0xe80 */
397 /* 64 bit extparam used for pfault, diag 250 etc */
398 __u64 ext_params2; /* 0x11B8 */
400 __u8 pad14[0x1200-0x11C0]; /* 0x11C0 */
402 /* System info area */
404 __u64 floating_pt_save_area[16]; /* 0x1200 */
405 __u64 gpregs_save_area[16]; /* 0x1280 */
406 __u32 st_status_fixed_logout[4]; /* 0x1300 */
407 __u8 pad15[0x1318-0x1310]; /* 0x1310 */
408 __u32 prefixreg_save_area; /* 0x1318 */
409 __u32 fpt_creg_save_area; /* 0x131c */
410 __u8 pad16[0x1324-0x1320]; /* 0x1320 */
411 __u32 tod_progreg_save_area; /* 0x1324 */
412 __u32 cpu_timer_save_area[2]; /* 0x1328 */
413 __u32 clock_comp_save_area[2]; /* 0x1330 */
414 __u8 pad17[0x1340-0x1338]; /* 0x1338 */
415 __u32 access_regs_save_area[16]; /* 0x1340 */
416 __u64 cregs_save_area[16]; /* 0x1380 */
418 /* align to the top of the prefix area */
420 __u8 pad18[0x2000-0x1400]; /* 0x1400 */
421 #endif /* !__s390x__ */
422 } __attribute__((packed)); /* End structure*/
424 #define S390_lowcore (*((struct _lowcore *) 0))
425 extern struct _lowcore *lowcore_ptr[];
427 static inline void set_prefix(__u32 address)
429 asm volatile("spx %0" : : "m" (address) : "memory");
432 static inline __u32 store_prefix(void)
434 __u32 address;
436 asm volatile("stpx %0" : "=m" (address));
437 return address;
440 #endif
442 #endif