Commit Graph

413 Commits

Author SHA1 Message Date
christos 43d6f49e0a Add missing math.h include
Fix RCSID's
1997-07-13 18:43:18 +00:00
christos faa85c1edf Add missing math.h include.
Fix RCSID's
1997-07-13 18:42:55 +00:00
christos 24329bd304 Add missing math.h include
Fix RCSID's
1997-07-13 18:42:29 +00:00
christos f6ff6c08f8 Fix RCSID's
Add missing math.h include
1997-07-13 18:41:38 +00:00
christos 89ce8a631d Add missing math.h include
Fix RCSID's
1997-07-13 18:40:38 +00:00
christos b3bd98a5e6 Fix RCSID's
Add missing math.h include
1997-07-13 18:39:54 +00:00
christos 35abd9e88d Add missing math.h include
Fix RCSIDs
1997-07-13 18:38:28 +00:00
christos 35a5d59f7d Fix RCSID's
Add missing math.h include
1997-07-13 18:37:30 +00:00
christos 42a71b4d7b Add missing stdlib.h include 1997-07-13 18:35:25 +00:00
jonathan a70f22abe7 Back out previous revision, which is reported to break signal-handing
in the GNU awk in our tree.
Leave the change in but commented out, it may be a  ld.so problem.
1997-07-07 00:13:56 +00:00
jtc 3c3a4cdfbb Simplify how division and remainder assembly source is generated
from divrem.m4.
1997-06-21 01:42:48 +00:00
jonathan b838c4c768 Add .set noreorder/.set reorder around .cpload 1997-06-18 22:23:13 +00:00
jonathan 20a862c6ad #include <machine/machAsmDefs.h> -> #include <mips/asm.h> 1997-06-17 16:35:26 +00:00
jtc 5f28317441 Use xorl/movb instead of movzbl when loading registers before computing
the return value.
1997-05-19 23:55:00 +00:00
jtc f486d77a92 I removed the extra instructions which compute the return value in Hiroshi
Horitomo's implementation a bit too hastily.  They are required to handle
the unsigned comparison required by the standard.
1997-05-18 21:24:46 +00:00
jtc 530ba70aa3 New implementations of strcmp() and strncmp().
This code uses subb instead of cmpb to compare chars.  When they are
not equal, the function's return value is computed by sign extending
the difference.  The basic idea was contributed by Hiroshi Horitomo
<horimoto@cs-aoi.cs.sist.ac.jp> in PR #3223, but his implementation
used additional instructions to compute the return value.

Also, the series of insns used to compare one pair of characters has
been unrolled 4 times.  This helps the 680[23]0, where the cost of a
taken branch is significantly more than that of a not-taken branch.
1997-05-18 20:32:20 +00:00
jtc 8da7150a8a Fix typo 1997-05-15 16:17:20 +00:00
jtc 042efd19d5 Fixup reverse bcopy 1997-05-15 16:07:31 +00:00
jtc ca7515b48a oops, bzero -> memset 1997-05-14 18:18:44 +00:00
jtc 6391090ebf Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}. 1997-05-13 19:27:21 +00:00
jtc d46e665a16 Faster versions of bcmp(), bcopy(), bzero(), and memset().
The implementation of these functions is losely based on the original
BSD code plus versions I was working on which would yeild code tuned
for a particular m68k or coldfire family cpu, code space or run time
efficiency, etc. depending on the values of various macros.

