lowcore.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. /*
  2. * include/asm-s390/lowcore.h
  3. *
  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. */
  10. #ifndef _ASM_S390_LOWCORE_H
  11. #define _ASM_S390_LOWCORE_H
  12. #ifndef __s390x__
  13. #define __LC_EXT_OLD_PSW 0x018
  14. #define __LC_SVC_OLD_PSW 0x020
  15. #define __LC_PGM_OLD_PSW 0x028
  16. #define __LC_MCK_OLD_PSW 0x030
  17. #define __LC_IO_OLD_PSW 0x038
  18. #define __LC_EXT_NEW_PSW 0x058
  19. #define __LC_SVC_NEW_PSW 0x060
  20. #define __LC_PGM_NEW_PSW 0x068
  21. #define __LC_MCK_NEW_PSW 0x070
  22. #define __LC_IO_NEW_PSW 0x078
  23. #else /* !__s390x__ */
  24. #define __LC_EXT_OLD_PSW 0x0130
  25. #define __LC_SVC_OLD_PSW 0x0140
  26. #define __LC_PGM_OLD_PSW 0x0150
  27. #define __LC_MCK_OLD_PSW 0x0160
  28. #define __LC_IO_OLD_PSW 0x0170
  29. #define __LC_EXT_NEW_PSW 0x01b0
  30. #define __LC_SVC_NEW_PSW 0x01c0
  31. #define __LC_PGM_NEW_PSW 0x01d0
  32. #define __LC_MCK_NEW_PSW 0x01e0
  33. #define __LC_IO_NEW_PSW 0x01f0
  34. #endif /* !__s390x__ */
  35. #define __LC_EXT_PARAMS 0x080
  36. #define __LC_CPU_ADDRESS 0x084
  37. #define __LC_EXT_INT_CODE 0x086
  38. #define __LC_SVC_ILC 0x088
  39. #define __LC_SVC_INT_CODE 0x08A
  40. #define __LC_PGM_ILC 0x08C
  41. #define __LC_PGM_INT_CODE 0x08E
  42. #define __LC_PER_ATMID 0x096
  43. #define __LC_PER_ADDRESS 0x098
  44. #define __LC_PER_ACCESS_ID 0x0A1
  45. #define __LC_SUBCHANNEL_ID 0x0B8
  46. #define __LC_SUBCHANNEL_NR 0x0BA
  47. #define __LC_IO_INT_PARM 0x0BC
  48. #define __LC_IO_INT_WORD 0x0C0
  49. #define __LC_MCCK_CODE 0x0E8
  50. #define __LC_RETURN_PSW 0x200
  51. #define __LC_SAVE_AREA 0xC00
  52. #ifndef __s390x__
  53. #define __LC_IRB 0x208
  54. #define __LC_SYNC_ENTER_TIMER 0x248
  55. #define __LC_ASYNC_ENTER_TIMER 0x250
  56. #define __LC_EXIT_TIMER 0x258
  57. #define __LC_LAST_UPDATE_TIMER 0x260
  58. #define __LC_USER_TIMER 0x268
  59. #define __LC_SYSTEM_TIMER 0x270
  60. #define __LC_LAST_UPDATE_CLOCK 0x278
  61. #define __LC_STEAL_CLOCK 0x280
  62. #define __LC_RETURN_MCCK_PSW 0x288
  63. #define __LC_KERNEL_STACK 0xC40
  64. #define __LC_THREAD_INFO 0xC44
  65. #define __LC_ASYNC_STACK 0xC48
  66. #define __LC_KERNEL_ASCE 0xC4C
  67. #define __LC_USER_ASCE 0xC50
  68. #define __LC_PANIC_STACK 0xC54
  69. #define __LC_CPUID 0xC60
  70. #define __LC_CPUADDR 0xC68
  71. #define __LC_IPLDEV 0xC7C
  72. #define __LC_JIFFY_TIMER 0xC80
  73. #define __LC_CURRENT 0xC90
  74. #define __LC_INT_CLOCK 0xC98
  75. #else /* __s390x__ */
  76. #define __LC_IRB 0x210
  77. #define __LC_SYNC_ENTER_TIMER 0x250
  78. #define __LC_ASYNC_ENTER_TIMER 0x258
  79. #define __LC_EXIT_TIMER 0x260
  80. #define __LC_LAST_UPDATE_TIMER 0x268
  81. #define __LC_USER_TIMER 0x270
  82. #define __LC_SYSTEM_TIMER 0x278
  83. #define __LC_LAST_UPDATE_CLOCK 0x280
  84. #define __LC_STEAL_CLOCK 0x288
  85. #define __LC_RETURN_MCCK_PSW 0x290
  86. #define __LC_KERNEL_STACK 0xD40
  87. #define __LC_THREAD_INFO 0xD48
  88. #define __LC_ASYNC_STACK 0xD50
  89. #define __LC_KERNEL_ASCE 0xD58
  90. #define __LC_USER_ASCE 0xD60
  91. #define __LC_PANIC_STACK 0xD68
  92. #define __LC_CPUID 0xD90
  93. #define __LC_CPUADDR 0xD98
  94. #define __LC_IPLDEV 0xDB8
  95. #define __LC_JIFFY_TIMER 0xDC0
  96. #define __LC_CURRENT 0xDD8
  97. #define __LC_INT_CLOCK 0xDE8
  98. #endif /* __s390x__ */
  99. #define __LC_PANIC_MAGIC 0xE00
  100. #ifndef __s390x__
  101. #define __LC_PFAULT_INTPARM 0x080
  102. #define __LC_CPU_TIMER_SAVE_AREA 0x0D8
  103. #define __LC_AREGS_SAVE_AREA 0x120
  104. #define __LC_GPREGS_SAVE_AREA 0x180
  105. #define __LC_CREGS_SAVE_AREA 0x1C0
  106. #else /* __s390x__ */
  107. #define __LC_PFAULT_INTPARM 0x11B8
  108. #define __LC_GPREGS_SAVE_AREA 0x1280
  109. #define __LC_CPU_TIMER_SAVE_AREA 0x1328
  110. #define __LC_AREGS_SAVE_AREA 0x1340
  111. #define __LC_CREGS_SAVE_AREA 0x1380
  112. #endif /* __s390x__ */
  113. #ifndef __ASSEMBLY__
  114. #include <linux/config.h>
  115. #include <asm/processor.h>
  116. #include <linux/types.h>
  117. #include <asm/sigp.h>
  118. void restart_int_handler(void);
  119. void ext_int_handler(void);
  120. void system_call(void);
  121. void pgm_check_handler(void);
  122. void mcck_int_handler(void);
  123. void io_int_handler(void);
  124. struct _lowcore
  125. {
  126. #ifndef __s390x__
  127. /* prefix area: defined by architecture */
  128. psw_t restart_psw; /* 0x000 */
  129. __u32 ccw2[4]; /* 0x008 */
  130. psw_t external_old_psw; /* 0x018 */
  131. psw_t svc_old_psw; /* 0x020 */
  132. psw_t program_old_psw; /* 0x028 */
  133. psw_t mcck_old_psw; /* 0x030 */
  134. psw_t io_old_psw; /* 0x038 */
  135. __u8 pad1[0x58-0x40]; /* 0x040 */
  136. psw_t external_new_psw; /* 0x058 */
  137. psw_t svc_new_psw; /* 0x060 */
  138. psw_t program_new_psw; /* 0x068 */
  139. psw_t mcck_new_psw; /* 0x070 */
  140. psw_t io_new_psw; /* 0x078 */
  141. __u32 ext_params; /* 0x080 */
  142. __u16 cpu_addr; /* 0x084 */
  143. __u16 ext_int_code; /* 0x086 */
  144. __u16 svc_ilc; /* 0x088 */
  145. __u16 svc_code; /* 0x08a */
  146. __u16 pgm_ilc; /* 0x08c */
  147. __u16 pgm_code; /* 0x08e */
  148. __u32 trans_exc_code; /* 0x090 */
  149. __u16 mon_class_num; /* 0x094 */
  150. __u16 per_perc_atmid; /* 0x096 */
  151. __u32 per_address; /* 0x098 */
  152. __u32 monitor_code; /* 0x09c */
  153. __u8 exc_access_id; /* 0x0a0 */
  154. __u8 per_access_id; /* 0x0a1 */
  155. __u8 pad2[0xB8-0xA2]; /* 0x0a2 */
  156. __u16 subchannel_id; /* 0x0b8 */
  157. __u16 subchannel_nr; /* 0x0ba */
  158. __u32 io_int_parm; /* 0x0bc */
  159. __u32 io_int_word; /* 0x0c0 */
  160. __u8 pad3[0xD4-0xC4]; /* 0x0c4 */
  161. __u32 extended_save_area_addr; /* 0x0d4 */
  162. __u32 cpu_timer_save_area[2]; /* 0x0d8 */
  163. __u32 clock_comp_save_area[2]; /* 0x0e0 */
  164. __u32 mcck_interruption_code[2]; /* 0x0e8 */
  165. __u8 pad4[0xf4-0xf0]; /* 0x0f0 */
  166. __u32 external_damage_code; /* 0x0f4 */
  167. __u32 failing_storage_address; /* 0x0f8 */
  168. __u8 pad5[0x100-0xfc]; /* 0x0fc */
  169. __u32 st_status_fixed_logout[4];/* 0x100 */
  170. __u8 pad6[0x120-0x110]; /* 0x110 */
  171. __u32 access_regs_save_area[16];/* 0x120 */
  172. __u32 floating_pt_save_area[8]; /* 0x160 */
  173. __u32 gpregs_save_area[16]; /* 0x180 */
  174. __u32 cregs_save_area[16]; /* 0x1c0 */
  175. psw_t return_psw; /* 0x200 */
  176. __u8 irb[64]; /* 0x208 */
  177. __u64 sync_enter_timer; /* 0x248 */
  178. __u64 async_enter_timer; /* 0x250 */
  179. __u64 exit_timer; /* 0x258 */
  180. __u64 last_update_timer; /* 0x260 */
  181. __u64 user_timer; /* 0x268 */
  182. __u64 system_timer; /* 0x270 */
  183. __u64 last_update_clock; /* 0x278 */
  184. __u64 steal_clock; /* 0x280 */
  185. psw_t return_mcck_psw; /* 0x288 */
  186. __u8 pad8[0xc00-0x290]; /* 0x290 */
  187. /* System info area */
  188. __u32 save_area[16]; /* 0xc00 */
  189. __u32 kernel_stack; /* 0xc40 */
  190. __u32 thread_info; /* 0xc44 */
  191. __u32 async_stack; /* 0xc48 */
  192. __u32 kernel_asce; /* 0xc4c */
  193. __u32 user_asce; /* 0xc50 */
  194. __u32 panic_stack; /* 0xc54 */
  195. __u8 pad10[0xc60-0xc58]; /* 0xc58 */
  196. /* entry.S sensitive area start */
  197. struct cpuinfo_S390 cpu_data; /* 0xc60 */
  198. __u32 ipl_device; /* 0xc7c */
  199. /* entry.S sensitive area end */
  200. /* SMP info area: defined by DJB */
  201. __u64 jiffy_timer; /* 0xc80 */
  202. __u32 ext_call_fast; /* 0xc88 */
  203. __u32 percpu_offset; /* 0xc8c */
  204. __u32 current_task; /* 0xc90 */
  205. __u32 softirq_pending; /* 0xc94 */
  206. __u64 int_clock; /* 0xc98 */
  207. __u8 pad11[0xe00-0xca0]; /* 0xca0 */
  208. /* 0xe00 is used as indicator for dump tools */
  209. /* whether the kernel died with panic() or not */
  210. __u32 panic_magic; /* 0xe00 */
  211. /* Align to the top 1k of prefix area */
  212. __u8 pad12[0x1000-0xe04]; /* 0xe04 */
  213. #else /* !__s390x__ */
  214. /* prefix area: defined by architecture */
  215. __u32 ccw1[2]; /* 0x000 */
  216. __u32 ccw2[4]; /* 0x008 */
  217. __u8 pad1[0x80-0x18]; /* 0x018 */
  218. __u32 ext_params; /* 0x080 */
  219. __u16 cpu_addr; /* 0x084 */
  220. __u16 ext_int_code; /* 0x086 */
  221. __u16 svc_ilc; /* 0x088 */
  222. __u16 svc_code; /* 0x08a */
  223. __u16 pgm_ilc; /* 0x08c */
  224. __u16 pgm_code; /* 0x08e */
  225. __u32 data_exc_code; /* 0x090 */
  226. __u16 mon_class_num; /* 0x094 */
  227. __u16 per_perc_atmid; /* 0x096 */
  228. addr_t per_address; /* 0x098 */
  229. __u8 exc_access_id; /* 0x0a0 */
  230. __u8 per_access_id; /* 0x0a1 */
  231. __u8 op_access_id; /* 0x0a2 */
  232. __u8 ar_access_id; /* 0x0a3 */
  233. __u8 pad2[0xA8-0xA4]; /* 0x0a4 */
  234. addr_t trans_exc_code; /* 0x0A0 */
  235. addr_t monitor_code; /* 0x09c */
  236. __u16 subchannel_id; /* 0x0b8 */
  237. __u16 subchannel_nr; /* 0x0ba */
  238. __u32 io_int_parm; /* 0x0bc */
  239. __u32 io_int_word; /* 0x0c0 */
  240. __u8 pad3[0xc8-0xc4]; /* 0x0c4 */
  241. __u32 stfl_fac_list; /* 0x0c8 */
  242. __u8 pad4[0xe8-0xcc]; /* 0x0cc */
  243. __u32 mcck_interruption_code[2]; /* 0x0e8 */
  244. __u8 pad5[0xf4-0xf0]; /* 0x0f0 */
  245. __u32 external_damage_code; /* 0x0f4 */
  246. addr_t failing_storage_address; /* 0x0f8 */
  247. __u8 pad6[0x120-0x100]; /* 0x100 */
  248. psw_t restart_old_psw; /* 0x120 */
  249. psw_t external_old_psw; /* 0x130 */
  250. psw_t svc_old_psw; /* 0x140 */
  251. psw_t program_old_psw; /* 0x150 */
  252. psw_t mcck_old_psw; /* 0x160 */
  253. psw_t io_old_psw; /* 0x170 */
  254. __u8 pad7[0x1a0-0x180]; /* 0x180 */
  255. psw_t restart_psw; /* 0x1a0 */
  256. psw_t external_new_psw; /* 0x1b0 */
  257. psw_t svc_new_psw; /* 0x1c0 */
  258. psw_t program_new_psw; /* 0x1d0 */
  259. psw_t mcck_new_psw; /* 0x1e0 */
  260. psw_t io_new_psw; /* 0x1f0 */
  261. psw_t return_psw; /* 0x200 */
  262. __u8 irb[64]; /* 0x210 */
  263. __u64 sync_enter_timer; /* 0x250 */
  264. __u64 async_enter_timer; /* 0x258 */
  265. __u64 exit_timer; /* 0x260 */
  266. __u64 last_update_timer; /* 0x268 */
  267. __u64 user_timer; /* 0x270 */
  268. __u64 system_timer; /* 0x278 */
  269. __u64 last_update_clock; /* 0x280 */
  270. __u64 steal_clock; /* 0x288 */
  271. psw_t return_mcck_psw; /* 0x290 */
  272. __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */
  273. /* System info area */
  274. __u64 save_area[16]; /* 0xc00 */
  275. __u8 pad9[0xd40-0xc80]; /* 0xc80 */
  276. __u64 kernel_stack; /* 0xd40 */
  277. __u64 thread_info; /* 0xd48 */
  278. __u64 async_stack; /* 0xd50 */
  279. __u64 kernel_asce; /* 0xd58 */
  280. __u64 user_asce; /* 0xd60 */
  281. __u64 panic_stack; /* 0xd68 */
  282. __u8 pad10[0xd80-0xd70]; /* 0xd70 */
  283. /* entry.S sensitive area start */
  284. struct cpuinfo_S390 cpu_data; /* 0xd80 */
  285. __u32 ipl_device; /* 0xdb8 */
  286. __u32 pad11; /* 0xdbc */
  287. /* entry.S sensitive area end */
  288. /* SMP info area: defined by DJB */
  289. __u64 jiffy_timer; /* 0xdc0 */
  290. __u64 ext_call_fast; /* 0xdc8 */
  291. __u64 percpu_offset; /* 0xdd0 */
  292. __u64 current_task; /* 0xdd8 */
  293. __u64 softirq_pending; /* 0xde0 */
  294. __u64 int_clock; /* 0xde8 */
  295. __u8 pad12[0xe00-0xdf0]; /* 0xdf0 */
  296. /* 0xe00 is used as indicator for dump tools */
  297. /* whether the kernel died with panic() or not */
  298. __u32 panic_magic; /* 0xe00 */
  299. __u8 pad13[0x1200-0xe04]; /* 0xe04 */
  300. /* System info area */
  301. __u64 floating_pt_save_area[16]; /* 0x1200 */
  302. __u64 gpregs_save_area[16]; /* 0x1280 */
  303. __u32 st_status_fixed_logout[4]; /* 0x1300 */
  304. __u8 pad14[0x1318-0x1310]; /* 0x1310 */
  305. __u32 prefixreg_save_area; /* 0x1318 */
  306. __u32 fpt_creg_save_area; /* 0x131c */
  307. __u8 pad15[0x1324-0x1320]; /* 0x1320 */
  308. __u32 tod_progreg_save_area; /* 0x1324 */
  309. __u32 cpu_timer_save_area[2]; /* 0x1328 */
  310. __u32 clock_comp_save_area[2]; /* 0x1330 */
  311. __u8 pad16[0x1340-0x1338]; /* 0x1338 */
  312. __u32 access_regs_save_area[16]; /* 0x1340 */
  313. __u64 cregs_save_area[16]; /* 0x1380 */
  314. /* align to the top of the prefix area */
  315. __u8 pad17[0x2000-0x1400]; /* 0x1400 */
  316. #endif /* !__s390x__ */
  317. } __attribute__((packed)); /* End structure*/
  318. #define S390_lowcore (*((struct _lowcore *) 0))
  319. extern struct _lowcore *lowcore_ptr[];
  320. static inline void set_prefix(__u32 address)
  321. {
  322. __asm__ __volatile__ ("spx %0" : : "m" (address) : "memory" );
  323. }
  324. #define __PANIC_MAGIC 0xDEADC0DE
  325. #endif
  326. #endif