powerpc: Fix handling of scv return error codes [BZ #27892]

When using scv for templated ASM syscalls, current code interprets any
negative return value as error, but the only valid error codes are in
the range -4095..-1 according to the ABI.

This commit also fixes 'signal.gen.test' strace test, where the issue
was first identified.

Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
This commit is contained in:
Nicholas Piggin 2021-05-20 11:00:36 -03:00 committed by Matheus Castanho
parent 79aec84102
commit 7de36744ee

View File

@ -398,8 +398,9 @@ LT_LABELSUFFIX(name,_name_end): ; \
#endif
#define RET_SCV \
cmpdi r3,0; \
bgelr+; \
li r9,-4095; \
cmpld r3,r9; \
bltlr+; \
neg r3,r3;
#define RET_SC \