My original code was intended for use in OS-less embedded systems.
Because NetBSD can not benefit from the considerable complexity, I've
removed the extraneous preprocessor goop.  The resulting code is tuned
for the '020 - '060.  It will not function on the '000 or coldfire.
1997-05-13 19:20:58 +00:00
matthias b153a75c32 * Add correct $NetBSD$ headers everywhere.
* Remove $Id$ headers.
* Support LIB_SCCS in all files.
* Use local labels where ever possible.
* Use cpufunc.h instead of __asm__ when possible.
* Access labels with _C_LABEL and _ASM_LABEL.
* Always set errno by calling cerror.
* No more FRAME/EMARF.
* No more SVC, use SYSTRAP instead.
* Use "$Masqueraded: as XXX $" to show e.g. memcpy compiled as bcopy.
* Rewrite vfork to work even whith a "real" vfork system call.
* Make cerror take care of _REENTRANT.
1997-05-08 13:38:29 +00:00
kleink 7448a697b2 Fix typo in last commit. 1997-05-04 06:40:57 +00:00
kleink 2913a7a8a4 Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR(). 1997-05-02 18:15:15 +00:00
thorpej 1f92a78982 DEFS.h is gone from here, don't copy it up to libkern. (It will be gone
from libkern soon, as well)
1997-04-25 01:04:15 +00:00
thorpej d0fed6c87d Use <machine/asm.h> 1997-04-25 00:58:41 +00:00
thorpej aa6103a33e Garbage-collect unneeded file. 1997-04-24 23:50:27 +00:00
thorpej 5ef4bdf6cf Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
1997-03-29 20:55:50 +00:00
jonathan afe4640090 Remove lint (missing END() directive) in NOERROR syscalls. 1997-03-15 08:52:16 +00:00
thorpej 952eb61ea3 Define immediate values properly for the __STDC__ preprocessor case,
from Hiroshi HORIMOTO <horimoto@cs-aoi.cs.sist.ac.jp>, PR #3222.
1997-03-08 06:32:08 +00:00
ragge 7e8687db1b ENTRY() takes two argument now, not one. 1997-02-04 18:38:21 +00:00
ragge 2663970272 ENTRY() takes two argument now, not one. 1997-02-04 18:38:17 +00:00
jtc f42ebd4897 #include <machine/asm.h> instead of "DEFS.h" 1997-01-04 03:26:18 +00:00
jtc 48030a80ae Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit.  This happens to be all occurances in this case, so I could have
used bCCs.  However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases.  I did the same to be
consistant.
1997-01-04 03:21:11 +00:00
jtc 4990f8b035 Add L prefix on local labels 1997-01-03 22:57:04 +00:00
cgd 4a6fd887f0 File which provides lint stubs for the functions defined by
machine-dependent assembly code, whose source files live in its directory.
(Not necessarily complete yet.)
1996-12-22 11:44:55 +00:00
cgd 4f47d0104d dd a bunch of files to LSRCS, which provide lint stubs for the functions
defined by machine-dependent assembly code.
1996-12-22 11:41:01 +00:00
cgd f4b5c163ef __asm rather than asm, for lint 1996-12-20 20:35:48 +00:00
jtc 11935403ef PROF -> GPROF 1996-11-30 02:31:49 +00:00
jtc 37b491a006 Add L prefix to local labels 1996-11-30 02:01:26 +00:00
jtc 0dfdcfdfde Fix typo 1996-11-19 03:15:51 +00:00
pk 3b4eca1f48 Remove reference to DEFS.h 1996-11-18 22:37:28 +00:00
pk 5ba1566c5c The code in here was just an expansion of RSYSCALL(syscall). 1996-11-18 22:35:53 +00:00
mrg 368d2cb79c update for removed DEFS.h. 1996-11-18 16:08:30 +00:00
pk 76dfffe335 Remove DEFS.h, which has been just a placeholder for a long time. 1996-11-16 20:53:13 +00:00
pk 63c8772a52 Do the `_REENTRANT' song-and-dance. 1996-11-16 20:43:07 +00:00
jtc f6f38dd61e Changed the test that determines whether or not source and destination
memory regions are "potentially overlapping" to a test that determines
that the regions are actually overlapping.  Because the code for the
overlapping case is seven instructions longer, this signifcantly
improves performance in the average case.
1996-11-12 00:50:06 +00:00
mycroft c9ec05f4b2 Treat reboot() like a normal system call. From PR 2458. 1996-11-11 13:41:08 +00:00
pk 1efc8c37b2 Flesh out the `noerror' syscall macros. 1996-11-09 19:11:17 +00:00
cgd 1ae38b6471 if _REENTRANT is defined, store the error value in (*__errno()), rather than
in errno directly, to support threads packages.
1996-11-08 00:52:46 +00:00
cgd c30a5d9842 kill "IMPORT(errno, 4)" since it is unnecessary 1996-11-08 00:51:24 +00:00
matthias 0e85514579 * Provide an ovbcopy as an alternate entrypoint for bcopy when _KERNEL is
defined.
1996-11-07 07:43:02 +00:00
matthias c6f98022c7 * Use SYSCALL_NOERROR to define SYSCALL. 1996-11-07 07:42:38 +00:00
matthias 3aa582ed1f * Delete DEFS.h from KMINCLUDES.
* Add bcopy.S, memcpy.S and memset.S to KMSRCS.
1996-11-07 07:42:29 +00:00
matthias 42f541d107 * This is no longer used. 1996-11-07 07:42:21 +00:00
jtc cbae3f00b8 Change __REENTRANT to _REENTRANT, the latter is used Solaris and I can
think of no good reason to be different.
1996-11-07 05:20:33 +00:00
jtc f1af62ef3d Changed so that when __REENTRANT is defined, cerror calls __errno()
for the address of a variable used to store the error number instead
of writing to the global errno.

