summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/sparc64 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* SYS___threxit cannot fail, but this integration looks like a gadget.deraadt2020-10-181-1/+2
| | | | | Put a hard-trap instruction after the syscall instruction. ok kettenis mortimer
* Userland timecounter implementation for sparc64.kettenis2020-07-082-4/+41
| | | | ok deraadt@, pirofti@
* Add support for timeconting in userland.pirofti2020-07-062-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
* Mark the _Qp_{mul,div,add,sub} functions as 'protected' to eliminateguenther2019-10-271-2/+3
| | | | | | PLT entries and prevent overriding ok kettenis@ deraadt@
* Fix conversions to long double on sparc64jca2019-06-212-12/+12
| | | | | | | | | | | | | | | | | | | | | | | Bug exposed by erratic sqlite3 behavior used in ports/devel/proj, as pointed out by landry@. Richard Hipps (SQLite) pointed at the culprit (_Qp_div), many thanks. Adapted from FreeBSD revision 146673 by Stephen Paskaluk and stefanf@FreeBSD. FreeBSD commit message: """ Fix long (and long long) to long double, unsigned to long double and unsigned long (and unsigned long long) to long double conversions. - Add a parameter that specifies the position of the sign bit to the _QP_TTOQ macro, previously it always looked at bit 31. Pass a negative number to disable sign inspection for unsigned types. This fixes _Qp_xtoq(), _Qp_uitoq() and _Qp_uxtoq(). - In the functions __fpu_itof() and __fpu_xtof(), look at the sign bit to decide whether we're doing a conversion from an unsigned type. If so, don't negate the mantissa if the integer exceeds the biggest signed number. """ ok deraadt@
* Remove FBSDID.kevlo2019-03-159-45/+9
| | | | ok deraadt@
* Wow, it cannot even be in .data...deraadt2018-01-181-2/+1
|
* Sorry, the PIC macros cannot reach to .rodata....deraadt2018-01-181-2/+2
|
* Instead of trying to handle ffs() with the normal rename-mark-hidden-and-aliasguenther2018-01-181-2/+4
| | | | | | | dance, mark it protected. This works better for both gcc and clang: gcc blocks overriding of internal calls, while clang permits inlining again. ok otto@
* Remove __builtin_saveregs: gcc hasn't used it for years.guenther2017-10-283-63/+2
| | | | | suggested by miod@ ok kettenis@
* Copy files from ../librthread in preparation for moving functionalityguenther2017-08-151-0/+41
| | | | | | | from libpthread to libc. No changes to the build yet, just making it easier to review the substantive diffs. ok beck@ kettenis@ tedu@
* RELRO means the __{got,plt}_{start,end} symbols are superfluousguenther2017-02-271-2/+0
| | | | ok kettenis@
* Wrap fpgetround() so internal calls to it (seen on arm, powerpc, and sh)guenther2016-07-261-2/+3
| | | | | | go direct instead of through the PLT. ok millert@ kettenis@
* Remove sigreturn declaration and the now-unused libc syscall stubguenther2016-05-091-43/+0
|
* Hide __fpu_* and make internal _Qp_* calls go direct.guenther2016-05-086-39/+53
| | | | ok kettenis@
* Simplify sig{set,long}jmp(): just Do The Job instead of calling othersguenther2016-05-081-52/+50
| | | | ok kettenis@
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-075-122/+14
| | | | | | | | | | | | | | | | | 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@
* Don't use sigreturn(2) in longjmp(3). Instead use a similar approach as inkettenis2016-04-281-59/+22
| | | | | | _longjmp(3) but also restore the signal mask. ok deraadt@
* The asm in the MD_DISABLE_KBIND macro was too fragile and broke alpha and hppa.guenther2016-03-211-27/+0
| | | | | | So instead, do the kbind disabling with syscall(). debugging and ok deraadt@, ok kettenis@
* Rearrange C runtime bits: now that ld.so exports environ and __progname,guenther2016-03-201-0/+27
| | | | | | | | | | | move their definitions and initialization in static links to libc.a Make crt0 always invoke a new func _csu_finish() in libc to process the auxv and to either register the ld.so cleanup function (in dynamic links) or initialize environ and __progname and do MC_DISABLE_KBIND (in static links). In libc, get pagesize from auxv; cache that between getpagesize() and sysconf(_SC_PAGESIZE) ok mpi@ "good time" deraadt@
* Tweak previous: rename it to fpround() to match FreeBSDguenther2015-11-151-11/+11
| | | | requested by kettenis@
* I got a round tuit to rename round() to roundit() to avoid gcc warning.guenther2015-11-151-14/+14
| | | | ok deraadt@
* Wrap the remaining math functions in libc: __fpclassify*(), __flt_rounds(),guenther2015-10-272-2/+4
| | | | | | and ldexp(). ok millert@
* Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadguenther2015-10-232-7/+7
| | | | | | | | | into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
* Need SYS.h for END_STRONG()guenther2015-09-131-2/+2
|
* Add hidden _libc_ aliases and symbol sizesguenther2015-09-131-1/+2
|
* Wrap <stdlib.h> so that calls go direct and the symbols not in theguenther2015-09-132-3/+2
| | | | | | C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
* Adds hidden _libc_FOO aliases for the system call stubs.guenther2015-09-059-18/+36
| | | | | | | | 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@
* Add framework for resolving (pun intended) libc namespace issues, usingguenther2015-08-313-5/+31
| | | | | | | | | | | | wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
* Hide many (194!) symbols that nothing should be using.guenther2015-08-264-66/+20
| | | | | | | Delete exect(2); it wasn't portable across archs and nothing used it. ports test build by naddy@ ok deraadt@ kettenis@
* Explicitly list the symbols permitted to be exported by libc.guenther2015-08-221-0/+89
| | | | | | | | This is primed with the current list of exported symbols so it doesn't change the ABI yet, but will prevent unintentional additions in the future and sets the stage for reductions. ok deraadt@ kettenis@
* Make index/rindex weak aliases of strchr/strrchr since they are notmillert2015-05-151-3/+3
| | | | | part of the ISO C standard and have also been dropped from POSIX. OK guenther@ kettenis@
* Make pthread_atfork() track the DSO that called it like atexit() does,guenther2015-04-072-6/+17
| | | | | | | | | | unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
* Simplify fork/vfork logic: the kernel has handled returning zero in the childguenther2015-03-312-17/+4
| | | | | | | for a long time, so there's no need to test the second return register here in the asm stub. ok and testing of many archs by krw@ miod@
* restructure libc/string + libc/arch/*/string coperation regardingderaadt2014-11-301-5/+9
| | | | | | | | | | | | | | | | (potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
* Fix some bugs in the _Qp_sqrt implementation that would limit the accuracykettenis2014-09-121-4/+4
| | | | | | of the result in many cases. From FreeBSD allbeit with some changes to keep the coding style consistent. This fixes the asinhl(4) issue reported by dickman@ on tech@.
* Nuke the machinery to sync libkern with libc, it's not been used in themiod2014-06-091-6/+1
| | | | | | last 15 years and there is no point to use it in the future. From Jean-Philippe Ouellet
* Apply "unifdef -D__STDC__" to libc/arch/*/SYS.hmatthew2014-06-041-5/+1
| | | | | | | | A while back, pascal@ converted our system call stubs from using "cpp | as" to "cc -x assembler-with-cpp", so there's no need to stay compatible with ancient preprocessor semantics. ok miod
* It's been a quarter century: we can assume volatile is present with that name.guenther2014-04-172-17/+17
|
* 1 << 31 cleanup. Eitan Adler pointed out that there has been aderaadt2013-11-262-8/+8
| | | | | resurrection of the bad idiom in the tree. sufficient review by miod, kettenis, tedu
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-059-18/+9
| | | | ok guenther millert kettenis
* Add two missing quad-precision emulation functions: _Qp_cmp and _Qp_cmpe. Atkettenis2012-12-031-9/+12
| | | | least the former is emitted by modern versions of GCC.
* remove lint leftovers; ok guenther@okan2012-09-041-3/+1
|
* these are no longer used; ok guentherderaadt2012-09-041-59/+0
|
* Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccpascal2012-08-229-20/+20
| | | | | | | invocations. This allows us to use the compiler builtin define __PIC__ to check for PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot. ok matthew@, conceptually ok kurt@
* Do not use <machine/float.h>, that is an deformed BSD-ism.deraadt2012-06-251-2/+2
| | | | | It turns out <float.h> is the right file to pull in. ok millert
* __tfork() needs to set the stack address of the new thread in the kernel,guenther2012-06-211-8/+3
| | | | | | | | | 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@
* rely on the compiler giving us a built-in alloca. any new architecturederaadt2012-04-191-6/+6
| | | | | or compiler we use will. ok millert
* alloca.c cannot be usedderaadt2012-04-121-3/+1
|
* remove rfork(); ok guenther miodderaadt2012-04-121-43/+0
|