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

ARM: 5866/1: arm ptrace: use unsigned types for kernel pt_regs

Make registers unsigned for kernel space. This is important for
example in the perf events where the PC is stored into a u64. We
don't want it sign extended so make the regs unsigned to prevent
casts throughout the kernel.

Signed-off-by: Jamie Iles <jamie.iles@picochip.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Jamie Iles and committed by
Russell King
092a4e95 8784895e

+6
+6
arch/arm/include/asm/ptrace.h
··· 97 97 * stack during a system call. Note that sizeof(struct pt_regs) 98 98 * has to be a multiple of 8. 99 99 */ 100 + #ifndef __KERNEL__ 100 101 struct pt_regs { 101 102 long uregs[18]; 102 103 }; 104 + #else /* __KERNEL__ */ 105 + struct pt_regs { 106 + unsigned long uregs[18]; 107 + }; 108 + #endif /* __KERNEL__ */ 103 109 104 110 #define ARM_cpsr uregs[16] 105 111 #define ARM_pc uregs[15]