matt
ab1d549cb1
Improve my version of mtprng_random. Reshuffle things. Add an compatible
...
version of init_by_array.
2008-02-02 01:13:04 +00:00
simonb
e99e83279b
Check _STANDALONE as well as _KERNEL when choosing headers to include.
...
Also pull in <lib/libkern/libkern.h> so we get prototypes and a struct
mtprng_state declaration.
2008-01-31 08:23:13 +00:00
simonb
4cbecce6c5
Have mtprng_random() call mtprng_rawrandom() to get more
...
random data instead of calling itself. Much nicer to the
stack...
2008-01-31 03:37:13 +00:00
simonb
ba30aadce1
Check against correct constant in a KASSERT().
2008-01-31 03:34:04 +00:00
matt
3056c4f69a
Add Mersenne Twister prototypes and state struct to libkern.h
...
Cleanup a comment. s/RLEN/MTPRNG_RLEN/g s/POS1/MTPRNG_POS1/g
Remove unneeded test code.
2008-01-31 02:36:09 +00:00
matt
cd27642585
Add Mersenne Twister PRNG implementation. This is a new implementation.
2008-01-31 02:09:54 +00:00
simonb
d8de5b102b
Remove support for NetBSD/pc532.
2008-01-09 11:25:58 +00:00
jmcneill
e38d794d0c
libkern bits for usermode port.
2007-12-29 14:39:33 +00:00
perry
b6a2ef7569
Convert many of the uses of __attribute__ to equivalent
...
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
plunky
b83f9a6a6d
remove insque/remque from libkern, they are no longer used
2007-11-22 22:56:16 +00:00
matt
1d4dffbc51
Make rb_tree_insert_node return true/false whether the node was inserted
...
or not.
2007-11-21 16:42:51 +00:00
yamt
c77d808475
build rb.c.
2007-11-20 13:49:01 +00:00
yamt
3acf687ede
rename
...
RB_LEFT
RB_RIGHT
RB_OTHER
to
RB_DIR_LEFT
RB_DIR_RIGHT
RB_DIR_OTHER
so that it can coexist with sys/tree.h.
2007-11-20 12:32:55 +00:00
yamt
636f153f4d
fix compilation in the case of _KERNEL && DIAGNOSTIC && !RBDEBUG.
2007-11-20 08:30:05 +00:00
pooka
018bb97124
Rename __assert() to __kernassert() so that it doesn't collide
...
with the libc version. They take different arguments.
2007-09-24 14:19:03 +00:00
ad
7dcf597b04
Do the panicstr check only if _KERNEL.
2007-08-03 13:06:00 +00:00
ad
480f8d26c5
Disable kernel assertions if panicstr != NULL.
2007-07-29 11:46:02 +00:00
dsl
cb40f24fa8
include sys/cdefs.h
2007-07-19 22:00:04 +00:00
ad
3f8edbdfd7
G/C dead code.
2007-06-10 00:52:29 +00:00
matt
75f8d3f9a5
Include byte_swap_[24].c for kernels compiled with -O0
2007-04-13 22:12:04 +00:00
matt
e3a731cab5
Enable builtin_ffs for vax
2007-04-09 17:39:37 +00:00
scw
5764a76889
Remove support for NetBSD/{,evb}sh5.
2007-04-08 09:35:21 +00:00
uwe
eaa25d5966
Provide __movmemSI12_i4 (gcc4) a.k.a. __movstrSI12_i4 (gcc3) that gcc
...
emits for sh4 to copy 12 bytes at certain optimization levels.
Discovered by compiling landisk kernel with -Os.
Use gcc3 naming ("movstr") to match the rest of the "movstr" files.
2007-03-14 22:22:53 +00:00
christos
53524e44ef
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
2007-03-04 05:59:00 +00:00
thorpej
712239e366
Replace the Mach-derived boolean_t type with the C99 bool type. A
...
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
ragge
ad9091c30f
Repair copyright that has been broken since -94.
...
Gently requested by Otto Moerbeek.
2007-01-14 13:26:18 +00:00
dyoung
e3361bb265
Add strsep(3) to libkern.
...
To avoid code duplication, move strsep.c to the kernel/userland
common files.
Soon I will commit source-address selection (options IPSELSRC).
It will use strsep(3).
2006-11-13 03:26:43 +00:00
christos
9573aa20e8
- call the initialization routine for arc4randbytes.
...
- knf (add continues)
2006-11-05 14:13:56 +00:00
christos
31a62606ea
Merge kernel and userland rmd160 and sha2 implementation.
...
XXX: We still install rmd160.h and sha2.h in /usr/include/crypto, unlike
the other hash functions which get installed in /usr/include for compatibility.
2006-10-27 21:20:48 +00:00
thorpej
82fd1ebbaa
- Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
...
- Add strtoll.c and strtoull.c to libkern.
2006-10-08 03:14:55 +00:00
simonb
a4c94c5ab7
Remove stale copy. Pointed out by uwe@ ages ago.
2006-09-28 13:12:59 +00:00
matt
efc67dee86
Add a way for a user to know what nodes have changed when a node has been
...
inserted or removed. Refactor node insertion to not require rebalancing
all the time or a loop if it does. In rb_tree_swap_prune_and_rebalance,
don't call rb_tree_reparent_nodes, instead do the work ourselves (since
we will eventually undo half of the work of rb_tree_reparent_nodes).
2006-09-10 23:57:31 +00:00
matt
9bed3293b9
If __STDC__ and GNU C >= 3.0, define C99's bool, true, false
2006-09-10 23:49:21 +00:00
matt
d9bb545dc5
Shrink rb_tree to 4 pointers (2 if RBSMALL is defined). Move compare
...
functions to a separate rb_tree_ops structure. Make every int explicit
in being signed or unsigned. Use RBDEBUG to enable debug code. Move
rbt_count to RBSTATS. Use RBSMALL to not keep track of min/max.
2006-09-09 06:52:18 +00:00
matt
75de26ab17
Add rb_tree_find_node_{geq,leq}. Add stats. Make TAILQ DEBUG only.
...
Keep track of tree's min/max nodes for easier iteration. Improve comments.
Move functions around to improve locality.
2006-09-09 05:55:51 +00:00
matt
958730091e
Fix and simplify node removal. Add lots of assertions and comments.
2006-09-08 04:07:15 +00:00
thorpej
f68bacf5a3
Use static at the function decl if the prototype also uses static.
2006-09-06 20:01:57 +00:00
scw
24f4ed9338
The list of registers which sdivsi3 can clobber has changed in gcc4.
...
Make the necessary changes.
2006-09-05 22:07:08 +00:00
matt
3aa5e506b7
Rewrite of red-black tree code.
2006-09-05 04:35:45 +00:00
scw
456695f0eb
The kernel is built with "-mdiv=call", so add a __sdivsi3_1 alias
...
for __sdivsi3.
2006-09-04 20:44:48 +00:00
matt
497415f67e
Make this compile in _KERNEL || _STANDALONE. Make gcc4 happy.
2006-09-02 20:46:50 +00:00
dyoung
8cd106d3d2
Per discussion on tech-kern and tech-userlevel, move the bit-twiddling
...
macros, __BIT, __BITS, SHIFTIN, SHIFTOUT, and __arraycount() from
lib/libkern/libkern.h to sys/cdefs.h. Add a __-prefix to SHIFTIN
and SHIFTOUT, and add a manual page for the bit-twiddling macros,
bits(3).
Make the __BIT and __BITS macros "widthless," as best I can, by
changing their type to uintmax_t from uint32_t. XXX The manual
page lags this change by a bit.
Define __PRIxBIT and __PRIxBITS printf(3) format strings.
2006-08-31 19:24:37 +00:00
tsutsui
a3bdccd23a
Add src/common/include to include header search path so that
...
standalone programs can be built without installed ${DESTDIR} tree.
Okayed by christos, and should close PR 33431.
2006-08-28 13:34:18 +00:00
matt
5e87012f78
Add __NULL_STMT which is do { } while (/* CONSTCOND */ 0)
2006-08-25 19:07:44 +00:00
rillig
b102417f76
Fixed the gcc warning that "static" should come before "const".
2006-07-16 06:06:20 +00:00
matt
53ea8158b4
With VAX & GCC4, use builtin memset and memmove.
2006-07-08 00:24:26 +00:00
kardel
de4337ab21
merge FreeBSD timecounters from branch simonb-timecounters
...
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
uwe
497c1ccc27
Provide __movmem* aliases to __movstr* functions.
...
Gcc4 uses movmem, older versions use movstr.
2006-05-22 21:34:08 +00:00
uwe
9001bc2fd8
G/c #ifdef PIC we inherited from the userland.
2006-05-22 20:56:44 +00:00
thorpej
b69c14413b
Support for building proplib in the kernel.
2006-04-27 20:43:09 +00:00