Commit Graph

56 Commits

Author SHA1 Message Date
archie
207fb06f80 Revert previous commit to unbreak world until we figure out the
right way to do it.
2002-09-20 15:43:26 +00:00
archie
59b24d359e Fix a problem with the definition of HUGE_VAL causing the gcc warning
"cast increases required alignment of target type" on some platforms.

Reviewed by:	bde
2002-09-19 19:47:27 +00:00
tmm
c14b63a0b9 Use the macros from machine/fsr.h; some minor cleanups. 2002-09-14 18:07:03 +00:00
tmm
6bea77d590 Add implementations of fpgetmask(), fpgetround(), fpgetsticky(),
fpsetround(), fpsetsticky(), obtained from NetBSD and tweaked a little
to use definitions from machine/fsr.h instead of magic numbers.
2002-09-14 18:06:21 +00:00
tmm
c568640675 Add an implementation of fabs() (which is quite trivial).
When it is called directly, gcc is smart enough to generate inline
code for it, which is why it wasn't noticed before that it was missing.

fabs() would probably better fit into libm, but it has traditionally been
in libc on FreeBSD, so there is probably software around that makes
assumptions about this by now.
2002-09-13 16:01:26 +00:00
jake
c73a7dbd84 Install the userland signal trampoline when sigaction is first called,
instead of on startup.  This fixes binary compatibility of dynamically
linked binaries from before the signal code move.

Suggested by:	wollman (a long time ago)
2002-09-03 14:55:29 +00:00
jake
1359c1017e Use FOO(a) for macros with variadic args, instead of FOO(a,) or FOO(a, ).
Submitted by:	gcc3.2
2002-09-02 02:30:20 +00:00
tmm
95a384b19a Add missing ret instruction to the ptrace() syscall wrapper. 2002-07-11 15:48:02 +00:00
obrien
0ceea17099 Use FBSDID 2002-06-30 05:36:49 +00:00
obrien
83975c1387 Use __FBSDID. 2002-06-29 03:23:51 +00:00
obrien
30c36077fc Add frexp(3).
Obtained from:	OpenBSD
2002-06-29 03:23:18 +00:00
jake
a301f57f70 Remove unneeded include of machine/emul.h. 2002-06-18 02:15:11 +00:00
jake
4c4cc525a8 Implement _Qp_sqrt. I've been unable to find a C program that gcc generates
a call to this for, but apparently somehing in libstdc++ does.
2002-06-04 17:02:27 +00:00
jake
d6dcf86c81 Generate the normal asm stubs for all sysv system calls. Use these instead
of C wrappers for the *sys indirect system calls.  The indirect system calls
are horribly broken on sparc64.

Submitted by:	tmm
2002-05-23 23:51:57 +00:00
jake
a10a1944b6 Use the right byte order for unaligned stores. <blush>. 2002-05-13 22:48:01 +00:00
jake
7f78957a1b Handle alignment fault fixups in libc rather than in the kernel. 2002-05-13 04:35:08 +00:00
jake
6aad34df02 Add a support macro to convert the 5-bit packed register field of
a floating point instruction into a 6-bit register number for
double and quad arguments.
Make use of the new INSFPdq_RN macro where apporpriate; this
is required for correctly handling the "high" fp registers
(>= %f32).
Fix a number of bugs related to the handling of the high registers
which were caused by using __fpu_[gs]etreg() where __fpu_[gs]etreg64()
should be used (the former can only access the low, single-precision,
registers).

Submitted by:	tmm
2002-05-11 21:20:05 +00:00
obrien
5a08b828ba Use __FBSDID 2002-05-06 23:24:39 +00:00
obrien
24135e978a We typically don't add trailing /'s. 2002-05-06 23:24:16 +00:00
jake
38d2985e9b Add an alternate signal trampoline to libc; add a wrapper for the sigtramp
install sysarch, to be called from _start.

This will allow the stack to be mapped non-executable, as required by the
sparc v9 abi.
2002-04-29 18:14:44 +00:00
jake
2b67a5630b Add code to emulate arithmetic, comparison and conversion operations
on long double, which are not implemented in hardware on any UltraSPARC
chip that I know of.  This just calls into the existing floating point
emulator, which is still needed to emulate other floating point operations
in certain conditions.  Without this gcc has to generate the quad floating
point instructions directly, which sometimes causes internal compiler
errors.

Reviewed by:	tmm
2002-04-28 02:36:36 +00:00
jake
a1a94cce5c Emulate ldq and stq (load/store long double) instructions. GCC has started
using these to load long doubles, but they aren't implemented in hardware
on (at least) UltraSPARC I and II machines.
Emulate popc in the user trap handler as well.
Re-arrange slightly to make support functions more accessible.

