Commit Graph

202 Commits

Author SHA1 Message Date
David Schultz
f154b03b25 Update my email address. 2005-02-06 03:23:31 +00:00
David Schultz
bd15659f64 Eliminate gdtoa.mk and move its contents to ${MACHINE_ARCH}/Makefile.inc.
The purpose of having a separate file involved an abandoned scheme that
would have kept contrib/gdtoa out of the include path for the rest of libc.
2005-01-15 05:23:58 +00:00
Daniel Eischen
6c68cb596e Make sure the first argument to the user function is 16-byte aligned.
Submitted by:	tegge
2004-12-05 21:22:08 +00:00
John Baldwin
d0565c1493 Remove 80386 support from libc. 2004-11-16 21:01:31 +00:00
Peter Wemm
5bc7bd5ff2 When building the custom i386 libraries for use on amd64 kernels, we
can't use the i386_set_ldt() family of routines, because they are not
implemented.  Instead, use the recently exposed direct access sysarch
routines for setting what %fs and %gs point to.

Use this for the i386 TLS _set_tp() routine, but only when compiling to
run as a 32 bit support binary for amd64 kernels.
2004-11-06 03:28:26 +00:00
David E. O'Brien
62f696fcfa Sync with sys/i386/include/endian.h: use the single instruction 'bswap'. 2004-10-18 17:19:36 +00:00
Doug Rabson
ccd13c49b5 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
David Schultz
479f8d2214 Make FLT_ROUNDS correctly reflect the dynamic rounding mode. 2004-07-19 08:17:25 +00:00
David Schultz
39bcea8689 Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.
2004-07-18 21:23:39 +00:00
David Schultz
240dbabfa8 Implement the classification macros isfinite(), isinf(), isnan(), and
isnormal() the hard way, rather than relying on fpclassify().  This is
a lose in the sense that we need a total of 12 functions, but it is
necessary for binary compatibility because we have never bumped libm's
major version number.  In particular, isinf(), isnan(), and isnanf()
were BSD libc functions before they were C99 macros, so we can't
reimplement them in terms of fpclassify() without adding a dependency
on libc.so.5.  I have tried to arrange things so that programs that
could be compiled in FreeBSD 4.X will generate the same external
references when compiled in 5.X.  At the same time, the new macros
should remain C99-compliant.

The isinf() and isnan() functions remain in libc for historical
reasons; however, I have moved the functions that implement the macros
isfinite() and isnormal() to libm where they belong.  Moreover,
half a dozen MD versions of isinf() and isnan() have been replaced
with MI versions that work equally well.

Prodded by:	kris
2004-07-09 03:32:40 +00:00
Ruslan Ermilov
1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
David Xu
39ba326d65 Follow previous change in makecontext. Use %esi to store next ucp
pointer, here we keep orignal %ebp, so we can see where signal handler
comes in and interrupt normal code.
2004-07-02 23:20:05 +00:00
Ruslan Ermilov
d37ea99837 Removed trailing whitespace. 2004-07-02 19:07:33 +00:00
David Xu
a5a5d84784 Use %esi to store next ucp pointer. Mark end of stack by
setting %ebp to zero, this avoids new gdb to dump a weird
backtrace.
2004-07-02 14:19:44 +00:00
David Schultz
a94707138b Remove the code and an associated comment for gcc 1.x compatibility
and fix a typo in the !__GNUC__ case.
2004-02-16 10:03:02 +00:00
David Schultz
36e22bed27 Fix some aliasing problems. 2004-02-16 10:02:40 +00:00
Colin Percival
d623b765cf style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags after the copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:42:33 +00:00
David Schultz
a8cb7cca02 Define LDBL_MANH_SIZE and LDBL_MANL_SIZE to be the sizes of the
high and low words of the mantissa in bits, respectively.
2004-01-18 07:57:02 +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
Ruslan Ermilov
fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Peter Wemm
6046bc37e8 Make getcontext(2) work on i386. It needs a small wrapper in libc
otherwise the return from the syscall stub for getcontext will pop off
the return value for the caller to the getcontext stub and it will appear
as though the setcontext() syscall returned instead of the getcontext().
The same bug exists on amd64, a fix is coming there too.

The bug can be demonstrated with this test code fragment:
main()
{
        ucontext_t top;

        if (getcontext(&top) == 0) {
                write(2, "PING!\n", 6);
                /* Cause a return value of 1 from getcontext this time */
                top.uc_mcontext.mc_eax = 1;
                setcontext(&top);
                err(1, "setcontext() returned");
        }
        write(2, "PONG!\n", 6);
        _exit(0);
}
2003-09-04 00:20:40 +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
Julian Elischer
5774db75bd Allow foot shooting as Linux emulation needs it.
Also change "Auto mode" to use a "special" value
instead of 0, and define and document it.
I had thought libpthread had already been switched to use auto mode but
it appears that patch hasn't been committed yet.

Discussed with:	 Davidxu
2003-08-04 19:11:56 +00:00
David Xu
01724ec53d Update manual for i386_set_ldt to reflect newly added features.
Submitted by: julian
2003-07-31 02:13:48 +00:00
David E. O'Brien
0ab6a0c787 Push the alloca #error warning farther down to play nicer with some out of
tree local translator.

Requested by:	 jmallett
2003-06-25 19:06:40 +00:00
David E. O'Brien
5c784c8f4b Only use this with a non-GCC compiler. 2003-06-14 06:04:23 +00:00
John Baldwin
dff6f51034 Remove stale reference to the deprecated USER_LDT option. The associated
code is always compiled into the kernel now.

