Commit Graph

50 Commits

Author SHA1 Message Date
ragge
bc830a1980 Do not use the builtins for the mem* functions on vax, the compiler gets
confused with the static inline functions vax uses.
2003-08-13 11:34:24 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
itojun
99c5869d56 add strl{cpy,cat} to libkern. code from lib/libc/string (originally from openbsd). 2003-05-15 13:50:35 +00:00
christos
07dca24022 make offsetof lint friendlier. 2002-10-24 20:53:50 +00:00
tls
0f95ec4fd5 ESP output was drawing down the entropy pool at a ferocious rate, a
particular problem on hosts with only wireless interfaces that are
definitely not safe to use as entropy sources.

Add arc4randbytes() which hands out bytes from the same source used
by arc4random().  This is intended to be a _temporary_ interface
until we can design and implement a better general PRNG interface
that is decoupled from the entropy-pool implementation.

Modify key_randomfill() (used only for initialization vectors on
SA creation and via key_sa_stir_iv(), which does not "stir",
despite its name) to use arc4randbytes() instead of pulling bits
directly from the entropy pool.  It is my hope that this change
will pose minimal integration problems for the KAME folks as the
random-pool interface is *already* different between each BSD
variant; this just simplifies the NetBSD case and solves a
fairly serious problem.

Note that it is generally considered acceptable cryptographic
practice to use a fast stream cipher to generate IVs for encryption
with stronger block ciphers.  For example, the use of "non-Approved"
PRNGs to generate IVs for "Approved" block ciphers is explicitly
sanctioned by FIPS 140-2.
2002-10-06 08:51:44 +00:00
junyoung
26737526db Add strstr() to libkern. For now, it's only used in i386 (for processor
identification).
2002-10-04 18:39:52 +00:00
matt
44bc4ef4a9 Ansify's (use prototypes). 2002-10-04 00:50:15 +00:00
thorpej
181f0a9b54 Tweak the previous change so that a prototype is always provided. 2002-08-25 21:09:45 +00:00
ragge
3f5fba68de Do not try to use "__builtin_ffs" on vax, ffs is an instruction already.
Maybe possible to teach gcc to use it?
2002-08-23 08:45:27 +00:00
thorpej
c0d823519c GCC 2.95 supports __builtin_ffs(); use it. 2002-08-21 01:27:58 +00:00
itojun
0ac289dea9 have arc4random(9). 2002-05-28 10:09:24 +00:00
thorpej
23ed6be403 Always provide alloca() as __builtin_alloca(). 2001-12-28 07:37:06 +00:00
thorpej
5ed948ecea The kernel is now built with -ffreestanding, so GCC built-ins are
disabled.  Explicitly re-enable some that we want to use, namely:

* memcpy() -> __builtin_memcpy()
* memcmp() -> __builtin_memcmp()
* memset() -> __builtin_memset()

* strcpy() -> __builtin_strcpy()
* strcmp() -> __builtin_strcmp()
* strlen() -> __builtin_strlen()

We might also consider some others for GCC 3.x.
2001-12-23 22:48:29 +00:00
perry
5624bbb1d4 restore bzero and bcmp prototypes for now -- this has to be hashed out. 2001-07-07 17:22:25 +00:00
simonb
5439e1a9ff Put the prototypes for bcmp() and bzero() back (ifdef _STANDALONE) so that
libsa builds again.
2001-07-07 12:23:43 +00:00
perry
7ab9c62227 Remove bcmp and bzero prototypes. And yes, I actually checked and
tested this time. (Slap self repeatedly.)
2001-07-07 05:42:16 +00:00
lukem
85772a1cef remove some lint 2001-04-30 02:34:58 +00:00
thorpej
554aa34ee7 Add ctype routines. 2001-04-05 04:38:06 +00:00
thorpej
1cfe0850f5 Add a strcasecmp(), modified from chopps's strncasecmp(). 2000-11-01 19:37:18 +00:00
msaitoh
0a5e7f9f3f enclose offsetof macro definition with #ifndef offsetof ... #endif 2000-10-12 03:42:33 +00:00
thorpej
707b3d59b1 __predict_true() the expressions passed to the assert family, so
as to move the calls to __assert() out-of-line.