In a multi-threaded program, __errno() will return a pointer to a
thread-specific variable.
1996-11-07 05:16:41 +00:00
jtc 99db2fd388 fix typo 1996-10-24 13:00:32 +00:00
jonathan a68c573b21 Rewrite from scratch. 1996-10-19 12:32:04 +00:00
jtc 41da409893 Added new macros:
SYSCALL_NOERROR(x):     Like SYSCALL except that "x" is a syscall
				that can never fail.

        RSYSCALL_NOERROR(x):    Like RSYSCALL except that "x" is a syscall
				that can never fail.

These macros simply call SYSCALL / RSYSCALL, and serve as placeholders
until an optimized implementation is done.
1996-10-19 00:25:22 +00:00
jtc 41056da8a0 Include <machine/asm.h> instead of defining our own ENTRY() macro
Changed all instances of ENTRY() to match the new calling convention
(it takes a second argument ).

Added new macros:
	SYSTRAP(x):		Expands to the code used to call syscall x.
				This is used to simplify other macros.

	SYSCALL_NOERROR(x):	Like SYSCALL except that "x" is a syscall
				that can never fail.

	RSYSCALL_NOERROR(x):	Like RSYSCALL except that "x" is a syscall
				that can never fail.
1996-10-18 19:37:48 +00:00
jtc b095d96598 Added new macros:
SYSTRAP(x):             Expands to the code used to call syscall x.
				This is used to simplify other macros.

        SYSCALL_NOERROR(x):     Like SYSCALL except that "x" is a syscall
				that can never fail.

        RSYSCALL_NOERROR(x):    Like RSYSCALL except that "x" is a syscall
				that can never fail.
1996-10-18 00:49:03 +00:00
jtc 7228c89e17 Added new macros:
SYSTRAP(x):             Expands to the code used to call syscall x.
				This is used to simplify other macros.

        SYSCALL_NOERROR(x):     Like SYSCALL except that "x" is a syscall
				that can never fail.

        RSYSCALL_NOERROR(x):    Like RSYSCALL except that "x" is a syscall
				that can never fail.
1996-10-17 22:47:14 +00:00
jtc 9d7f517756 Added new macros:
SYSTRAP(x):             Expands to the code used to call syscall x.
				This is used to simplify other macros.

        SYSCALL_NOERROR(x):     Like SYSCALL except that "x" is a syscall
				that can never fail.

        RSYSCALL_NOERROR(x):    Like RSYSCALL except that "x" is a syscall
				that can never fail.
