summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix almost ten-years old bug in siglongjmp(), which would not restore a signalmiod2012-08-123-87/+57
| | | | | | | | | | | | | mask of zero (because of flawed logic assuming finding zero in the sigjmp_buf signal mask means sigsetjmp was invoked with a zero `savemask' argument). While there, clean comments of all *{set,long}jmp routines, and shave a few instructions by using bcnd insead of cmp + bb to test for zero values. Passes the regress tests, and now devel/libsigsegv configure siglongjmp test will not spin (this test is however flawed as it expects a signal handler declared as running on the sigaltstack and `returning' through siglongjmp to be invoked on the signal stack the next time the signal is raised).
* adapt the NetBSD code to make sigpending work on shjsg2012-07-031-2/+6
| | | | ok miod@ kettenis@
* The kernel returns the pending set; this stub has to save it throughguenther2012-07-011-4/+8
| | | | | | the pointer ok miod@ kettenis@
* make this actually workkettenis2012-07-011-23/+21
| | | | ok miod@
* Do not use <machine/float.h>, that is an deformed BSD-ism.deraadt2012-06-259-18/+18
| | | | | 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-2114-125/+72
| | | | | | | | | 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-1911-219/+14
| | | | | or compiler we use will. ok millert
* alloca.c cannot be usedderaadt2012-04-1213-34/+12
|
* remove rfork(); ok guenther miodderaadt2012-04-1215-556/+0
|
* Mark outermost frame such that backtraces in thread terminate atkettenis2012-04-111-2/+3
| | | | | | __tfork_thread(). ok guenther@
* Provide __tfork_thread() for hppa64. This makes libc compile again.jsing2012-04-111-0/+57
| | | | ok miod@
* Move __tfork_thread() from rthreads (libpthread) to libc so thatguenther2012-03-2213-0/+921
| | | | | | it can be used for not-strictly-threading purposes ok matthew@ kurt@
* Remove assembly version of strlen from i386 and amd64, where it'smikeb2012-01-174-44/+6
| | | | | | | up to 3 times slower than the C code most of the time. This was brought up by DragonflyBSD guys initially. ok deraadt, guenther. miod will not miss it.
* Reimplement mutexes, condvars, and rwlocks to eliminate bugs,guenther2012-01-172-5/+5
| | | | | | | | | | | | | particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
* sigstack() is long dead, and the compat sigaltstack syscall is gone too.guenther2011-11-225-10/+10
| | | | | | Correct the namespace protections for sigreturn(), sigwait(), and psignal() ok millert@
* Change to syscall is done, so delete an XXX commentguenther2011-10-111-5/+1
|
* Make this actually work.kettenis2011-09-191-4/+4
| | | | ok jsing@
* Use a long-displacement branch instruction to call __cerror, since thekettenis2011-09-191-2/+3
| | | | linker doesn't generate stubs yet.
* Clear the upper 32-bits of the system call address we load using ldil, sincekettenis2011-09-191-2/+4
| | | | | that instruction does sign extension. Look at %r1 to determine whether a system call was sucessful, since that is where the kernel puts the information.
* arithemtic -> arithmeticmiod2011-09-171-2/+2
|
* Switch sigreturn() to the normal syscall entry instead of int$80.guenther2011-09-052-26/+3
| | | | | | This was done for the sigreturn call in sigcode before 5.0. ok deraadt@ for post-5.0
* Bring libc and libm in line with the compiler now that we no longer have akettenis2011-08-198-191/+6
| | | | 128-bit long double. Diff committed on behalf of martynas@
* 64-bitification went a bit too far here; sigset_t is 32-bit so using 64-bitkettenis2011-08-163-11/+11
| | | | | | loads and stores may trigger an alignment trap. Also fix issues where the code was assuming arguments were passed both in registers on the stack. This isn't ithe case for hppa64.
* Revert (leaving the complex math part alone). Some stuff is dependingmartynas2011-07-0836-32/+1307
| | | | | on this historical behavior; so we're stuck in this stupid situation. No cookie for me.
* Kill weak `cerror' alias, it's colliding with the userland namespace. Noticedmiod2011-07-081-2/+1
| | | | by guenther@ months ago, had to wait for a libc major bump.
* Move fabs(3), frexp(3), and modf(3) to libm--nothing has been usingmartynas2011-07-0836-1307/+32
| | | | them in libc for a very long time. OK guenther@.
* Move arm to the 'MI' softfloat code instead of the arm version.drahn2011-07-0529-7171/+2
| | | | YES!! miod@
* Add stubs for signals and forks.pirofti2011-07-0521-120/+26
| | | | While at it clean-up a bit by removing unused files and adding cvs tags.
* Add ia64 libc support.pirofti2011-07-0429-0/+645
|
* Trick lint into recording the right prototypes in the llib-lc.lnmartynas2011-07-027-29/+56
| | | | database on the vax, similarly like has been done in gen.
* - The 0x1p514 was wrong on VAX, but remove FP_SUBNORMAL, FP_INFINITE,martynas2011-06-082-20/+6
| | | | | | | | and FP_NAN cases altogether, since they are not supported, and fpclassify() will never return that. (Leftovers when this was cloned.) - Kill unused INFSTR, NANSTR, LDBL_ADJ. - Teach hdtoa() that rv_alloc can fail. - Move STRTOG_NoMemory above STRTOG_Infinite (fallthru).
* On PowerPC we cannot manipulate FPSCR[VX]--it's a summary of allmartynas2011-05-251-2/+6
| | | | | | | | the invalid exception bits, as described in Section 3.3.6.1.1 of PowerPC Architecture Programming Environments Manual. A proper way to cause an invalid operation exception is to set FPSCR[VXSOFT]. Similarly, we clear all the FPSCR[VX*] bits otherwise.
* Merge the same fix for hppa64; reminded by miod@:martynas2011-04-231-2/+2
| | | | | Sticky flags are in the left half of fpsr;  not the undefined bits in the right half.  OK miod@.
* Sticky flags are in the left half of fpsr; not the undefined bitsmartynas2011-04-221-2/+2
| | | | in the right half. OK miod@.
* Make this code actually compile on hppa64.jsing2011-04-219-79/+79
| | | | ok kettenis@
* Rework setjmp so that it works for hppa64.jsing2011-04-211-67/+67
| | | | ok kettenis@
* Provide reasonable gdtoa headers.jsing2011-04-212-2/+15
| | | | ok kettenis@
* Make SYS.h actually compile on hppa64.jsing2011-04-211-14/+14
| | | | ok kettenis@
* Remove wrong check.ariane2011-04-151-10/+1
| | | | | | | | | | | | | HPPA longjmp tests that the env parameter < the current stack pointer. The test relies on the stack being at the end of the memory space. This test is wrong for a couple of reasons: - the main stack is at 0x78000000-0x80000000, but allocations between 0x80000000-0xc0000000 are available to the program, - pthread stacks may be at any place in the address space, allowing a heap-allocated env parameter to fail the check. ok deraadt@, kettenis@, guenther@ at least
* On the a.out architectures, WEAK_ALIAS does an implicit _C_LABEL()deraadt2011-04-093-6/+6
| | | | ok miod
* Fix the previous commit: define ___cerror, no __cerrorguenther2011-04-051-4/+4
| | | | tested by otto@; ok miod@
* Move __cerror to ___cerror with a weak alias so that rthreads can override it.guenther2011-04-0429-73/+103
| | | | | | On mips64, also correct the name called from plain cerror to __cerror. "looks correct" miod@
* In the original sparc V7 book (and in the v8 book), the divrem leaf code usedderaadt2011-03-122-4/+4
| | | | | | | | | | | | | | | | | | | | | | | local registers for a few temporaries. This was changed to use two global registers. Maybe to permit use in-kernel without conflicting with the register V7 register window handlers. (Was this done by Chris Torek? Is this related to Gordon Irlam's work? Or was it in NetBSD? Hard to tell because NetBSD removed their original cvs tree.) In V8 the ABI was tightened; more global registers became offlimits in different ways. We started supporting sun4m, and did not consider this. As a result, the global registers chosen are the wrong choice. In particular, %g7 is a poor choice for upcoming TLS work. It looks like it is safer to use %g5 and %g6 since these functions are "system software". All re-entrant parts of the system save it. On sparc64 these functions are in libc per ABI requirement, but are unused. On sparc, they occur in bootblocks (no reentrancy), kernel (reentrancy saves globals; kernel is not ABI compliant), userland libc (signal handlers save globals), and ld.so (symbol binding is not re-entrant on its own). Discussed rather extensively with guenther, kettenis, miod and drahn.
* Provide a WEAK_ALIAS macro in <machine/asm.h> for the few platformsguenther2010-10-015-14/+12
| | | | | | | that didn't already have one, and then immediately use it in libc's SYS.h ok miod@
* Provide IRIX-compatible get_fpc_csr() and set_fpc_csr() for mips, althoughmiod2010-09-242-2/+46
| | | | | | | | we don't provide the silly union to decompose the value. This will allow userland to flip the ``flush denormalized to zero'' setting, which apparently is being relied upon by tcl. Asked by jasper@ a long time ago. Riding upon the upcoming libc major crank.
* Give little-endian fp on mips a change to be handled correctly.miod2010-01-231-0/+4
|
* More changes to avoid truncating 64 bit pointers to 32 bits and sign-extendingmiod2009-12-118-69/+69
| | | | them; allows userland with stack beyond 2GB to run.
* Use a local numeric label to branch to the start of the function, instead ofmiod2009-11-011-2/+3
| | | | referencing it by name; silences a linker warning; no functional change.
* more rcsid/sccs cleanupderaadt2009-10-2842-223/+18
|
* teach gdtoa & its subroutines that malloc can fail; in which casemartynas2009-10-161-0/+4
| | | | | | ecvt, fcvt, gcvt, *printf, strtof, strtod, strtold act per ieee 1003.1. after these massive changes, remove unused files which would not work now. reported by Maksymilian Arciemowicz; ok theo