Suggested by Bill Sommerfeld.
2000-05-08 23:33:15 +00:00
simonb
5ab3ed0c39 Multiple include protection. 2000-03-29 03:07:52 +00:00
simonb
9c807e7a3c Move strtoul.c (via CVS repo copy) to libkern. Also sort prototypes
in libkern.h and sources in arm32/Makefile.inc alphabetically.
1999-11-29 23:12:56 +00:00
tron
2d8e6b7e97 Add prototype for memcmp() as suggested by Anders Hjalmarsson in
PR kern/8360.
1999-09-10 14:05:40 +00:00
drochner
e6b49c7863 move intoa() from libsa:net.c to libkern, turn inet_ntoa() into a macro,
nuke ip_convertaddr()
1999-05-07 14:49:52 +00:00
drochner
b6ab6f5dc1 This was an n_long, not u_long, so u_int32_t is correct. 1999-04-12 17:23:23 +00:00
ross
4634c0e3d4 libkern just got an inet_addr(), but it won't compile, no prototype. Cleanup...
* Add prototype to libkern.h.
* Remove the almost-identical-copy from libsa/net.[ch].
* Change its type back to the (wrong, but harmless) historical one. (u_long)
* Kill the XXX local prototype in nfs_bootparam.c
1999-04-12 01:05:01 +00:00
perry
2b8a659f68 make libkern build memmove() properly 1998-07-31 23:44:41 +00:00
christos
16a9632e4d Add a small string pattern matching function to facilitate pcmcia cis string
matches.
1998-06-21 18:43:35 +00:00
fvdl
e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
mycroft
8ad4f24f50 Add memcpy() and memset(), and sort. 1998-02-22 09:18:38 +00:00
thorpej
529b95c8d9 Add offsetof(). 1998-01-28 02:22:14 +00:00
drochner
7e5c045bb6 remove prototypes for deprecated index() and rindex() 1998-01-23 12:56:39 +00:00
drochner
8968860bab add prototype for index() 1998-01-22 15:42:24 +00:00
cgd
0bc1621f94 add strrchr 1998-01-21 21:16:52 +00:00
mjacob
23a59f497a Add missing NULL define for KERNEL case and prototype into libkern.h. 1997-10-24 18:10:30 +00:00
cgd
6ac982f2a0 mark prototypes for static inline functions as possibly unused (with
__attribute__ ((unused))), to avoid generating warnings when compiling
without optimization but with most ports' default warning flags.
1997-07-07 22:45:34 +00:00
drochner
aab2edd1d4 Add prototype for bzero() (since it is implemented here). 1997-06-13 14:27:04 +00:00
cgd
d867ed50cc add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
1997-01-18 02:33:38 +00:00
cgd
bba547e063 second and third args to scanc() (string and table) are not and should not
be modified.  Make them 'const'.
1996-10-24 23:50:31 +00:00
cgd
788923c1ab add a missing #else, pointed out by Wolfgang Solfrank 1996-09-22 16:23:31 +00:00
cgd
bdbfa48c0b Add machine-independent assertion-checking support. macros are:
assert()	which always does assertion checking
			unless "NDEBUG" is defined.

	KASSERT()	which does assertion checking if DIAGNOSTIC
			is defined.

	KDASSERT()	which does assertion checking if DEBUG is
			define.  This macro exists for compatibility
			with existing ports' assertion checking macros.
			(Assertion checking is not typically an
			"expensive" operation, and DIAGNOSTIC should be
			used for inexpensive consistency checks.)
1996-08-27 00:44:20 +00:00
cgd
352d972c94 locc() is unused. Remove it from the machine-independent kernel interface. 1996-06-10 15:33:33 +00:00
christos
fb901eb966 - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
1996-03-14 18:52:03 +00:00
christos
1cb0b13391 Add declaration of strncasecmp. 1996-02-13 23:48:26 +00:00
leo
230fb12a7a Add abs() function as an 'inline'. The atari-port needs it since the
-fno-builtin is used in the kernel Makefile.
1995-09-23 20:35:47 +00:00
cgd
26fbf3bbb8 prototype inline functions, almost as suggested by Jonathan Stone in PR 1258. 1995-08-14 05:43:24 +00:00
cgd
aa9eacdd59 new RCS ID format. 1994-10-26 06:39:02 +00:00
cgd
d7fc64af84 don't use inline, use __inline, like cdefs intends (so it can kill it if nongcc 1994-07-15 22:29:22 +00:00
cgd
a0a7429482 lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around.  kill some unnecessary type and macro
definitions.  standardize clock handling.  More changes than you'd want.
1994-05-05 05:35:42 +00:00