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

Configure Feed

Select the types of activity you want to include in your feed.

s390/processor: Add __forward_psw() helper

Similar to __rewind_psw() add the counter part __forward_psw(). This
helps to make code more readable if a PSW address has to be forwarded,
since it is more natural to write

addr = __forward_psw(psw, ilen);

instead of

addr = __rewind_psw(psw, -ilen);

This renames also the ilc parameter of __rewind_psw() to ilen, since
the parameter reflects an instruction length, and not an instruction
length code. Also change the type of ilen from unsigned long to long
so it reflects that lengths can be negative or positive.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

+7 -2
+7 -2
arch/s390/include/asm/processor.h
··· 379 379 /* 380 380 * Rewind PSW instruction address by specified number of bytes. 381 381 */ 382 - static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc) 382 + static inline unsigned long __rewind_psw(psw_t psw, long ilen) 383 383 { 384 384 unsigned long mask; 385 385 386 386 mask = (psw.mask & PSW_MASK_EA) ? -1UL : 387 387 (psw.mask & PSW_MASK_BA) ? (1UL << 31) - 1 : 388 388 (1UL << 24) - 1; 389 - return (psw.addr - ilc) & mask; 389 + return (psw.addr - ilen) & mask; 390 + } 391 + 392 + static inline unsigned long __forward_psw(psw_t psw, long ilen) 393 + { 394 + return __rewind_psw(psw, -ilen); 390 395 } 391 396 392 397 /*