summaryrefslogtreecommitdiff
path: root/lib/libc/arch
AgeCommit message (Collapse)Author
2012-08-12Fix almost ten-years old bug in siglongjmp(), which would not restore a signalMiod Vallat
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).
2012-07-03adapt the NetBSD code to make sigpending work on shJonathan Gray
ok miod@ kettenis@
2012-07-01The kernel returns the pending set; this stub has to save it throughPhilip Guenthe
the pointer ok miod@ kettenis@
2012-07-01make this actually workMark Kettenis
ok miod@
2012-06-25Do not use <machine/float.h>, that is an deformed BSD-ism.Theo de Raadt
It turns out <float.h> is the right file to pull in. ok millert
2012-06-21__tfork() needs to set the stack address of the new thread in the kernel,Philip Guenthe
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@
2012-04-19rely on the compiler giving us a built-in alloca. any new architectureTheo de Raadt
or compiler we use will. ok millert
2012-04-12alloca.c cannot be usedTheo de Raadt
2012-04-12remove rfork(); ok guenther miodTheo de Raadt
2012-04-11Mark outermost frame such that backtraces in thread terminate atMark Kettenis
__tfork_thread(). ok guenther@
2012-04-11Provide __tfork_thread() for hppa64. This makes libc compile again.Joel Sing
ok miod@
2012-03-22Move __tfork_thread() from rthreads (libpthread) to libc so thatPhilip Guenthe
it can be used for not-strictly-threading purposes ok matthew@ kurt@
2012-01-17Remove assembly version of strlen from i386 and amd64, where it'sMike Belopuhov
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.
2012-01-17Reimplement mutexes, condvars, and rwlocks to eliminate bugs,Philip Guenthe
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.
2011-11-22sigstack() is long dead, and the compat sigaltstack syscall is gone too.Philip Guenthe
Correct the namespace protections for sigreturn(), sigwait(), and psignal() ok millert@
2011-10-11Change to syscall is done, so delete an XXX commentPhilip Guenthe
2011-09-19Make this actually work.Mark Kettenis
ok jsing@
2011-09-19Use a long-displacement branch instruction to call __cerror, since theMark Kettenis
linker doesn't generate stubs yet.
2011-09-19Clear the upper 32-bits of the system call address we load using ldil, sinceMark Kettenis
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.
2011-09-17arithemtic -> arithmeticMiod Vallat
2011-09-05Switch sigreturn() to the normal syscall entry instead of int$80.Philip Guenthe
This was done for the sigreturn call in sigcode before 5.0. ok deraadt@ for post-5.0
2011-08-19Bring libc and libm in line with the compiler now that we no longer have aMark Kettenis
128-bit long double. Diff committed on behalf of martynas@
2011-08-1664-bitification went a bit too far here; sigset_t is 32-bit so using 64-bitMark Kettenis
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.
2011-07-08Revert (leaving the complex math part alone). Some stuff is dependingMartynas Venckus
on this historical behavior; so we're stuck in this stupid situation. No cookie for me.
2011-07-08Kill weak `cerror' alias, it's colliding with the userland namespace. NoticedMiod Vallat
by guenther@ months ago, had to wait for a libc major bump.
2011-07-08Move fabs(3), frexp(3), and modf(3) to libm--nothing has been usingMartynas Venckus
them in libc for a very long time. OK guenther@.
2011-07-05Move arm to the 'MI' softfloat code instead of the arm version.Dale Rahn
YES!! miod@
2011-07-05Add stubs for signals and forks.Paul Irofti
While at it clean-up a bit by removing unused files and adding cvs tags.
2011-07-04Add ia64 libc support.Paul Irofti
2011-07-02Trick lint into recording the right prototypes in the llib-lc.lnMartynas Venckus
database on the vax, similarly like has been done in gen.
2011-06-08- The 0x1p514 was wrong on VAX, but remove FP_SUBNORMAL, FP_INFINITE,Martynas Venckus
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).
2011-05-25On PowerPC we cannot manipulate FPSCR[VX]--it's a summary of allMartynas Venckus
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.
2011-04-23Merge the same fix for hppa64; reminded by miod@:Martynas Venckus
Sticky flags are in the left half of fpsr;  not the undefined bits in the right half.  OK miod@.
2011-04-22Sticky flags are in the left half of fpsr; not the undefined bitsMartynas Venckus
in the right half. OK miod@.
2011-04-21Make this code actually compile on hppa64.Joel Sing
ok kettenis@
2011-04-21Rework setjmp so that it works for hppa64.Joel Sing
ok kettenis@
2011-04-21Provide reasonable gdtoa headers.Joel Sing
ok kettenis@
2011-04-21Make SYS.h actually compile on hppa64.Joel Sing
ok kettenis@
2011-04-15Remove wrong check.Ariane van der Steldt
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
2011-04-09On the a.out architectures, WEAK_ALIAS does an implicit _C_LABEL()Theo de Raadt
ok miod
2011-04-05Fix the previous commit: define ___cerror, no __cerrorPhilip Guenthe
tested by otto@; ok miod@
2011-04-04Move __cerror to ___cerror with a weak alias so that rthreads can override it.Philip Guenthe
On mips64, also correct the name called from plain cerror to __cerror. "looks correct" miod@
2011-03-12In the original sparc V7 book (and in the v8 book), the divrem leaf code usedTheo de Raadt
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.
2010-10-01Provide a WEAK_ALIAS macro in <machine/asm.h> for the few platformsPhilip Guenthe
that didn't already have one, and then immediately use it in libc's SYS.h ok miod@
2010-09-24Provide IRIX-compatible get_fpc_csr() and set_fpc_csr() for mips, althoughMiod Vallat
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.
2010-01-23Give little-endian fp on mips a change to be handled correctly.Miod Vallat
2009-12-11More changes to avoid truncating 64 bit pointers to 32 bits and sign-extendingMiod Vallat
them; allows userland with stack beyond 2GB to run.
2009-11-01Use a local numeric label to branch to the start of the function, instead ofMiod Vallat
referencing it by name; silences a linker warning; no functional change.
2009-10-28more rcsid/sccs cleanupTheo de Raadt
2009-10-16teach gdtoa & its subroutines that malloc can fail; in which caseMartynas Venckus
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