Commit Graph

1667 Commits

Author SHA1 Message Date
he 46fd488dd6 Cast to unsigned int before doing shift operations, to appease lint. 2012-03-20 10:51:23 +00:00
he a1a4d3d82c Sprinkle some /* ARGSUSED */ before the dummy functions to appease lint. 2012-03-20 10:40:48 +00:00
matt 5d44f1d51d Convert to C89 definitions.
Cleanup up type usage.
2012-03-19 22:23:10 +00:00
christos 1af1a7c82f fix lint 2012-03-18 16:26:34 +00:00
martin 0abf123a71 delint 2012-03-17 21:35:06 +00:00
martin e9be25776b Avoid lint warnings 2012-03-17 20:48:58 +00:00
martin 90310d68b0 Rename __zero to __sf128_zero to avoid clashes with the strange new
inline function in cdefs.h
2012-03-14 17:03:10 +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
matt fc3d31db9e PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
2012-02-27 15:47:11 +00:00
tsutsui 501876fe73 Fix pasto. 2012-02-27 14:48:34 +00:00
joerg f46fb1259f Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
2012-02-27 12:26:21 +00:00
matt 62335767ce Add workaround for ARM cores that don't properly implement the MRC instruction
used for reading the thread pointer.  This is the corresponding change which
was made to <arm/mcontext.h>
2012-02-14 17:32:43 +00:00
drochner 2b9ee4cb40 let one bit more through to SSE, to make FP_X_IMP work 2012-01-19 16:37:18 +00:00
chs d331b836f8 define _UC_TLSBASE and use it to pass the TLS pointer to setcontext().
since there is no available space in ucontext_t on vax, pass the
TLS pointer on the stack referenced by the ucontext_t instead.
suggested by joerg.
2012-01-07 16:47:42 +00:00
joerg 6133e96c53 Add TLS support for m68k. 2011-11-22 15:25:28 +00:00
chs 452fee2663 gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that "ret" without really returning now clobber their registers.
adjust these functions to avoid this problem.
2011-11-21 16:17:48 +00:00
joerg d7796dcc07 Exploit hidden __cerror 2011-11-18 20:43:01 +00:00
joerg 4e5324e222 Mark __cerror as hidden and exploit that to simplify assembler. 2011-11-18 20:21:41 +00:00
joerg 4219a5c627 Explicitly mark __cerror as hidden 2011-11-18 20:17:46 +00:00
joerg 10dc456d4b Hook up TLS support on ARM. Tested by martin@, kernel support from matt@ 2011-11-18 16:10:02 +00:00
christos 0b7c4e1b46 Everything else uses PIC branches to __cerror except those two... 2011-10-29 16:03:33 +00:00
christos 157b9e4ee9 Sync with other ports: in PIC mode make __cerror hidden; it is not supposed
to be used outside libc.
2011-10-29 16:03:03 +00:00
njoly a297cfac57 Fix fpsetmask(3) to be able to clear bits previously set. 2011-10-19 15:24:58 +00:00
christos a92b0ce490 don't use %edi! 2011-09-30 23:45:41 +00:00
christos 6dd90d6d37 make rounding work 2011-09-30 23:42:00 +00:00
christos 26ca52544d PR/44293: Paul Goyette: Fix the mess of the rounding code. 2011-09-30 17:42:34 +00:00
christos 64eddf5284 even simpler. 2011-09-29 22:55:45 +00:00
christos cfa5bcb221 even shorter 2011-09-29 22:53:13 +00:00
christos cfb62a8b7a add a simpler version 2011-09-29 22:46:00 +00:00
christos 38179c4fc2 add a simpler version. 2011-09-29 22:45:20 +00:00
christos 41d70a0317 Instead of using a PICGOT relocation for map, use just a pc-relative one
since it is guaranteed to be close enough. Fixes issue with binutils-2.21.1a
(probably a bug).
2011-09-28 15:11:42 +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
mrg f31d8e575a rename sparc64 BLOCK_SIZE and BLOCK_ALIGN to have SPARC64_ prefixes.
for the assembler files, define the old names to the new names
since using the new names cause ugliness due to longer identifer
names, and reduces churn.

