Skip to content

Commit 52b739e

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/traps: get rid of magic cast for program interruption code
Add a proper union in lowcore to reflect architecture and get rid of a "magic" cast in order to read the full program interruption code. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 0ecf337 commit 52b739e

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

arch/s390/include/asm/lowcore.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ struct lowcore {
3434
__u32 ext_int_code_addr;
3535
};
3636
__u32 svc_int_code; /* 0x0088 */
37-
__u16 pgm_ilc; /* 0x008c */
38-
__u16 pgm_code; /* 0x008e */
37+
union {
38+
struct {
39+
__u16 pgm_ilc; /* 0x008c */
40+
__u16 pgm_code; /* 0x008e */
41+
};
42+
__u32 pgm_int_code;
43+
};
3944
__u32 data_exc_code; /* 0x0090 */
4045
__u16 mon_class_num; /* 0x0094 */
4146
__u8 per_code; /* 0x0096 */

arch/s390/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
297297
unsigned int trapnr;
298298
irqentry_state_t state;
299299

300-
regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc;
300+
regs->int_code = S390_lowcore.pgm_int_code;
301301
regs->int_parm_long = S390_lowcore.trans_exc_code;
302302

303303
state = irqentry_enter(regs);

0 commit comments

Comments
 (0)