Skip to content

Commit f5daba1

Browse files
heicarstMartin Schwidefsky
authored andcommitted
[S390] split/move machine check handler code
Split machine check handler code and move it to cio and kernel code where it belongs to. No functional change. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 70193af commit f5daba1

14 files changed

Lines changed: 340 additions & 339 deletions

File tree

‎arch/s390/include/asm/crw.h‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Data definitions for channel report processing
3+
* Copyright IBM Corp. 2000,2009
4+
* Author(s): Ingo Adlung <adlung@de.ibm.com>,
5+
* Martin Schwidefsky <schwidefsky@de.ibm.com>,
6+
* Cornelia Huck <cornelia.huck@de.ibm.com>,
7+
* Heiko Carstens <heiko.carstens@de.ibm.com>,
8+
*/
9+
10+
#ifndef _ASM_S390_CRW_H
11+
#define _ASM_S390_CRW_H
12+
13+
#include <linux/types.h>
14+
15+
/*
16+
* Channel Report Word
17+
*/
18+
struct crw {
19+
__u32 res1 : 1; /* reserved zero */
20+
__u32 slct : 1; /* solicited */
21+
__u32 oflw : 1; /* overflow */
22+
__u32 chn : 1; /* chained */
23+
__u32 rsc : 4; /* reporting source code */
24+
__u32 anc : 1; /* ancillary report */
25+
__u32 res2 : 1; /* reserved zero */
26+
__u32 erc : 6; /* error-recovery code */
27+
__u32 rsid : 16; /* reporting-source ID */
28+
} __attribute__ ((packed));
29+
30+
typedef void (*crw_handler_t)(struct crw *, struct crw *, int);
31+
32+
extern int crw_register_handler(int rsc, crw_handler_t handler);
33+
extern void crw_unregister_handler(int rsc);
34+
extern void crw_handle_channel_report(void);
35+
36+
#define NR_RSCS 16
37+
38+
#define CRW_RSC_MONITOR 0x2 /* monitoring facility */
39+
#define CRW_RSC_SCH 0x3 /* subchannel */
40+
#define CRW_RSC_CPATH 0x4 /* channel path */
41+
#define CRW_RSC_CONFIG 0x9 /* configuration-alert facility */
42+
#define CRW_RSC_CSS 0xB /* channel subsystem */
43+
44+
#define CRW_ERC_EVENT 0x00 /* event information pending */
45+
#define CRW_ERC_AVAIL 0x01 /* available */
46+
#define CRW_ERC_INIT 0x02 /* initialized */
47+
#define CRW_ERC_TERROR 0x03 /* temporary error */
48+
#define CRW_ERC_IPARM 0x04 /* installed parm initialized */
49+
#define CRW_ERC_TERM 0x05 /* terminal */
50+
#define CRW_ERC_PERRN 0x06 /* perm. error, fac. not init */
51+
#define CRW_ERC_PERRI 0x07 /* perm. error, facility init */
52+
#define CRW_ERC_PMOD 0x08 /* installed parameters modified */
53+
54+
static inline int stcrw(struct crw *pcrw)
55+
{
56+
int ccode;
57+
58+
asm volatile(
59+
" stcrw 0(%2)\n"
60+
" ipm %0\n"
61+
" srl %0,28\n"
62+
: "=d" (ccode), "=m" (*pcrw)
63+
: "a" (pcrw)
64+
: "cc" );
65+
return ccode;
66+
}
67+
68+
#endif /* _ASM_S390_CRW_H */

‎arch/s390/include/asm/nmi.h‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Machine check handler definitions
3+
*
4+
* Copyright IBM Corp. 2000,2009
5+
* Author(s): Ingo Adlung <adlung@de.ibm.com>,
6+
* Martin Schwidefsky <schwidefsky@de.ibm.com>,
7+
* Cornelia Huck <cornelia.huck@de.ibm.com>,
8+
* Heiko Carstens <heiko.carstens@de.ibm.com>,
9+
*/
10+
11+
#ifndef _ASM_S390_NMI_H
12+
#define _ASM_S390_NMI_H
13+
14+
#include <linux/types.h>
15+
16+
struct mci {
17+
__u32 sd : 1; /* 00 system damage */
18+
__u32 pd : 1; /* 01 instruction-processing damage */
19+
__u32 sr : 1; /* 02 system recovery */
20+
__u32 : 1; /* 03 */
21+
__u32 cd : 1; /* 04 timing-facility damage */
22+
__u32 ed : 1; /* 05 external damage */
23+
__u32 : 1; /* 06 */
24+
__u32 dg : 1; /* 07 degradation */
25+
__u32 w : 1; /* 08 warning pending */
26+
__u32 cp : 1; /* 09 channel-report pending */
27+
__u32 sp : 1; /* 10 service-processor damage */
28+
__u32 ck : 1; /* 11 channel-subsystem damage */
29+
__u32 : 2; /* 12-13 */
30+
__u32 b : 1; /* 14 backed up */
31+
__u32 : 1; /* 15 */
32+
__u32 se : 1; /* 16 storage error uncorrected */
33+
__u32 sc : 1; /* 17 storage error corrected */
34+
__u32 ke : 1; /* 18 storage-key error uncorrected */
35+
__u32 ds : 1; /* 19 storage degradation */
36+
__u32 wp : 1; /* 20 psw mwp validity */
37+
__u32 ms : 1; /* 21 psw mask and key validity */
38+
__u32 pm : 1; /* 22 psw program mask and cc validity */
39+
__u32 ia : 1; /* 23 psw instruction address validity */
40+
__u32 fa : 1; /* 24 failing storage address validity */
41+
__u32 : 1; /* 25 */
42+
__u32 ec : 1; /* 26 external damage code validity */
43+
__u32 fp : 1; /* 27 floating point register validity */
44+
__u32 gr : 1; /* 28 general register validity */
45+
__u32 cr : 1; /* 29 control register validity */
46+
__u32 : 1; /* 30 */
47+
__u32 st : 1; /* 31 storage logical validity */
48+
__u32 ie : 1; /* 32 indirect storage error */
49+
__u32 ar : 1; /* 33 access register validity */
50+
__u32 da : 1; /* 34 delayed access exception */
51+
__u32 : 7; /* 35-41 */
52+
__u32 pr : 1; /* 42 tod programmable register validity */
53+
__u32 fc : 1; /* 43 fp control register validity */
54+
__u32 ap : 1; /* 44 ancillary report */
55+
__u32 : 1; /* 45 */
56+
__u32 ct : 1; /* 46 cpu timer validity */
57+
__u32 cc : 1; /* 47 clock comparator validity */
58+
__u32 : 16; /* 47-63 */
59+
};
60+
61+
struct pt_regs;
62+
63+
extern void s390_handle_mcck(void);
64+
extern void s390_do_machine_check(struct pt_regs *regs);
65+
66+
#endif /* _ASM_S390_NMI_H */

‎arch/s390/kernel/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w
2222
obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \
2323
processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
2424
s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \
25-
vdso.o vtime.o sysinfo.o
25+
vdso.o vtime.o sysinfo.o nmi.o
2626

2727
obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o)
2828
obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)

0 commit comments

Comments
 (0)