summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/powerpc/sys/tfork_thread.S (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add retguard to macppc kernel locore.S, ofwreal.S, setjmp.Sgkoehler2020-11-281-3/+3
| | | | | | | | | This changes RETGUARD_SETUP(ffs) to RETGUARD_SETUP(ffs, %r11, %r12) and RETGUARD_CHECK(ffs) to RETGUARD_CHECK(ffs, %r11, %r12) to show that r11 and r12 are in use between setup and check, and to pick registers other than r11 and r12 in some kernel functions. ok mortimer@ deraadt@
* Retguard asm macros for powerpc libc, ld.sogkoehler2020-10-261-2/+5
| | | | | | | | | | Add retguard to some, but not all, asm functions in libc. Edit SYS.h in libc to remove the PREFIX macros and add SYSENTRY (more like aarch64 and powerpc64), so we can insert RETGUARD_SETUP after SYSENTRY. Some .S files in this commit don't get retguard, but do stop using the old prefix macros. Tested by deraadt@, who put this diff in a macppc snap.
* SYS___threxit cannot fail, but this integration looks like a gadget.deraadt2020-10-181-1/+3
| | | | | Put a hard-trap instruction after the syscall instruction. ok kettenis mortimer
* TIB conversion is complete, so set errno in the syscall stub and eliminateguenther2016-05-151-10/+5
| | | | | | __cerror ok ketternis@
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-071-2/+2
| | | | | | | | | | | | | | | | | This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
* Adds hidden _libc_FOO aliases for the system call stubs.guenther2015-09-051-1/+2
| | | | | | | | Stop generating _brk and _sbrk symbols: they've already been hidden. Set the ELF symbol size on the syscall stubs. Give the __{min,cur}brk symbols a size and type, and hide more jump labels. ok deraadt@
* fix commentguenther2015-08-271-2/+2
|
* Make __cerror() use the per-thread errno location if r2 isn't zero. This waykettenis2015-08-231-2/+2
| | | | | | | | | | | | libpthread no longer has to override it which means that we can use a local call and can avoid setting up r30 as a _GLOBAL_OFFSET_TABLE_ pointer, which is hard the way the powerpc ABI works. For now we continue to provide __cerror as a weak symbol, but ___cerror is now protected and internal calls within libc now use ___cerror instead of __cerror. discussed with guenther@
* __tfork() needs to set the stack address of the new thread in the kernel,guenther2012-06-211-6/+2
| | | | | | | | | so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
* Move __tfork_thread() from rthreads (libpthread) to libc so thatguenther2012-03-221-0/+53
it can be used for not-strictly-threading purposes ok matthew@ kurt@