2 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
12 * I/O interruptions specific constants & structures
17 } __attribute__((packed
));
20 u8 sd
:1, /* System Damage */
21 pd
:1, /* Instruction-processing damage */
22 sr
:1, /* System recovery */
24 cd
:1, /* Timing-facility damage */
25 ed
:1, /* External damage */
27 dg
:1; /* Degradation */
29 cp
:1, /* Channel report pending */
30 sp
:1, /* Service-processor damage */
31 ck
:1, /* Channel-subsystem damage */
35 u8 se
:1, /* Storage error uncorrected */
36 sc
:1, /* Storage error corrected */
37 ke
:1, /* Storage-key error uncorrected */
38 ds
:1, /* Storage degradation */
39 wp
:1, /* PSW-MWP validity */
40 ms
:1, /* PSW mask and key validity */
41 pm
:1, /* PSW program-mask and condition-code validity */
42 ia
:1; /* PSW-instruction-address validity */
43 u8 fa
:1, /* Failing-storage-address validity */
45 ec
:1, /* External-damage-code */
46 fp
:1, /* Floating-point-register validity */
47 gr
:1, /* General-register validity */
48 cr
:1, /* Control-register validity */
50 st
:1; /* Storage logical validity */
51 u8 ie
:1, /* Indirect storage error */
52 ar
:1, /* Access-register validity */
53 da
:1, /* Delayed-access exception */
56 pr
:1, /* TOD-programable-register validity */
57 fc
:1, /* Floating-point-control-register validity */
58 ap
:1, /* Ancilary report */
60 ct
:1, /* CPU-timer validity */
61 cc
:1; /* Clock-comparator validity */
64 } __attribute__((packed
));
66 #define PSA_INT_GPR ((u64*) 0x200)
67 #define PSA_TMP_PSW ((struct psw*) 0x280)
69 #define IO_INT_OLD_PSW ((void*) 0x170)
70 #define IO_INT_NEW_PSW ((void*) 0x1f0)
71 #define IO_INT_CODE ((struct io_int_code*) 0xb8)
73 #define EXT_INT_OLD_PSW ((void*) 0x130)
74 #define EXT_INT_NEW_PSW ((void*) 0x1b0)
75 #define EXT_INT_CODE ((u16*) 0x86)
77 #define SVC_INT_OLD_PSW ((void*) 0x140)
78 #define SVC_INT_NEW_PSW ((void*) 0x1c0)
79 #define SVC_INT_CODE ((u16*) 0x8a)
81 #define PGM_INT_OLD_PSW ((void*) 0x150)
82 #define PGM_INT_NEW_PSW ((void*) 0x1d0)
83 #define PGM_INT_ILC ((u8*) 0x8d)
84 #define PGM_INT_CODE ((u16*) 0x8e)
86 #define MCH_INT_OLD_PSW ((void*) 0x160)
87 #define MCH_INT_NEW_PSW ((void*) 0x1e0)
88 #define MCH_INT_CODE ((struct mch_int_code*) 232)
91 * Assembly stubs to call the C-handlers
93 extern void IO_INT(void);
94 extern void EXT_INT(void);
95 extern void SVC_INT(void);
96 extern void PGM_INT(void);
97 extern void MCH_INT(void);
100 * local_int_disable - disable interruptions & return old mask
102 #define local_int_disable() ({ \
103 unsigned long __flags; \
104 __asm__ __volatile__ ( \
105 "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \
110 * local_int_restore - restore interrupt mask
113 #define local_int_restore(x) \
114 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory")
117 * local_int_restore - restore interrupt mask
120 static inline int interruptable()
124 __asm__
__volatile__(
134 return (x
& 0x43) != 0;
137 extern void set_timer(void);
140 * The Supervisor-Service call table
142 #define SVC_SCHEDULE 0
143 #define SVC_SCHEDULE_BLOCKED 1
144 #define SVC_SCHEDULE_EXIT 2
146 extern u64 svc_table
[NR_SVC
];
148 /* Interrupt handlers */
149 extern void __pgm_int_handler(void);
150 extern void __ext_int_handler(void);
151 extern void __io_int_handler(void);
153 /* Interrupt handler stack pointer */
154 extern u8
*int_stack_ptr
;