Commit Graph

77 Commits

Author SHA1 Message Date
Ed Schouten
46632c18bd Merge index() and strchr() together.
As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.

Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.

Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().

This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.
2012-01-03 07:14:01 +00:00
David Schultz
6232589aeb Replace a proliferation of buggy MD implementations of modf() with a
working MI one.  The MI one only needs to be overridden on machines
with non-IEEE754 arithmetic.  (The last supported one was the VAX.)
It can also be overridden if someone comes up with a faster one that
actually passes the regression tests -- but this is harder than it sounds.
2011-10-21 06:40:36 +00:00
Ed Schouten
3a28b8a49f Fix whitespace inconsistencies found in homegrown Symbol.maps. 2011-10-07 15:05:24 +00:00
Jayachandran C.
ba8d74d95f Fix bzero() for 64-bit.
The existing implementation of bzero incorrectly clears bytes when the
start address is not word aligned. Fix it by using REG_SHI macro which
works on both 32 and 64 bit.

Submitted by:	Artem Belevich (fbsdlist at src cx)
2011-02-22 07:49:51 +00:00
Rebecca Cran
6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Jayachandran C.
5bf52f1fb5 Fix PIC_RETURN when abicalls are not defined.
Submitted by:	Artem Belevich (artemb at gmail dot com)
2010-10-24 05:22:07 +00:00
Jayachandran C.
60ddfa2837 use PTR_WORD for __curbrk and minbrk instead of .word, the new version
wil support all ABIs.

Approved by:	rrs (mentor)
2010-06-25 05:36:36 +00:00
Jayachandran C.
9279d32a64 Merge jmallett@'s n64 work into HEAD - changeset 2
Update libc Makefiles.
Add makecontext implementation.

Changes from http://svn.freebsd.org/base/user/jmallett/octeon

Approved by:	rrs(mentor), jmallett
2010-06-16 14:13:36 +00:00
Jayachandran C.
a7c139c0af Merge jmallett@'s n64 work into HEAD - changeset 1.
Update libc assembly code to use macros that work on both o32 and n64.
Merge string functions from NetBSD.

The changes are from http://svn.freebsd.org/base/user/jmallett/octeon

Approved by:	rrs (mentor), jmallett
2010-06-16 12:55:14 +00:00
Neel Natu
2f9f616df9 Reinstate the ptrace patch to restore the 'gp' register after calling
a function. I made a mistake in assuming that the .cprestore directive
will cause the assembler to automatically restore 'gp' after the 'jalr'.

The .cprestore directive does its magic only after 'jal' and 'bal'
instructions - not the 'jalr'.

Pointed out by: c.jayachandran@gmail.com
2010-02-04 05:49:59 +00:00
Randall Stewart
1df3671344 -White space cleanup (missing spaces in new line)
-Remove extra tab.
-Took out the duplicate code that cprestore does.
All suggested by Neel.
2010-02-03 20:54:04 +00:00
Randall Stewart
1de48bf3a3 This fixes a bug found and fixed by JC. Basically
no save was being done of the ra and gp pointers
before we call the __error function.

Obtained from:	JC (c.jayachandran@gmail.com)
2010-02-03 12:59:44 +00:00
Warner Losh
52e0ea7a0d Merge r195030 from project/mips to head by hand
r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 lines
- Switch to libc softfloat from libgcc implementation. The problem
    with latter is that it is not complete, fpsetXXX/fpgetXXX
    functions are missing.
2010-01-09 00:01:35 +00:00
Warner Losh
87e925fb53 Merge r197800 from projects/mips to head by hand:
r197800 | gonzo | 2009-10-06 00:35:52 -0600 (Tue, 06 Oct 2009) | 3 lines
- curbrk variable for sbrk and brk should be the same
- Add correct variable names to Symbol.map
2010-01-08 23:59:04 +00:00
Warner Losh
9cd8780a69 Merge r195025 from projects/mips to head by hand:
r195025 | gonzo | 2009-06-25 19:01:50 -0600 (Thu, 25 Jun 2009) | 4 lines
- Move fpgetXXX.c/fpsetXXX.c sources to hardfloat subdir/
    to prevenmt them from being mixed up with lib/libc/softfloat
    files with the same names
2010-01-08 23:50:39 +00:00
Ed Schouten
dc428c2ffe Remove unneeded stdlib directories.
It's not necessary to add stdlib directories for each architecture, even
if the architecture doesn't implement any files of its own.

Submitted by:	Christoph Mallon
2009-06-23 14:11:41 +00:00
Warner Losh
21fc9f2bcc These warnings are only relevant on NetBSD it seems. They don't seem
to be relevant to FreeBSD at all.
2009-02-19 19:53:58 +00:00
Warner Losh
51cbd5d9d7 These symbols don't belong here. Remove them. Since mips hasn't had
a release, I think there's no impact here...

Reviewed by:	cognet@
2009-02-19 18:03:41 +00:00
Ed Schouten
a1b5a8955e Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.
Looking at our source code history, it seems the uname(),
getdomainname() and setdomainname() system calls got deprecated
somewhere after FreeBSD 1.1, but they have never been phased out
properly. Because we don't have a COMPAT_FREEBSD1, just use
COMPAT_FREEBSD4.

Also fix the Linuxolator to build without the setdomainname() routine by
just making it call userland_sysctl on kern.domainname. Also replace the
setdomainname()'s implementation to use this approach, because we're
duplicating code with sysctl_domainname().

I wasn't able to keep these three routines working in our
COMPAT_FREEBSD32, because that would require yet another keyword for
syscalls.master (COMPAT4+NOPROTO). Because this routine is probably
unused already, this won't be a problem in practice. If it turns out to
be a problem, we'll just restore this functionality.

Reviewed by:	rdivacky, kib
2008-11-09 10:45:13 +00:00
Warner Losh
4ce261061f Add mips support libc from the mips2-jnpr branch of perforce. 2008-04-26 12:08:02 +00:00
Warner Losh
abe458f391 Doh! Extra mips in the path. Remove these and wait until tomorrow
when I have more brain cells to try again.
2008-04-16 05:11:25 +00:00
Warner Losh
6afe466807 Turns out the machine/asm.h isn't needed here, since SYS.h already
included it.
2008-04-16 05:08:27 +00:00
Warner Losh
69e1fc6e80 FreeBSD/mips libc support. Merged from perforce mips2-jnpr branch. 2008-04-16 05:06:11 +00:00
David E. O'Brien
d9c0a739c5 Remove these abortive MIPS bits. 2002-03-23 17:55:32 +00:00
David E. O'Brien
1114a754ed 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
David E. O'Brien
333fc21e3c 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
Warner Losh
d7ee48f115 Bring in initial libc support for mips. These files were taken from
the OpenBSD tree and should be considered preliminary.  They are here
to facilitate building of the tree.
1999-03-03 07:06:17 +00:00