Commit Graph

26 Commits

Author SHA1 Message Date
Jacques Vidrine
07a6d1d3f2 Add prototypes for the three syscall stubs that are invoked here,
in order to quiet warnings.
2004-01-19 16:14:58 +00:00
Jacques Vidrine
3d7cd67f51 We need to discard `const'ness explicitly when invoking sysarch.
Reported by:	sparc64 tinderbox via bde
2004-01-10 15:57:06 +00:00
Jacques Vidrine
e4dc8baa84 Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'm
at it, use the ANSI C generic pointer type for the second argument,
thus matching the documentation.

Remove the now extraneous (and now conflicting) function declarations
in various libc sources.  Remove now unnecessary casts.

Reviewed by:	bde
2004-01-09 16:52:09 +00:00
Jacques Vidrine
78ea1df143 Remove unused variables. Add required headers and function
declarations.
2004-01-06 18:53:26 +00:00
Jake Burkholder
eaf21f315e Install the user trap handlers that libc provides from a constructor, so
that they will be installed before application constructors are invoked.
Its possible to link applications such that this fails, application code
is invoked before they are installed, but, well, Don't Do That.

Approved by:	re (jhb)
2003-11-18 14:21:41 +00:00
Bruce M Simpson
abd498aa71 Add the mlockall() and munlockall() system calls.
- All those diffs to syscalls.master for each architecture *are*
   necessary. This needed clarification; the stub code generation for
   mlockall() was disabled, which would prevent applications from
   linking to this API (suggested by mux)
 - Giant has been quoshed. It is no longer held by the code, as
   the required locking has been pushed down within vm_map.c.
 - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES
   to express their intention explicitly.
 - Inspected at the vmstat, top and vm pager sysctl stats level.
   Paging-in activity is occurring correctly, using a test harness.
 - The RES size for a process may appear to be greater than its SIZE.
   This is believed to be due to mappings of the same shared library
   page being wired twice. Further exploration is needed.
 - Believed to back out of allocations and locks correctly
   (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC).

PR:             kern/43426, standards/54223
Reviewed by:    jake, alc
Approved by:    jake (mentor)
MFC after:	2 weeks
2003-08-11 07:14:08 +00:00
Jake Burkholder
2ecf9f7162 Rename the libc signal trampoline to __sigtramp to match netbsd. This
should allow gdb to detect when we're executing in a signal trampoline.
2002-10-22 15:15:39 +00:00
Jake Burkholder
89172e2e25 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
Thomas Moestl
58d646cdd3 Add missing ret instruction to the ptrace() syscall wrapper. 2002-07-11 15:48:02 +00:00
David E. O'Brien
3b7de54d68 Use FBSDID 2002-06-30 05:36:49 +00:00
Jake Burkholder
530622075e 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 Burkholder
5893472b2d Use the right byte order for unaligned stores. <blush>. 2002-05-13 22:48:01 +00:00
Jake Burkholder
30eeff14ef Handle alignment fault fixups in libc rather than in the kernel. 2002-05-13 04:35:08 +00:00
Jake Burkholder
025c284b8d 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
Jake Burkholder
621136996a 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 Burkholder
8c93421144 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
Thomas Moestl
9300cb7db7 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
Thomas Moestl
4895e965c3 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 Burkholder
3b16ee2c6c Fix wrong offsets. Add offsets for %fsr and %tstate.
Submitted by:	tmm
2002-02-23 19:01:22 +00:00
Jake Burkholder
d1497824f0 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
Jake Burkholder
29c3ea8424 Connect user trap code to the build. 2002-01-01 21:59:53 +00:00
Jake Burkholder
6ce4e876a7 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 Burkholder
1b46a084f3 Make sure curbrk is well aligned. 2001-12-29 06:40:58 +00:00
Jake Burkholder
b6d97b0c52 Need .type and .size here too. 2001-11-18 04:48:34 +00:00
Jake Burkholder
29e5109c5f Remove fork and vfork wrappers. The kernel does the right thing. 2001-11-18 04:31:36 +00:00
Jake Burkholder
e74ea2d01a Minimal libc for sparc64.
Reviewed by:	obrien
2001-10-26 05:40:07 +00:00