fixes build issues in dtv and vaguely makes <machine/psl.h> slightly
less name-space invasive.
2011-07-12 07:51:33 +00:00
matt 85f1d6f3df Don't use "f" with non-fp types. Use a union to go between
double and uint64_t.  Makes clang happy.
2011-07-10 21:18:47 +00:00
matt 23282762ff Fix so that float128_to_uint64_round_to_zero is defined for sparc64.
(isn't tha a namespace violation?)
2011-07-10 04:52:23 +00:00
matt f73fcccaa1 Don't build tf (long double) if building for O32. 2011-07-09 04:12:01 +00:00
matt cee1c10ee1 Add ieee754 versions of the compiler runtime functions
__fixuns{sf,df,tf}{si,di}.
Add an ieee754 version of the compiler runtime function __floatuntfdi
2011-07-09 02:30:27 +00:00
matt 85c07878cd Don't define a new enum. Just #define round_* to their FP_Rx instead. 2011-07-07 07:14:57 +00:00
matt c2405fa58b Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
2011-07-04 08:02:34 +00:00
matt 80229e0feb Fix softfloat for mips*el 2011-06-27 06:40:26 +00:00
mrg 5ed322d90a apply some -Wno-error/-Wno-enum-compare/-Wno-array-bounds.
this should be looked at more closely.
2011-06-22 05:23:53 +00:00
plunky bdd01b22a1 Functions that return a struct or union, must set %eax to the value
of the original address of the callers area before it returns.

(System V ABI, i386 supplement, fourth edition, page 3-14)
2011-06-12 20:29:25 +00:00
matt f3fc9a4693 Use excb before and after the mt_fpcr/mf_fpcr instructions as specified
in the alpha ARM 4.7.8.1 (Accessing the FPCR):

	Because Alpha floating-point hardware can overlap the execution of
	a number of floating-point instructions, accessing the FPCR must
	be synchronized with other floating-point instructions. An EXCB
	instruction must be issued both prior to and after accessing the
	FPCR to ensure that the FPCR access is synchronized with the
	execution of previous and subsequent floating-point instructions;
	otherwise synchronization is not ensured.

Use unions to convert between double and uint64_t to avoid casting.
2011-06-12 05:44:36 +00:00
drochner a4fc3a054f make sure the infinity returned by HUGE_VALL has the "implicit"
bit set, otherwise it is invalid
This code is unlikely to be hit because gcc (and clang) use
their builtins for these special values.
2011-06-06 17:02:29 +00:00
christos 33c7476cb2 Revert previous and make frach be 0xc0000000 for NAN's generated by strtold()
as suggested by tron.
2011-06-05 14:43:12 +00:00
christos 093aa7c0f7 Make NAN tests consistent with other platforms and FreeBSD. 2011-06-04 15:45:41 +00:00
christos 178153b0c2 use _ALIGN consistently. 2011-05-25 02:11:16 +00:00
christos bde00486af make this compile with DEBUG (_ALIGN was not defined). 2011-05-24 22:39:47 +00:00
joerg b53ad3df44 Use a plain float constant, no need to deal with messy 0r prefix 2011-05-22 20:11:47 +00:00
nonaka 9af4d11fa4 Use "_end" instead of "end" for consistency with other architectures. 2011-05-13 23:14:36 +00:00
martin 251de2dee0 Save a few global registers during set/longjmp - at least the application
registers and the only currently used system register (%g7).
Sparc now passes the setjmp tests (and should be able to build perl again).
2011-04-30 23:41:12 +00:00
martin 9881f8de04 Fix previous: the way we calculate, we need to test the size of sigjmp_buf 2011-04-30 23:39:08 +00:00
martin c670087695 Add another compile time assert: catch overflows of jmp_buf 2011-04-30 23:30:27 +00:00
martin b549c67469 Save/restore some global registers (sigsetjmp compatible). Does not realy
make a difference currently, but is a hard to spot blackhole if something
ever starts using the application registers.
2011-04-30 19:43:17 +00:00
martin 44283e6e19 Rearange jmp_buf content again: storing the sigsetjmp() save_mask midway
inside the environment is not a good idea, we may overwrite it when
fetching other details of the sigjmp environment.
Instead move it to the very end again.
Do not bother to save volatile (caller saved) global registers.
Fixes PR port-sparc64/44918.
2011-04-30 19:39:38 +00:00
matt e148e1968d Use correct CALLFRAME_SIZ depending on ABI. 2011-04-29 08:05:22 +00:00
martin d21307a5d2 Fix offsets used in the assembly code to save global registers into a
jmp_buf, add a compile time assert to catch this kind of divergence
in the C code.
Move the fixed "%npc = %pc + 4" computation to longjmp, this frees
the sigcontext sc_npc value. Use this space to save the savemask
for siglongjmp (we have run out of space behind the globals).
Fixes the tests/lib/libc/setjmp/t_threadjmp tests, and also hopefully
fixes PR port-sparc64/44902.
2011-04-27 21:08:48 +00:00
mrg e9f4b70f7d rm -f ${.TARGET} before trying to > write to it; some how mine ended up
being mode 444 and the build failed.
2011-04-12 03:35:47 +00:00
christos 037499057e make infinityl match what gdtoa thinks. 2011-04-10 13:51:18 +00:00
christos 962e9ad63f fix long double infinity. 2011-04-06 21:55:36 +00:00
martin ecf8c9b0f0 ABI police: avoid cluttering global registers %g2 and %g7. Not quite there
yet for %g2, but the target is not very well defined. %g7 should be clean
now.
2011-03-28 11:19:12 +00:00
christos 2587e6e437 add fpgetprec/fpsetprec 2011-03-26 19:51:41 +00:00
martin d2c615416b Avoid using %g7 2011-03-23 20:54:35 +00:00
martin 0c3a269fd8 Remove the sparc-v7 compatibility wrapper functions (.div, .mul, ... .urem),
the compiler never generates (or did generate in the past) 64bit code to call
them, and they are still present in our 32bit compat library.
2011-03-22 12:24:53 +00:00
christos a46656e6ee Add ld formats for the unit-tests. 2011-03-20 23:16:07 +00:00
matt c5d79d45e3 Properly support the MIPS TLS ABI. 2011-03-15 07:40:18 +00:00
matt 69358e3723 Add PPC TLS support. Add -D_LIBC_SOURCE for tls.c and _lwp.c (powerpc)
so that __lwp_gettcb_fast and __lwp_settcb inlines are define.
2011-03-12 07:55:09 +00:00
tsutsui 7e1a38b9b3 Reorder insns to fix more load delay hazard botches on R3000.
Fixes floating point exceptions in _longjmp() during /etc/rc and
now NWS-3470D boots up to multi user with -current userland binaries.

Also fill BDslots in error path properly.
2011-03-09 16:10:29 +00:00
martin 49f1dcc8e5 While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.
2011-03-06 10:32:47 +00:00
pooka 74ed8d21f3 fix my whitespace copypaste 2011-02-25 11:55:28 +00:00
pooka ba7613308e Fix LE softfloat (mostly theoretical) and comment.
from Alessandro Forin
2011-02-25 11:53:07 +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
matt 2599cc89ba Don't use r0 to restore LR, use r7 instead. 2011-01-29 02:21:20 +00:00
pooka 5f7e80a834 Add support for the Extensible MIPS ("eMIPS") platform. The
NetBSD/emips port runs on Xilinx and Beecube FPGA systems and the
Giano system simulator.

eMIPS is a platform developed at Microsoft Research for researching
reconfigurable computing.  eMIPS allows dynamic loading and scheduling
of application-specific circuits for the purpose of accelerating
computations based on the current workload.

NetBSD eMIPS support for NetBSD 4.x was written at Microsoft Research
by Alessandro Forin and Neil Pittman.  Microsoft Corporation has
donated full copyright to The NetBSD Foundation.

Platform support for eMIPS is the first part of Microsoft's
contribution.  The second part includes the hardware accelerator
framework and will be proposed on tech-kern soon.
2011-01-26 01:18:43 +00:00
matt 787e823fd1 Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
2011-01-25 02:38:15 +00:00
joerg 86b3b196ed Correctly define inta using a helper macro for the # 2011-01-23 14:08:53 +00:00
matt 0da37b7b85 Remove CPUFLAGS?= since it's no longer needed. 2011-01-20 18:41:39 +00:00
matt 8ef507a844 Fix some bugs introduced when switching to new GOT/PLT format. 2011-01-19 02:47:01 +00:00
matt 57d93d8715 Cleanup the o32 compat build test. 2011-01-18 08:12:05 +00:00
matt dfe29b1db4 Change to deal with callframe changes 2011-01-18 01:23:24 +00:00
matt bd081d44b9 Make the MIPS N32/N64 ABIs properly support 128-bit long doubles. With this
change, we should be fully conformant with the N32 and N64 ABIs.
Add {fpclassify,infinity,isnan,ininf,signbit}l_ieee754.c back to lib/libc/gen.
Note that infinityl_ieee754.c will work with either 64-bit, 80-bit, or
128-bit long doubles.
2011-01-17 23:53:03 +00:00
matt 7d92b19968 Make __cerror hidden. 2011-01-17 23:34:44 +00:00
matt 51db1c5cf3 Kill _NOREGNAMES. Everything should be using %rX now. If it doesn't it
soon will.
2011-01-17 08:23:53 +00:00
matt b79441d450 Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
2011-01-16 02:43:10 +00:00
matt cf88c3890b Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
2011-01-15 07:31:11 +00:00
matt 958d64ed82 Generate symbol constants for UC_GREGS_* and CALLFRAME*. 2011-01-14 06:15:27 +00:00
matt 2c2c9e807e Change __cerror to be marked hidden and change callers to avoid the PLT. 2011-01-14 06:12:16 +00:00
tsutsui be1c859466 We can't assume syscall retains t0, unless it's documented as ABI. 2010-12-12 09:03:06 +00:00
tsutsui f3f411dad2 brk(2) should update __curbrk, not __minbrk or garbage. 2010-12-12 09:00:37 +00:00
matt 015f9bbf7a Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
2010-09-03 17:22:51 +00:00
mrg 4c92852a80 remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format.  ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k.  this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
  down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
2010-07-06 05:59:50 +00:00
mrg 3bdcb2e4b5 add a nop to provide enough space for the linker and long calls.
fixes link errors with 'cerror' and libposix.

from dennis.c.ferguson@gmail.com in PR#43010.
2010-03-22 02:17:23 +00:00
mrg 093c642fac replace kernel-only 'stmd' and 'lmd' operations in userland with equivalent
sequences of code, as done in eg, powerpc64/gen/_setjmp.S rev 1.2.

from dennis.c.ferguson@gmail.com in PR#43009.
2010-03-22 01:39:11 +00:00
mrg 19499f3f8d update all of these makefiles for the .so -> .pico change.
most of them are most harmless, but the libgcc parts are quite essential.
before this change, all the special rules for .pico files were not applied,
and exception handling wasn't enabled.  this caused c++ exceptions not to
work on sparc64.


this fixes the build of boost-headers (it was correctly calling exception
support broken!), which in turn makes all the things that depend upon it
to actually work again on sparc64.
2010-03-14 00:26:09 +00:00
uwe 6fc217346b Add memset to libkern on vax, moving existing memset.S to src/common.
While kernel source code is supposed to use <machine/macros.h> via
<sys/param.h> and pick an inline asm version from there, gcc itself
can generate direct calls to memset() for structure initialization, so
the symbol must be provided.

Fixes INSTALL kernel, for which -Os caused gcc to use memset() call to
initialize a struct in uvm_fault_internal().
2010-03-12 09:12:34 +00:00
joerg 56da4fa7b5 Move AMD64's bswap64 implementation from libc to src/common and share it
with the kernel.
2010-01-14 02:09:46 +00:00
skrll 5ddaffd107 Deal with PLABELs in _lwp_makecontext 2010-01-07 12:31:10 +00:00
matt 42b55ff43a Fix typo. 2009-12-14 02:53:52 +00:00
matt 2288207161 Merge from matt-nb5-mips64. 2009-12-14 01:07:41 +00:00
uebayasi 09afef2063 Rename ${SRCS.{alpha,arm,...}.gen} to ${LSRCS.{alpha,arm,...}.gen} because
they ended up in ${LSRCS}, not ${SRCS}.  ${SRCS.*} namespace will be used
for more useful things.  No functional changes intended.
2009-12-06 07:12:17 +00:00
uebayasi 619e0bd90e Set ${SRCS.softfloat}. 2009-12-06 07:05:50 +00:00
christos ad4d8ed92e Add no/op routines for m68000 for the sticky, mask, and round settings. 2009-11-28 23:46:38 +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
phx c9394f466a SystemV-R4 ABI for M68k returns pointers in %a0, so we have to make sure
that CERROR returns -1 in %a0 in addition to %d0 and %d1, to make functions
like mmap(2), mremap(2), shmat(2) or sbrk(2) return -1 in case of an error.
A side effect of this bug was a segfault caused by jemalloc, when mmap()
failed.
2009-10-03 22:28:33 +00:00
dsl a245205b96 Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
2009-08-11 17:30:43 +00:00
dsl d3c3d024a7 bzero.S defines memset(), so exclude memset.c 2009-08-03 06:26:41 +00:00
dsl af129c0bc8 bzero.S also defines memset(), so exclude memset.c 2009-08-03 06:25:34 +00:00
dsl 8190cfe5fa Don't remove imaxdiv.c 2009-07-31 20:54:35 +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 f0a25cf095 Stop bcopy.c and bzero.c being compiled 2009-07-30 21:26:36 +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
dsl 03c902aa70 Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
2009-07-17 19:37:54 +00:00
joerg 9d87375b3e Fix stack alignment for the thread stack. The AMD64 stack has 16 Bytes
alignment, but this is active before the return address is pushed onto
the stack.  Fixes random crashes in va_start when the SSE registers are
saved.
2009-07-02 09:57:09 +00:00
joerg c1faa994fd Reduce diff to makecontext. 2009-07-01 16:54:41 +00:00
christos 2a6e000238 add _lwp_makecontext for the vax. 2009-06-03 01:02:28 +00:00
he 5da54c35c9 Based on input from Eduardo Horvath (eeh@), replace 'stmd' and 'lmd',
which apparently don't exist as instructions, with a sequence of
std / ld instructions.

Also remove the attempted include of ldstm.S which we don't have.
2009-03-08 18:57:12 +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
lukem b85aa1ea53 fix -Wsign-compare issue 2009-02-16 03:23:29 +00:00
mhitch 86223c379c The explicit integer bit is "don't care" for infinity, and now that it's
included in ext_frach, it needs to be masked off when testing for an
infinity value.  Fixes the ieeefp/infinity regression test on the 68060
which clears the explicity integer bit when loading an infinity value.
2009-01-30 07:00:45 +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
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
martin 10b0d64e49 Remove __LIBC12_SOURCE__ 2008-11-24 16:10:27 +00:00
nakayama 531d468612 Redo rev.1.13. We must refer to CURBRK via GOT in case of PIC. 2008-11-06 13:42:55 +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
matt 01b36ae8ad Use WEAK_ALIAS 2008-08-04 20:26:38 +00:00
matt e796a34c9c Use WEAK_ALIAS.
Add imaxabs weak alias.
2008-08-04 20:21:26 +00:00
rmind 7781a976a7 Avoid calling a syscall when argument to sbrk(2) is zero.
OK by <ad>.
2008-07-02 20:07:43 +00:00
martin 5d1469bd77 Backout previous: the license sweep touched these files in error, so
restore the old license.
2008-05-10 15:31:03 +00:00
martin f1a537e1d9 Fix nested comment and move to 2 clause license 2008-05-02 18:34:17 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dogcow 690e5f1c0b add matching END(). found via -Wa,--fatal-warnings 2008-04-22 04:47:44 +00:00
garbled 6f4524c1a6 Fix a stupid typo in a comment. Pointed out by Juergen Hannken-Illjes. 2008-04-18 08:05:05 +00:00
garbled 1ad3697abd Back out the ppc assembler changes for memcpy/memmove/memcmp on evbppc.
It breaks the explora because the cpu (403) cannot deal with unaligned
accesses.  Reported by Juergen Hannken-Illjes.
2008-04-18 05:34:04 +00:00
chris c82cfbf571 Use SYSTRAP macro, rather than inlining the swi instruction.
This makes sure the SWI will be in the NetBSD assigned range of swi
numbers.
2008-03-30 21:22:05 +00:00
he 0db6a6b023 When compiling for _STANDALONE, omit a bunch of headers which aren't really
needed and which trigger build problems.

(These two files should probably be unified and put under common/...)
2008-03-18 20:11:43 +00:00
he 71ca0c37fa As mrg@ informs me, delay slots are indented 1 and not 2 spaces. 2008-03-10 18:31:08 +00:00
he bbed82985f Fix the problem that CURBRK can't be referenced directly via R_SPARC_GOT13
here anymore (apparently libc grew too big).  Use sethi and %hi/%lo instead.
2008-03-10 18:28:43 +00:00
garbled f908c50890 Make use of ppc tuned assembler. 2008-02-21 17:37:00 +00:00
mrg d638eaddc1 m68k/Makefile.inc:
- add __mmap.S to SRCS.
- add _lwp_getprivate.S mremap.S to ASM.
sys/Makefile.inc:
- look for __glue.S as well as glue.S.
- introduce a new ASM_MD and set it to "_lwp_getprivate.S mremap.S".
  this is used for assembler files that may have non-default
  implementations.

now m68k and m68000 mostly build again.
2008-02-09 02:41:06 +00:00
martin 8f4340d1d4 Modify the high part of the fraction so that we recognize our __infinityl
value.
XXX - seems like we could share this with LE archs
2008-01-10 00:34:27 +00:00
simonb d8de5b102b Remove support for NetBSD/pc532. 2008-01-09 11:25:58 +00:00
martin e094ff6106 Add missing stubs for syscalls returning addresses.
We can now run on a kernel that does not copy the syscall return value
to register A0.
As discussed in PR port-m68k/37631.
2007-12-31 07:39:19 +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
dsl 3ba44b945b Reorder the code for i386 and amd64 syscall stubs so that the 'jc' on error
is a forwards jump instead of a backwards jump that a P4 will mispredect (and
probably immediatly get a cache-line miss due to the way the code gets
aligned).
2007-11-23 07:36:05 +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
ad 51a2159851 Don't unconditionally clear the direction flag. The ABI says it must always
be clear when making a function call, and 'cld' takes about 50 clock cyles
on the P4.
2007-11-12 18:41:59 +00:00
martin 5265977a9e When converting long double values to integer types, explicitly use the
"round to zero" variants of the softfloat conversion functions.
Add a variant to convert long double to unsigned long - the "to long"
variant checked for overflows that do not apply to unsigned results.
This fixes the regress/lib/libc/convfp tests for sparc64.
2007-11-08 15:50:19 +00:00
dsl bd8185f2eb syscall() has to be implemented in the kernel - so is a normal system call here.This has always been broken, so I suspect everything is using __syscall(). 2007-11-05 20:30:07 +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
uwe a34b3f871d In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
2007-10-08 13:06:00 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
pooka 65ec9d356d Don't clobber callee save registers r12 & r13 in swapcontext. They
were saved in the stack, but the subsequent swapcontext would return
to the earlier stack frame and never restore them.  Fixes puffs
with default compiler flags on amd64.

Thanks to Mihai Chelaru for providing access to an amd64 machine
for debugging this problem.
2007-04-12 12:33:26 +00:00
scw 5764a76889 Remove support for NetBSD/{,evb}sh5. 2007-04-08 09:35:21 +00:00
ad 3cac6dbb47 If I686_LIBC is defined, make syscalls using the 'sysenter' instruction. 2007-03-09 14:30:45 +00:00
ad a99fcd719d Remove an obsolete comment. 2007-03-08 13:46:31 +00:00
mhitch d417d9f5d4 From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
2007-02-17 17:50:52 +00:00
christos 12287894d6 ext_int bit is no more. 2007-02-02 23:18:57 +00:00
christos 0449ecc079 since the int bit is merged, do the explicit math. 2007-02-02 23:14:09 +00:00
hubertf 55ac93d329 Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
2007-01-17 23:24:22 +00:00
martin 1c4ebce529 Provide a full frame stack space in the clone'd child. 2006-12-28 17:46:03 +00:00
martin 55a9a999dd Use CCFSZ instead of 96 for standard save operations. 2006-12-28 10:02:43 +00:00
martin f666b179b1 After discussing this further with uwe, rearange stack usage slightly and
replace a comment with words suggested by him.
2006-12-27 13:40:56 +00:00
martin 520e5c8f6a When setting up the __clone()'s userland stack, make sure to allocate
an initial frame. Fixes PR 33075.
2006-12-25 21:44:37 +00:00
martin 2ed5a47025 Pull over rev. 1.5 of the i386 version (../../i386/resumecontext.S),
quoting Matthias Drochner:

> -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.

This fixes regress/lib/libc/context for m68k.

Thanks to Steve Woodford for optimization hints.
2006-12-13 10:48:02 +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
martin 2cb7656bf1 Pull over rev. 1.5 of the i386 version (../../i386/resumecontext.S),
quoting Matthias Drochner:

> -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.

This also fixes regress/lib/libc/context for sparc64.
2006-12-08 15:51:45 +00:00
drochner 58bd20f660 if setcontext(2) returns, _exit(2) with a return code of -1 instead
of relying on a sensible return value
2006-11-08 21:16:40 +00:00
drochner ac9d7f2faf -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-11-08 20:28:03 +00:00
cherry 1ad9454efb Towards ia64 libc. Round #2 2006-09-23 17:39:34 +00:00
cherry 64f11261d1 ia64 libc MD stuff #1. Pushing in everything before my harddisk pops. 2006-09-22 17:59:47 +00:00
cherry 768b7d52a9 add ia64 libc MI bits. 2006-09-22 12:09:24 +00:00
cherry 503611ba29 libc stubs added 2006-09-10 21:22:33 +00:00
simonb 0f58c090bc Rename these functions to the __<name>14 names.
XXX: still need to be converted to use sigprocmask().
2006-09-04 01:08:11 +00:00
jld e8ef331ffa Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.

Fix provided by Matthias Drochner in the PR.
2006-08-02 04:18:48 +00:00
ross 60ce5dccc9 Add missing ppc64 elements 2006-07-07 21:07:35 +00:00
cherry c41313666f checkin libc asm stubs, #1 2006-07-07 07:49:19 +00:00
ross 549728f08a build __sigaction14_sigtramp.c 2006-07-07 06:56:34 +00:00
ross fefc484d05 rcsid & white space 2006-07-07 06:53:42 +00:00
ross db64036e6c fix @toc reference macro 2006-07-07 06:50:06 +00:00
ross 7108da6a37 Add missing sigaction() 2006-07-07 06:40:45 +00:00
ross 7008de4c81 bzero() and memset() for ppc64. 2006-07-07 04:54:52 +00:00
ross 4669390119 rewrite for ppc elf64 reloc 2006-07-06 17:05:04 +00:00
ross 5844b0794f we need the current vfork 2006-07-06 17:04:22 +00:00
ross 3fbcafa1c9 convert remaining ppc32 code to ppc64 2006-07-05 18:28:43 +00:00
ross 0584742537 convert PIC linkage 2006-07-05 18:27:08 +00:00
ross 50500ff1b2 revise for ppc64 2006-07-05 18:12:54 +00:00
ross a9ea5c11ba Adjust types and casts for LP64 compilation.
Split "long *sp;" into "__greg_t sp, *spp;", which reduces the cast
density and could be used to clean up the ppc32 version as well.
2006-07-05 18:10:36 +00:00
ross a87ca7ecec fix typo 2006-07-05 18:07:22 +00:00
ross dfb9c8767b Finish ppc64 conversion 2006-07-05 18:06:47 +00:00
ross 9ed70a7fa2 adjust casts for LP64 2006-07-05 18:05:45 +00:00
drochner 3379c1c805 replaced by code in libc/compat/gen 2006-07-03 13:20:19 +00:00
drochner 46b4d67318 build {frexp,ldexp,modf} in the "compat" subtree
(Drop the modf assembler version. We have the same code in libm.)
(Drop the ldexp inline-assembler version. The same code is in libm as
scalbn; the ldexp there is just a wrapper providing error handling.)
2006-07-03 13:13:53 +00:00
drochner 5ea27734ec build frexp_ieee754 and ldexp_ieee754 in the "compat" subtree
(There is an assembler version of modf which needs to be checked.)
2006-07-03 13:06:12 +00:00
drochner 2a270967fb This is a new port - don't ever start with frexp/ldexp/modf in libc, we
have it in libm already.
2006-07-03 13:03:49 +00:00
drochner 451c99c7a2 build frexp_ieee754 and ldexp_ieee754 in the "compat" subtree
(There is an assembler version of modf which needs to be checked.)
2006-07-03 13:00:54 +00:00
drochner 4cbc875060 build frexp_ieee754 in the "compat" subtree
(There are assembler versions of ldexp and modf which need to be checked.
I'm in doubt they are metter than those in libm.)
2006-07-03 12:58:55 +00:00
drochner c48c54fd05 build frexp_ieee754 in the "compat" subtree
(The Makefile logics for ldexp and modf is too involved for me to deal
with this now.)
2006-07-03 12:54:34 +00:00
ross d48f14661d ppc64 build framework first pass 2006-07-01 16:37:20 +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
drochner 0ed7304bd6 build frexp/ldexp/modf in the "compat" part
(code is identical)
2006-06-28 14:22:15 +00:00
drochner 4502979a72 Build just the compatibility versions of frexp()/ldexp()/modf(), the
real implementation is in libm.
2006-06-27 18:19:57 +00:00
uwe 46daac62de G/c KMSRCS and KMINCLUDES now that we have common/lib/libc 2006-06-17 18:04:23 +00:00
mrg e69cf86f15 remove GCC2 support 2006-06-02 19:47:15 +00:00
mrg 15fc3900ea add a local prototype for fabs() 2006-05-21 02:51:15 +00:00
christos 96473fa808 change __weak_extern to __weak_reference so that gcc4 works. 2006-05-18 17:54:19 +00:00
mrg 8726b401d3 if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess. 2006-05-16 20:55:51 +00:00
mrg 640873a430 make sure there is a prototype in scope. 2006-05-16 05:29:16 +00:00
mrg 340a97942e if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess. 2006-05-11 23:53:14 +00:00
mrg fd07545586 in makecontext(), sp is unsigned * so don't assign signed *'s to it. 2006-05-11 00:34:44 +00:00
snj a640fe8c43 It's "its." 2006-04-24 19:00:29 +00:00
uwe 13ab2e2a10 Now that bcopy.S doesn't contain the actual implemenation, move it
back to libc.
2006-04-23 00:08:18 +00:00
mrg 0db1500b43 retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4. 2006-04-07 19:38:58 +00:00
skrll 6f5914a550 __sigtramp1.S moved to the new compat layout so we should try and build
it here.
2006-04-05 12:23:51 +00:00
drochner f81322cf18 build erand48_ieee754.c on everything but vax 2006-03-22 22:03:58 +00:00
he dcaa7a3be5 It's .endif, not .fi. 2006-03-21 22:50:13 +00:00
kleink 4b173cfc48 Don't build extended-precision routines on m68000; from Havard. 2006-03-20 09:52:23 +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
christos ab2a637b34 Welcome to the new compat layout. 2006-03-11 19:34:40 +00:00
christos 2b52112d5a Remove files moved to the new compat layout. 2006-03-11 19:16:07 +00:00
christos edc071d5b4 remove files moved to the new compat layout. 2006-03-11 19:02:16 +00:00
christos 22d2b3199c Welcome to the new compat layout. 2006-03-09 16:20:27 +00:00
wiz 5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
wiz 1ad8067cb3 Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
2006-02-25 00:58:34 +00:00
he 516a950568 Remove unused local variable (re-declared in inner conditional scope). 2006-02-22 08:49:45 +00:00
christos b1732b7a63 make these consistent. 2006-02-19 05:06:02 +00:00
matt 8b121c704a Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
2006-02-18 22:54:51 +00:00
matt b09fbb025f *setjmp14 are not compat, plain setjmp/sigsetjmp are the compat versions.
Exchange the files.
2006-02-18 00:45:22 +00:00
matt bfb62ce415 Move PowerPC compat files from arch/powerpc to compat/arch/powerpc. 2006-02-18 00:21:27 +00:00
kleink 804e6c96a2 Add machine-dependent definitions for gdtoa. 2006-01-25 15:33:28 +00:00
martin 2e1a547276 Cosmetics (pointed out by uwe): use trivial restore, not the explicit
version.
2006-01-08 20:03:19 +00:00
martin 286956e76d Use __errno in the _REENTRANT case (pointed out by Valeriy E. Ushakov).
While there, indent some delay slot instructions.
2006-01-08 12:05:33 +00:00
uwe 5cee9283d0 Provide _REENTRANT version of errno = 0; 2006-01-06 20:38:01 +00:00
uwe 0e79e13e9c Use JUMP_CERROR instead of messing with errno directly.
Simplify.
2006-01-06 07:07:34 +00:00
uwe 3a310524fb Drop unnecessary nops. 2006-01-06 06:19:20 +00:00
uwe ec3c02b8ff Simplify. 2006-01-06 05:23:46 +00:00
uwe 6ea6e06ed1 Change !_REENTRANT && !PIC case to use r4 too. 2006-01-06 05:14:39 +00:00
uwe 026eb7b69e Open code _SYSCALL_NOERROR to shave off a memory load and a branch.
Makes this congruent to vforks.  Add .size directive.
2006-01-06 05:11:29 +00:00
uwe 73375bbc4d Add .size directive. 2006-01-06 04:38:10 +00:00
uwe b46734f0ca Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
2006-01-06 03:58:31 +00:00
uwe b1648afca2 This can be simplified to RSYSCALL(__syscall), no special treatment necessary. 2006-01-06 01:57:38 +00:00
uwe 63e9eca689 This can be simplified to PSEUDO(exect,execve). 2006-01-06 01:53:30 +00:00
uwe 63f84ca820 This can be simplified to RSYSCALL(syscall), no special treatment necessary. 2006-01-06 01:27:23 +00:00