powerpc: Reserve correct scratch region size below stack

According to the ELF ABI v2, two scratch regions are reserved below the stack
pointer, one 288 byte general region and one 224 byte compiler region.

FreeBSD only reserved the 288 byte region.  Follow the ELV v2 ABI and reserve
the full 512 byte region as specified.

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1756
This commit is contained in:
Timothy Pearson
2025-07-06 14:24:07 -05:00
committed by Justin Hibbits
parent 2cfd6342ac
commit 645bb3efc3
+3 -3
View File
@@ -214,10 +214,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
sfpsize = sizeof(sf);
#ifdef __powerpc64__
/*
* 64-bit PPC defines a 288 byte scratch region
* below the stack.
* 64-bit PPC defines a 512 byte red zone below
* the existing stack (ELF ABI v2 §2.2.2.4)
*/
rndfsize = 288 + roundup(sizeof(sf), 48);
rndfsize = 512 + roundup(sizeof(sf), 48);
#else
rndfsize = roundup(sizeof(sf), 16);
#endif