Submitted by:	Hubert Tournier <hubert@frbsd.org>
PR:		docs/53068
2003-06-09 11:46:22 +00:00
David E. O'Brien
e683295e39 Use C99 compatible ASM statements. 2003-06-02 02:32:22 +00:00
Ruslan Ermilov
3a5146d9e2 Assorted mdoc(7) fixes.
Approved by:	re (blanket)
2003-05-22 13:02:28 +00:00
Ruslan Ermilov
aba60fa66b Fixed troff(1) and mdoc(7) warnings.
Approved by:	re (blanket)
2003-05-18 21:05:22 +00:00
David Schultz
b7412bf571 Add a comment describing why it's important for the values in this
file to be correct, and how to generate them automatically.

Caused much pain and suffering for:	peter
2003-05-08 13:50:44 +00:00
John Baldwin
664234c6e2 Properly cleanup the stack before jumping to cerror() if rfork(2) fails.
Submitted by:	Igor Sysoev <is@rambler-co.ru>
Approved by:	re (scottl)
2003-05-07 17:23:25 +00:00
Matthew N. Dodd
4161ee3d26 Document VM86_INTCALL.
Submitted by:	 Bruce M Simpson
2003-04-29 08:35:28 +00:00
David Schultz
92b93b37c0 Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().
In support of this, add some MD macros to assist in converting long
doubles to the format expected by gdtoa().

Reviewed by:	silence on standards@
2003-04-05 22:10:13 +00:00
Tim J. Robbins
799d93559b MFp4: Pentium/Athlon-optimised implementation of wcschr(). 2003-04-05 04:17:05 +00:00
Daniel Eischen
67aba1c6a4 Align signal frame placed on stack to 16 bytes so that SSE FPU register
restores can work.  Also correct allocation for signal frame size.

Reviewed by:	mini
2003-03-29 16:38:15 +00:00
Tim J. Robbins
564529ff1a MFp4: Pentium/Athlon-optimised implementation of wcslen(). 2003-03-14 11:01:12 +00:00
David Schultz
6a66acb565 Replace our ancient dtoa/strtod implementation with the gdtoa
package, a more recent, generalized set of routines.  Among the
changes:
- Declare strtof() and strtold() in stdlib.h.
- Add glue to libc to support these routines for all kinds
  of ``long double''.
- Update printf() to reflect the fact that dtoa works slightly
  differently now.

As soon as I see that nothing has blown up, I will kill
src/lib/libc/stdlib/strtod.c.  Soon printf() will be able
to use the new routines to output long doubles without loss
of precision, but numerous bugs in the existing code must
be addressed first.

Reviewed by:	bde (briefly), mike (mentor), obrien
2003-03-12 20:30:00 +00:00
Tim J. Robbins
1609edca75 MFp4: Reduce code size by 26 bytes by only aligning the jump targets that
are at the top of loops.
2003-03-12 06:46:16 +00:00
Tim J. Robbins
34d4e9132c MFp4: Pentium/Athlon-optimised implementation of wmemchr(). 2003-03-12 03:55:01 +00:00
Tim J. Robbins
00d7d210f5 MFp4: Pentium-optimised implementation of wcscmp(). Performs significantly
better than the code generated by gcc in many cases.
2003-03-10 10:54:36 +00:00
Daniel Eischen
cd7be69206 Remove these from libc; they are now system calls.
Prompted by:	mini
2003-02-18 12:31:57 +00:00
Jonathan Mini
2129373618 Call the weak symbol for sigprocmask, so that it can be overridden. 2003-02-17 07:47:13 +00:00
Jacques Vidrine
e0554a531f Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).
Only warnings that could be fixed without changing the generated object
code and without restructuring the source code have been handled.

Reviewed by:	/sbin/md5
2003-02-16 17:29:11 +00:00
Mike Barcroft
5d62092f94 o Implement C99 classification macros isfinite(), isinf(), isnan(),
isnormal().  The current isinf() and isnan() are perserved for
  binary compatibility with 5.0, but new programs will use the macros.
o Implement C99 comparison macros isgreater(), isgreaterequal(),
  isless(), islessequal(), islessgreater(), isunordered().

Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
2003-02-12 20:03:41 +00:00
Mike Barcroft
8cf5ed5125 Implement fpclassify():
o Add a MD header private to libc called _fpmath.h; this header
  contains bitfield layouts of MD floating-point types.
o Add a MI header private to libc called fpmath.h; this header
  contains bitfield layouts of MI floating-point types.
o Add private libc variables to lib/libc/$arch/gen/infinity.c for
  storing NaN values.
o Add __double_t and __float_t to <machine/_types.h>, and provide
  double_t and float_t typedefs in <math.h>.
o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF,
  HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to
  <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via
  <machine/float.h>.
o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based
  on the size of its argument.  __fpclassifyl() is never called on
  alpha because (sizeof(long double) == sizeof(double)), which is good
  since __fpclassifyl() can't deal with such a small `long double'.

This was developed by David Schultz and myself with input from bde and
fenner.

PR:		23103
Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
		(significant portions)
Reviewed by:	bde, fenner (earlier versions)
2003-02-08 20:37:55 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Jens Schweikhardt
57bd0fc6e8 english(4) police. 2002-12-27 12:15:40 +00:00
Alexander Kabaev
e34402d357 Back out the -fpcc-struct-return fixes.
Approved by:	re (rwatson)
2002-12-22 06:41:09 +00:00
Tim J. Robbins
2226ce021a Import newer versions of div() and ldiv() from NetBSD which handle
the -fpcc-struct-return calling convention properly instead of
returning garbage. This may break backwards compatibility with some old
binaries that were compiled when -fno-pcc-struct-return was the default.
2002-12-21 05:11:39 +00:00