Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390: add struct tpi_info to struct pt_regs

To avoid casting ptrace members, add a union containing
both struct tpi_info and explicit int_code/int_parm members.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Sven Schnelle and committed by
Vasily Gorbik
34bbeed0 c63c473f

+18 -5
+9 -3
arch/s390/include/asm/ptrace.h
··· 9 9 10 10 #include <linux/bits.h> 11 11 #include <uapi/asm/ptrace.h> 12 + #include <asm/tpi.h> 12 13 13 14 #define PIF_SYSCALL 0 /* inside a system call */ 14 15 #define PIF_SYSCALL_RESTART 1 /* restart the current system call */ ··· 87 86 }; 88 87 }; 89 88 unsigned long orig_gpr2; 90 - unsigned int int_code; 91 - unsigned int int_parm; 92 - unsigned long int_parm_long; 89 + union { 90 + struct { 91 + unsigned int int_code; 92 + unsigned int int_parm; 93 + unsigned long int_parm_long; 94 + }; 95 + struct tpi_info tpi_info; 96 + }; 93 97 unsigned long flags; 94 98 unsigned long cr1; 95 99 };
+4
arch/s390/include/asm/tpi.h
··· 5 5 #include <linux/types.h> 6 6 #include <uapi/asm/schid.h> 7 7 8 + #ifndef __ASSEMBLY__ 9 + 8 10 /* I/O-Interruption Code as stored by TEST PENDING INTERRUPTION (TPI). */ 9 11 struct tpi_info { 10 12 struct subchannel_id schid; ··· 18 16 u32 type:3; 19 17 u32 :12; 20 18 } __packed __aligned(4); 19 + 20 + #endif /* __ASSEMBLY__ */ 21 21 22 22 #endif /* _ASM_S390_TPI_H */
+3
arch/s390/include/uapi/asm/schid.h
··· 4 4 5 5 #include <linux/types.h> 6 6 7 + #ifndef __ASSEMBLY__ 8 + 7 9 struct subchannel_id { 8 10 __u32 cssid : 8; 9 11 __u32 : 4; ··· 15 13 __u32 sch_no : 16; 16 14 } __attribute__ ((packed, aligned(4))); 17 15 16 + #endif /* __ASSEMBLY__ */ 18 17 19 18 #endif /* _UAPIASM_SCHID_H */
+1 -1
drivers/s390/cio/airq.c
··· 93 93 struct hlist_head *head; 94 94 95 95 set_cpu_flag(CIF_NOHZ_DELAY); 96 - tpi_info = (struct tpi_info *) &get_irq_regs()->int_code; 96 + tpi_info = &get_irq_regs()->tpi_info; 97 97 trace_s390_cio_adapter_int(tpi_info); 98 98 head = &airq_lists[tpi_info->isc]; 99 99 rcu_read_lock();
+1 -1
drivers/s390/cio/cio.c
··· 536 536 struct irb *irb; 537 537 538 538 set_cpu_flag(CIF_NOHZ_DELAY); 539 - tpi_info = (struct tpi_info *) &get_irq_regs()->int_code; 539 + tpi_info = &get_irq_regs()->tpi_info; 540 540 trace_s390_cio_interrupt(tpi_info); 541 541 irb = this_cpu_ptr(&cio_irb); 542 542 sch = (struct subchannel *)(unsigned long) tpi_info->intparm;