1996-10-17 18:14:56 +00:00
cgd 55c6bc901c catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
1996-10-17 03:08:03 +00:00
cgd 7b8ed4c70b update for new <machine/asm.h> and generally clean up:
rename SYSCALL_NOLABEL as CALLSYS_ERROR (for consistency with CALLSYS_NOERROR
    now in asm.h), and implement it using CALLSYS_NOERROR.
reimplement SYSCALL, RSYSCALL, and PSEUDO to use the appropriate macros.
implement SYSCALL_NOERROR and RSYSCALL_NOERROR to do the same thing as
    SYSCALL and RSYSCALL, but without the error checking/handling.
1996-10-17 03:03:53 +00:00
cgd a2863e2f30 copy neither DEFS.h (it no longer exists) nor SYS.h (it's never been
necessary in libkern) to libkern any longer.
1996-10-17 02:58:18 +00:00
cgd 347f3d6114 kill this. Just include <machine/asm.h> directly 1996-10-17 02:57:08 +00:00
jonathan 5965973b0f Add missing "t9, " to "la" insn in error-return case. 1996-10-16 06:21:10 +00:00
matthias b92278aef8 The pc532 port now has string functions in assembler.
strcmp.S, strcpy.S and strlen.S are contributed by Randy Hyde.
1996-09-24 09:29:52 +00:00
matthias 9ea65c1c28 Changed KMSRCS to reflect new reality (Stringfunctions in assembler). 1996-09-24 09:18:29 +00:00
cgd 731ac8686e set the GP before accessing errno. 1996-09-17 21:16:12 +00:00
jonathan 9f3b05068c * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
1996-09-17 01:32:22 +00:00
jonathan 81b108b45f Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to  "NetBSD:".
1996-09-16 18:10:35 +00:00
cgd a5adf9b9ba reload GP _before_ error check+branch 1996-09-15 18:18:26 +00:00
mark 7332aa83f6 These files contains stub functions that just called abort() are no
longer needed now we have working assembly versions.
1996-09-09 22:06:25 +00:00
mark 10756ef086 Use the new assembly files for fpgetmask(), fpsetmask(), fpgetsticky()
and fpsetsticky().
1996-09-09 22:03:24 +00:00
mark 7f53925054 Initial commit of working versions of the functions for manipulating
the floating point cumulative exception flags and exception enable masks.
These functions replace the dummy C functions that just called abort().
1996-09-09 22:00:39 +00:00
cgd 8df506ad69 user better names for local labels, as suggested by Matt Thomas and
slightly tweaked.
1996-09-09 00:57:59 +00:00
cgd 86a813e847 remove unused local label 1996-09-09 00:51:27 +00:00
mark d5df3db65b Make this with whether __STDC__ is defined or not. 1996-08-07 17:39:44 +00:00
mark 4e058e1f10 Make sure errno is always zeroed before the syscall.
Don't trash r0 on exit.
1996-08-07 17:38:16 +00:00
cgd 60bbd380f2 pull up bug fix from libkern:
>frob the mask so that only the low set bit is set, to avoid lossage.
1996-07-15 05:21:09 +00:00
cgd 2f6bb217b1 add an assembly version of ffs(). 1996-07-15 03:13:15 +00:00
jtc 16e8217f5a new implementation that simply clears most significant bit 1996-06-26 15:05:40 +00:00
jtc 290756c01b use fscalel instead of ftwotoxl/fmulx 1996-06-26 15:04:06 +00:00
mark 29811afbb6 Set r1 to -1 on exit as well as r0 otherwise syscalls returning 64 bit
results will not read -1.
1996-06-05 19:02:12 +00:00
jtc 57ceb7a883 Added ashldi3.S, ashrdi3.S, and lshrdi3.S to KMSRCS 1996-06-01 01:08:02 +00:00
jtc ff3bd4df33 m68k assembly versions of 64 bit shift functions 1996-05-31 02:05:33 +00:00
ragge 92a955a864 VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch. 1996-05-19 15:57:37 +00:00
mark 46d95534b3 Updated register usage. 1996-05-12 20:52:09 +00:00
mark 62a60eda3b Updated to use definitions from machine/ieee.h 1996-05-12 20:50:54 +00:00
mark 93d4dfdfd8 Added NetBSD copyright. 1996-05-12 20:43:54 +00:00
mark ea5751f59e No longer required. The libc fabs() functions is in fabs.c. 1996-05-12 20:36:27 +00:00
mark e1c23a9306 Added new filenames. 1996-05-12 20:34:15 +00:00
mark 0814ca4b65 Initial commit of the floating point related libc functions. 1996-05-12 20:29:09 +00:00
mark ba9c4033a1 RCS Id police. 1996-05-12 20:25:39 +00:00
mark cd795b6adf Removed files from KMINCLUDES and KMSRCS. 1996-05-12 20:06:52 +00:00
mark 341c543ad0 RCS Id police. 1996-05-12 19:55:00 +00:00
mark ec673d5430 Fixed a couple of filenames. 1996-04-26 20:15:14 +00:00
cgd 734132ad28 have copy-to-libkern copy strcat.S, not strcat.c 1996-04-18 01:54:16 +00:00
cgd 44e8033a96 add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
1996-04-17 22:36:30 +00:00
phil 07df601bbf Add missing ~. (PR 2311) 1996-04-09 16:33:32 +00:00
phil bf6acfece8 Addition of fp routines. (PR 2281 from Matthias Pfaller.) 1996-04-05 00:23:05 +00:00
phil 3fac82adb2 Change the definition of __infinity on the ns32k. (PR 2283) 1996-04-04 23:45:18 +00:00
pk 7e18fd4e93 Avoid load/store doubles; jmp_buf is long aligned (Michael Eriksson; PR#2180) 1996-03-06 21:50:20 +00:00
mark 5284578745 Initial commit of the arm32 architecture dependant libc code. 1996-02-16 20:47:54 +00:00
jtc daa40d9a50 Add explicit return type 1996-02-05 04:30:51 +00:00
ragge 0aa318cd7e Changed to only include <machine/asm.h>, as the other ports. 1996-01-06 18:34:59 +00:00
jtc 723b71b52c removed :errfix; const qualifier makes it unnecessary 1995-12-28 22:37:55 +00:00
jtc 43d7567da3 Removed unused CALL macro 1995-12-28 22:35:54 +00:00
jtc 051ae6c48a Remove #include "SYS.h"; it is not needed (by normal assembly functions) 1995-12-28 21:32:25 +00:00
jtc 3f78e35cca Use <machine/asm.h> instead of DEFS.h 1995-12-28 20:03:51 +00:00
jtc 24a6d94c0d Added macros definitions for use with ANSI preprocessors. 1995-12-28 19:44:11 +00:00
jonathan 3fa4ff4647 Change mips assembly code for {,_,sig}setjmp.S to get register names
from <machine/regnum.h>, not <machine/reg.h> (which also defines structs.)
1995-12-22 10:20:51 +00:00
jonathan dd0a20c5ae Add sigsetjmp.S for mips, and add it to the makefile. 1995-12-15 01:12:36 +00:00
thorpej 915f0a8f9b New-style RCS ids. 1995-12-13 22:21:23 +00:00
thorpej 6cdbd4c23a New-style RCS ids. Use the RCSID() macro where appropriate. 1995-12-13 22:17:46 +00:00
thorpej 9573504567 New-style RCS ids. Use the RCSID() macro where appropriate. 1995-12-13 21:46:13 +00:00
thorpej 9f1ee9ae9c New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
1995-12-13 19:35:39 +00:00
ragge e85a7da39b Add defs to understand K&R cpp. 1995-12-12 15:21:31 +00:00
ragge 4529cdf035 Can't be sure cpp can handle x ## y. 1995-12-09 13:28:38 +00:00
ragge 34323ef19c sigsetjmp/siglongjmp was missing. Code fix by Arne H. Juul. 1995-12-09 13:26:43 +00:00
ragge c6813ecb89 Didn't take care of errors when return parameter was long long.
Bug pointed out by Arne Henrik Juul.
1995-12-04 21:52:44 +00:00
thorpej ed63b163c8 Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place.  "Hello, McFly!"
1995-11-28 23:40:47 +00:00
thorpej ced1925e35 Fix a typo. 1995-11-28 22:50:18 +00:00
thorpej bebc2d5787 New style RCS ids, and employ the RCSID() macro. 1995-11-17 20:21:10 +00:00
jtc 4def0687f4 fix stupid typo 1995-11-17 19:32:26 +00:00
cgd 5b14175ea1 be more conservative when setting the gp 1995-11-04 00:23:04 +00:00
jtc a0ed1b8ba8 Assembly language implementation of strcat(). Derived by merging existing
strlen() and strcpy() functions.
1995-10-21 20:24:48 +00:00
jtc 8a5e159d9f Rewrite to remove instruction in inside of loop. Instead of maintaining a
count, subtract the start address from the end address.
1995-10-21 20:21:15 +00:00
cgd 7a8e7b22a1 deal properly (i hope!) with registers' upper 32 bits, when doing
32-bit division and remainder.  Sometimes, when optimizing, they could
have been different than previously expected (and could have caused
hokey results).
1995-09-30 03:09:07 +00:00
cgd 2940a41ce2 kill some now-bogus XXX's 1995-09-30 02:14:17 +00:00
jonathan 509475b244 Copy the input argument to $f0 so we handle negative inputs properly
in the tail.

Doesn't yet handle +/- inf as cleanly as other implementations.
1995-09-29 21:59:45 +00:00
cgd 473d5f491e return dest string pointer, not source string pointer! 1995-09-26 03:37:10 +00:00
jonathan 945bd69ebd The old mips modf didn't work (pr 1048). This replaces it with
a version that does work on little-endian MIPS CPUs. Not tested on
big-endian MIPS; the "li.d" may be byteorder-dependent.
1995-09-25 19:28:27 +00:00
jonathan 946af1bccf Fix an old bug, whereby ASMSTR() was used before #including "SYS.h", where
it was defined.
1995-09-25 19:21:41 +00:00
phil d995fcfdb1 correction from Matthias Pfaller. 1995-09-20 22:34:03 +00:00
pk c060b81fb7 Make PIC-safe. 1995-08-14 15:47:32 +00:00
cgd e7b36fb1b4 fast(!) bzero(), by Trevor Blackwell. 1995-08-14 04:09:23 +00:00
cgd adca5aa4fc save & restore the argument registers, too. from Trevor Blackwell 1995-08-14 02:20:07 +00:00
cgd c37c5ab530 Alpha assembly language bcopy(), written by Trevor Blackwell
<tlb@eecs.harvard.edu>.  I added support for using it as memcpy()
and memmove(), by compiling with the appropriate options.
1995-08-13 00:42:27 +00:00
cgd 2fe62c130b stubs to define things, and include the bcopy source 1995-08-13 00:40:47 +00:00
cgd a4c632dfff bcopy is now a .S, add memcpy.S and memmove.S 1995-08-13 00:35:53 +00:00
jtc ba9dbab5b4 remove single quote from comment 1995-06-29 20:42:22 +00:00
jonathan c93ec6801c *** empty log message *** 1995-06-28 02:18:21 +00:00
pk 02cf7515b7 Make PIC safe. 1995-06-20 22:45:46 +00:00
ragge 1f67145235 Converted K&R -> ansi. 1995-06-01 01:11:41 +00:00
briggs b1f67e2969 m68k sig{set,long}jmp from Henric Jungheim (uhenric@mcl.ucsb.edu) as
followup to GNATS report port-amiga/1009.
Passes regression tests.
I added a NetBSD string and changed jbra to jra.
1995-05-03 03:43:05 +00:00
phil e4748bf0ca typo: fld_... -> flt_... 1995-05-03 03:25:11 +00:00