1f5daba1dSHeiko Carstens /* 2f5daba1dSHeiko Carstens * Machine check handler definitions 3f5daba1dSHeiko Carstens * 4f5daba1dSHeiko Carstens * Copyright IBM Corp. 2000, 2009 5f5daba1dSHeiko Carstens * Author(s): Ingo Adlung <adlung@de.ibm.com>, 6f5daba1dSHeiko Carstens * Martin Schwidefsky <schwidefsky@de.ibm.com>, 7f5daba1dSHeiko Carstens * Cornelia Huck <cornelia.huck@de.ibm.com>, 8f5daba1dSHeiko Carstens * Heiko Carstens <heiko.carstens@de.ibm.com>, 9f5daba1dSHeiko Carstens */ 10f5daba1dSHeiko Carstens 11f5daba1dSHeiko Carstens #ifndef _ASM_S390_NMI_H 12f5daba1dSHeiko Carstens #define _ASM_S390_NMI_H 13f5daba1dSHeiko Carstens 1483abeffbSHendrik Brueckner #include <linux/const.h> 15f5daba1dSHeiko Carstens #include <linux/types.h> 16f5daba1dSHeiko Carstens 17*c929500dSQingFeng Hao #define MCIC_SUBCLASS_MASK (1ULL<<63 | 1ULL<<62 | 1ULL<<61 | \ 18*c929500dSQingFeng Hao 1ULL<<59 | 1ULL<<58 | 1ULL<<56 | \ 19*c929500dSQingFeng Hao 1ULL<<55 | 1ULL<<54 | 1ULL<<53 | \ 20*c929500dSQingFeng Hao 1ULL<<52 | 1ULL<<47 | 1ULL<<46 | \ 21*c929500dSQingFeng Hao 1ULL<<45 | 1ULL<<44) 2283abeffbSHendrik Brueckner #define MCCK_CODE_SYSTEM_DAMAGE _BITUL(63) 23*c929500dSQingFeng Hao #define MCCK_CODE_EXT_DAMAGE _BITUL(63 - 5) 24*c929500dSQingFeng Hao #define MCCK_CODE_CP _BITUL(63 - 9) 2583abeffbSHendrik Brueckner #define MCCK_CODE_CPU_TIMER_VALID _BITUL(63 - 46) 2683abeffbSHendrik Brueckner #define MCCK_CODE_PSW_MWP_VALID _BITUL(63 - 20) 2783abeffbSHendrik Brueckner #define MCCK_CODE_PSW_IA_VALID _BITUL(63 - 23) 2883abeffbSHendrik Brueckner 2983abeffbSHendrik Brueckner #ifndef __ASSEMBLY__ 3083abeffbSHendrik Brueckner 31dc6e1555SHeiko Carstens union mci { 32dc6e1555SHeiko Carstens unsigned long val; 33dc6e1555SHeiko Carstens struct { 34dc6e1555SHeiko Carstens u64 sd : 1; /* 00 system damage */ 35dc6e1555SHeiko Carstens u64 pd : 1; /* 01 instruction-processing damage */ 36dc6e1555SHeiko Carstens u64 sr : 1; /* 02 system recovery */ 37dc6e1555SHeiko Carstens u64 : 1; /* 03 */ 38dc6e1555SHeiko Carstens u64 cd : 1; /* 04 timing-facility damage */ 39dc6e1555SHeiko Carstens u64 ed : 1; /* 05 external damage */ 40dc6e1555SHeiko Carstens u64 : 1; /* 06 */ 41dc6e1555SHeiko Carstens u64 dg : 1; /* 07 degradation */ 42dc6e1555SHeiko Carstens u64 w : 1; /* 08 warning pending */ 43dc6e1555SHeiko Carstens u64 cp : 1; /* 09 channel-report pending */ 44dc6e1555SHeiko Carstens u64 sp : 1; /* 10 service-processor damage */ 45dc6e1555SHeiko Carstens u64 ck : 1; /* 11 channel-subsystem damage */ 46dc6e1555SHeiko Carstens u64 : 2; /* 12-13 */ 47dc6e1555SHeiko Carstens u64 b : 1; /* 14 backed up */ 48dc6e1555SHeiko Carstens u64 : 1; /* 15 */ 49dc6e1555SHeiko Carstens u64 se : 1; /* 16 storage error uncorrected */ 50dc6e1555SHeiko Carstens u64 sc : 1; /* 17 storage error corrected */ 51dc6e1555SHeiko Carstens u64 ke : 1; /* 18 storage-key error uncorrected */ 52dc6e1555SHeiko Carstens u64 ds : 1; /* 19 storage degradation */ 53dc6e1555SHeiko Carstens u64 wp : 1; /* 20 psw mwp validity */ 54dc6e1555SHeiko Carstens u64 ms : 1; /* 21 psw mask and key validity */ 55dc6e1555SHeiko Carstens u64 pm : 1; /* 22 psw program mask and cc validity */ 56dc6e1555SHeiko Carstens u64 ia : 1; /* 23 psw instruction address validity */ 57dc6e1555SHeiko Carstens u64 fa : 1; /* 24 failing storage address validity */ 58dc6e1555SHeiko Carstens u64 vr : 1; /* 25 vector register validity */ 59dc6e1555SHeiko Carstens u64 ec : 1; /* 26 external damage code validity */ 60dc6e1555SHeiko Carstens u64 fp : 1; /* 27 floating point register validity */ 61dc6e1555SHeiko Carstens u64 gr : 1; /* 28 general register validity */ 62dc6e1555SHeiko Carstens u64 cr : 1; /* 29 control register validity */ 63dc6e1555SHeiko Carstens u64 : 1; /* 30 */ 64dc6e1555SHeiko Carstens u64 st : 1; /* 31 storage logical validity */ 65dc6e1555SHeiko Carstens u64 ie : 1; /* 32 indirect storage error */ 66dc6e1555SHeiko Carstens u64 ar : 1; /* 33 access register validity */ 67dc6e1555SHeiko Carstens u64 da : 1; /* 34 delayed access exception */ 68916cda1aSMartin Schwidefsky u64 : 1; /* 35 */ 69916cda1aSMartin Schwidefsky u64 gs : 1; /* 36 guarded storage registers */ 70916cda1aSMartin Schwidefsky u64 : 5; /* 37-41 */ 71dc6e1555SHeiko Carstens u64 pr : 1; /* 42 tod programmable register validity */ 72dc6e1555SHeiko Carstens u64 fc : 1; /* 43 fp control register validity */ 73dc6e1555SHeiko Carstens u64 ap : 1; /* 44 ancillary report */ 74dc6e1555SHeiko Carstens u64 : 1; /* 45 */ 75dc6e1555SHeiko Carstens u64 ct : 1; /* 46 cpu timer validity */ 76dc6e1555SHeiko Carstens u64 cc : 1; /* 47 clock comparator validity */ 77dc6e1555SHeiko Carstens u64 : 16; /* 47-63 */ 78dc6e1555SHeiko Carstens }; 79f5daba1dSHeiko Carstens }; 80f5daba1dSHeiko Carstens 81916cda1aSMartin Schwidefsky #define MCESA_ORIGIN_MASK (~0x3ffUL) 82916cda1aSMartin Schwidefsky #define MCESA_LC_MASK (0xfUL) 83916cda1aSMartin Schwidefsky 84916cda1aSMartin Schwidefsky struct mcesa { 85916cda1aSMartin Schwidefsky u8 vector_save_area[1024]; 86916cda1aSMartin Schwidefsky u8 guarded_storage_save_area[32]; 87916cda1aSMartin Schwidefsky }; 88916cda1aSMartin Schwidefsky 89f5daba1dSHeiko Carstens struct pt_regs; 90f5daba1dSHeiko Carstens 91f5daba1dSHeiko Carstens extern void s390_handle_mcck(void); 92f5daba1dSHeiko Carstens extern void s390_do_machine_check(struct pt_regs *regs); 93f5daba1dSHeiko Carstens 9483abeffbSHendrik Brueckner #endif /* __ASSEMBLY__ */ 95f5daba1dSHeiko Carstens #endif /* _ASM_S390_NMI_H */ 96