Reviewed by:	tmm
2002-04-27 21:56:28 +00:00
jake
a72383027f Rename some fields in struct frame to be compatible with NetBSD/OpenBSD,
and add some compatibility defines.  Add fields for ins and locals to
struct reg also for the same reason; these aren't filled in yet because
getting at those registers sucks and I'd rather not save them in the
trapframe just for this.  Reorder struct reg to be ABI compatible as
well.  Add needed include of machine/emul.h.

This gets pmdb (poor man's debugger) from OpenBSD mostly compiling but it
doesn't work yet :(
2002-04-09 00:57:23 +00:00
tmm
c944152856 htonl() and ntohl() operate on unsinged types, so they must zero-extend,
not sign-extend. Fix a comment in the former to that effect, and change
the latter over to do the right conversion.
2002-04-06 00:07:15 +00:00
obrien
b1189e8930 Fix the style of the SCM ID's.
I believe have made all of libc .h's as consistent as possible.
2002-03-22 23:42:05 +00:00
obrien
d90536e35b Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
2002-03-22 21:53:29 +00:00
obrien
6754aaaeed SCM ID tweak. 2002-03-22 09:27:59 +00:00
obrien
3b73ce2319 Remove __P() usage. 2002-03-21 22:49:10 +00:00
obrien
1196344bb3 Remove 'register' keyword. 2002-03-21 18:49:23 +00:00
tmm
bef62c8ae4 Fix some bugs that would prevent %fsr to be set correctly, and add
support for fcmp and fcmpe instructions with a condition code
specification other than %fcc0.
This (primarily the first part) seems to fix a lot of problems that
people were seeing, e.g. perl and gawk failures.

Reported and analyzed by:	wollman
2002-03-11 03:18:17 +00:00
tmm
add3c8c972 Account for <machine/fsr.h> no longer being usable for assembler code. 2002-03-11 03:13:02 +00:00
tmm
30dcded43a Fix __dtoul to work on sparc64 (it used a half-way v8 stack layout),
and make it PIC-aware.
2002-03-11 03:10:55 +00:00
tmm
9d0a7ccb85 Save/restore the %y register around calls to the C user trap handler;
gcc emits the deprecated sparc v8 instructions that use this register
when optimizing for UltraSparc machines because they are apparetly
faster then their v9 counterpars there.
2002-03-11 02:53:03 +00:00
jake
605c439175 Add fpsetmask(). Needed to build miniperl.
Obtained from:	netbsd
2002-03-05 04:03:57 +00:00
jake
e4766db304 Fix a bug where siglongjmp would clobber the argument to return from
sigsetjmp.  It would return the value of the signal flag, instead.

Pointy hat to:	jake
2002-03-05 04:02:04 +00:00
tmm
1e66eafc6c Connect the sparc64 userland fp emulator to the build. 2002-03-05 00:00:40 +00:00
tmm
c0c8cd1eeb Add userland floating point emulator code for sparc64. This is a port
of the (never committed) in-kernel version (with some optimizations and
cleanups), which in turn was ported from NetBSD.
2002-02-23 21:37:18 +00:00
jake
9cdf1cce75 Fix wrong offsets. Add offsets for %fsr and %tstate.
Submitted by:	tmm
2002-02-23 19:01:22 +00:00
jake
a349eff875 Add space for %fsr and %tstate to utrapframe. Save them in the generic
user trap entry code.  Restore %asi and %ccr from the saved %tstate before
returning to the trapping user code.

Submitted by:	tmm
2002-02-23 19:00:30 +00:00
mike
bcee06d42c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
jake
cc0e9cda25 Connect user trap code to the build. 2002-01-01 21:59:53 +00:00
jake
bf1d0034f8 Add libc side of user trap handling.
Add support for handling floating point disabled traps mostly in userland
for the simple single threaded case.  Not yet enabled by default.
Implement __sparc_utrap_install as specified by the sparc abi.
2002-01-01 21:58:32 +00:00
jake
19d78fb18d Make sure curbrk is well aligned. 2001-12-29 06:40:58 +00:00
jake
6f9fc42c7d Use jmpbuf offsets, not ucontext_t. 2001-12-29 06:40:35 +00:00
jake
3483475ed5 Add .register directives for gcc3.
Adapt to jmpbuf no longer being a ucontext_t.
Restore the context "by hand" in longjmp and call sigprocmask, instead
of just using sigreturn.
2001-12-29 06:39:53 +00:00
jake
56db29dc1a __infinity is not const. 2001-12-29 06:38:31 +00:00
jake
2e0c4bb65d Add jmpbuf offsets. Remove ucontext offsets. 2001-12-29 06:38:06 +00:00
jake
3e3b7768f5 Add .register directives for gcc3.
Adapt to jmpbuf no longer being a ucontext_t.
Call abort if longjmperror returns.
2001-12-29 06:37:33 +00:00
jake
7e615e1838 Include utrap.h for soft trap types. 2001-12-29 06:36:07 +00:00
jake
6a36fe07de Actually build new files.
Forgotten by:	jake
2001-11-19 00:19:49 +00:00