Commit Graph

78 Commits

Author SHA1 Message Date
skrll 1b5cff8f1d Move to a flat space register convention. %sr[4-7] are all now the space
number allocated to the process.  gcc produces (slightly) better code
with this convention.

Retain backwards compatiblity.

Welcome to 6.99.36
2014-03-06 19:02:58 +00:00
skrll 4c855bdfea Provide a genassym.cf in libc for hppa and use it. 2014-02-19 13:01:51 +00:00
joerg 4d12bfcd15 Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
2013-09-12 15:36:14 +00:00
skrll b0df966c1e Whitespace. 2013-08-24 07:12:12 +00:00
manu bba80928a8 setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
  (powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
  setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
  (hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
  powerpc, sh3, sparc and sparc64 is left to portmasters
  sparc64

Approved by core@
2012-09-12 02:00:51 +00:00
skrll 5b9a421677 Shut lint up.
From he@
2012-03-23 09:34:09 +00:00
skrll d66dab05c4 Shut lint up about dp.
From he@
2012-03-22 12:31:32 +00:00
skrll 938140d192 Use the _end symbol rather than the end symbol. Prevents version info
problems in elflink.c for the heimdal libraries.
2012-03-14 14:18:10 +00:00
joerg 39079c5f77 Explicitly add back __resumecontext wrapper 2011-09-20 08:42:29 +00:00
joerg 0a2b758384 Mark _resumecontext as dead. ANSIfy all declarations for it. 2011-09-19 21:24:57 +00:00
joerg 1631a78097 Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-02-24 04:28:41 +00:00
skrll 5ddaffd107 Deal with PLABELs in _lwp_makecontext 2010-01-07 12:31:10 +00:00
snj 32381fa0dd Follow upstream license changes for files with Michael Shalayeff's
copyright.  In most cases, this means dropping the 3rd and 4th clauses.
2009-11-03 05:07:25 +00:00
skrll 43f47d3c56 G/C bcopy.m4 and references to it. 2009-10-21 19:30:46 +00:00
dsl 10ad5ffa71 Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
2009-07-31 20:39:59 +00:00
dsl 0d34d14bb9 If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
2009-07-30 20:57:15 +00:00
dsl 6dffe8d42b Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
2009-07-18 09:44:30 +00:00
martin c79c3eed1d Make NAN a compile time constant (with help from the compiler). Suggested
by krister. Fixes PR 40695.
Make references to the old construct (which we can't remove for binary
compatibility reasons) emit a linker warning.
2009-02-22 01:34:01 +00:00
skrll 14c5fc5d63 Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.

Fixes the ieeefp/except regresion test.
2009-01-25 16:44:41 +00:00
mrg 2f0d0e12bf define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build. 2008-10-26 07:43:07 +00:00
matt cac8e44915 Add C99 functions imaxabs and imaxdiv. 2008-08-04 21:29:27 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
skrll 24ced765a1 Add a comment explaining stack layout and register contents. 2007-12-22 14:10:03 +00:00
skrll fd903b1729 Implement ptrace. 2007-12-02 15:48:47 +00:00
skrll 819071140e Fix include files and change use LEAF_ENTRY_NOPROFILE function to fix
the unwind entry.
2007-12-02 14:04:19 +00:00
skrll 4f3467d61e Remove unused include.
Fix unwind info with S/ENTRY/LEAF_&/
2007-11-18 14:11:25 +00:00
skrll 8ed2bd6ec6 Generate correct unwind info for syscall stubs by using LEAF_ENTRY instead
of ENTRY(foo,0) so that gdb can backtrace through the stubs.
2007-11-18 13:25:39 +00:00
skrll f1273d89a6 Set up the tail of the instruction address queue so that
we don't have to rely on luck for swapcontext(3) to work.

This fixes a problem pointed out to me by Chuck Silvers.
2007-10-28 09:38:06 +00:00
martin e56cdf1dd0 Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-check for a NULL uc_link before calling setcontext(2); do a real exit(3)
 instead with exit handlers and all that
-If setcontext(2) returns (which it shouldn't), do an _exit(-1) rather
 than relying on a sensible return value to use as exit code. Makes
 it less likely that an ucontext corruption goes unnoticed.
2006-12-08 16:09:02 +00:00
drochner fa073991b3 build frexp/ldexp/modf in the "compat" part (code is identical)
(These are the easy cases where no assembler implementations exist.)
2006-06-28 14:46:32 +00:00
uwe 46daac62de G/c KMSRCS and KMINCLUDES now that we have common/lib/libc 2006-06-17 18:04:23 +00:00
drochner f81322cf18 build erand48_ieee754.c on everything but vax 2006-03-22 22:03:58 +00:00
kleink bc89c06cbf Add strtof(3) and strtold(3); welcome libc 12.137. 2006-03-15 17:35:17 +00:00
christos 7c5c37b133 move to the new compat layout. 2006-03-11 19:56:17 +00:00
kleink 804e6c96a2 Add machine-dependent definitions for gdtoa. 2006-01-25 15:33:28 +00:00
perry d5e310b85d oops. __volatile -> volatile 2005-12-24 21:42:32 +00:00
perry f05974f443 __asm__ -> __asm, __volatile__ -> __volatile 2005-12-24 21:41:01 +00:00
skrll 30214a4282 WARNS 2005-12-02 09:33:48 +00:00
he f9efc4ab63 Patterned after the other fixes for __longjmp14.c, include
<compat/include/setjmp.h> also here to make these build.
2005-09-14 13:46:32 +00:00
lukem 88c3eadbfa Add missing __RCSID() 2005-06-12 05:21:25 +00:00
chs 157d1a93e8 remove sigtramp version 1, we haven't used it in a long time. 2005-06-05 19:02:10 +00:00
chs bb7a930a0b fix function name in end-marker. 2005-06-05 19:01:04 +00:00
kleink b2cb7fcd8a Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.

IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
2005-04-15 22:39:10 +00:00
tsutsui 1b4b48e1ea Add (missed) fabs.c to SRCS. 2005-02-19 18:18:53 +00:00
chs 95a63d48f2 add missing FP functions, from openbsd. 2004-07-24 19:09:29 +00:00
chs c27bdd3547 added new files for context, LWP and siginfo support. 2004-07-18 22:41:23 +00:00
chs 1e1499c776 split __longjmp14() into a separate file and make it use setcontext()
instead of __sigreturn14().  translated from MIPS.
2004-07-18 22:38:33 +00:00
chs 61b506f0a2 add a siginfo signal trampoline and always use it. 2004-07-18 22:38:07 +00:00
chs 56371a56c7 add *context and LWP support for hppa. translated from MIPS. 2004-07-18 22:37:32 +00:00
chs 32c9e25b89 call abort() if longjmperror() returns. 2004-07-18 20:51:24 +00:00