File: /usr/src/linux/include/asm-s390x/s390mach.h
1 /*
2 * arch/s390/kernel/s390mach.h
3 * S/390 data definitions for machine check processing
4 *
5 * S390 version
6 * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Ingo Adlung (adlung@de.ibm.com)
8 */
9
10 #ifndef __s390mach_h
11 #define __s390mach_h
12
13 #include <asm/types.h>
14
15 typedef struct _mci {
16 __u32 to_be_defined_1 : 9;
17 __u32 cp : 1; /* channel-report pending */
18 __u32 to_be_defined_2 : 22;
19 __u32 to_be_defined_3;
20 } mci_t;
21
22 //
23 // machine-check-interruption code
24 //
25 typedef struct _mcic {
26 union _mcc {
27 __u64 mcl; /* machine check int. code - long info */
28 mci_t mcd; /* machine check int. code - details */
29 } mcc;
30 } __attribute__ ((packed)) mcic_t;
31
32 //
33 // Channel Report Word
34 //
35 typedef struct _crw {
36 __u32 res1 : 1; /* reserved zero */
37 __u32 slct : 1; /* solicited */
38 __u32 oflw : 1; /* overflow */
39 __u32 chn : 1; /* chained */
40 __u32 rsc : 4; /* reporting source code */
41 __u32 anc : 1; /* ancillary report */
42 __u32 res2 : 1; /* reserved zero */
43 __u32 erc : 6; /* error-recovery code */
44 __u32 rsid : 16; /* reporting-source ID */
45 } __attribute__ ((packed)) crw_t;
46
47 #define CRW_RSC_MONITOR 0x2 /* monitoring facility */
48 #define CRW_RSC_SCH 0x3 /* subchannel */
49 #define CRW_RSC_CPATH 0x4 /* channel path */
50 #define CRW_RSC_CONFIG 0x9 /* configuration-alert facility */
51 #define CRW_RSC_CSS 0xB /* channel subsystem */
52
53 #define CRW_ERC_EVENT 0x00 /* event information pending */
54 #define CRW_ERC_AVAIL 0x01 /* available */
55 #define CRW_ERC_INIT 0x02 /* initialized */
56 #define CRW_ERC_TERROR 0x03 /* temporary error */
57 #define CRW_ERC_IPARM 0x04 /* installed parm initialized */
58 #define CRW_ERC_TERM 0x05 /* terminal */
59 #define CRW_ERC_PERRN 0x06 /* perm. error, fac. not init */
60 #define CRW_ERC_PERRI 0x07 /* perm. error, facility init */
61 #define CRW_ERC_PMOD 0x08 /* installed parameters modified */
62
63 #define MAX_CRW_PENDING 1024
64 #define MAX_MACH_PENDING 1024
65
66 //
67 // CRW Entry
68 //
69 typedef struct _crwe {
70 crw_t crw;
71 struct _crwe *crwe_next;
72 } __attribute__ ((packed)) crwe_t;
73
74 typedef struct _mache {
75 spinlock_t lock;
76 unsigned int status;
77 mcic_t mcic;
78 union _mc {
79 crwe_t *crwe; /* CRW if applicable */
80 } mc;
81 struct _mache *next;
82 struct _mache *prev;
83 } mache_t;
84
85 #define MCHCHK_STATUS_TO_PROCESS 0x00000001
86 #define MCHCHK_STATUS_IN_PROGRESS 0x00000002
87 #define MCHCHK_STATUS_WAITING 0x00000004
88
89 void s390_init_machine_check( void );
90 void s390_do_machine_check ( void );
91 void s390_do_crw_pending ( crwe_t *pcrwe );
92
93 extern __inline__ int stcrw( __u32 *pcrw )
94 {
95 int ccode;
96
97 __asm__ __volatile__(
98 "STCRW 0(%1)\n\t"
99 "IPM %0\n\t"
100 "SRL %0,28\n\t"
101 : "=d" (ccode) : "a" (pcrw)
102 : "cc", "1" );
103 return ccode;
104 }
105
106 #endif /* __s390mach */
107