Commit Graph

1215 Commits

Author SHA1 Message Date
darran
36ea3668b9 Fixes PR kern/41069 and PR kern/41070.
Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION,  CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel.  The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
2009-03-25 01:26:12 +00:00
tsutsui
9c6c3c68dd Don't use gcc's __builtin_*() functions #if defined(_STANDALONE)
because they could be larger than __OPTIMIZE_SIZE__'ed libsa ones and
__builtin_memcpy() on vax rejects NULL (i.e. copying from/to address 0x0).

No particular comments on tech-toolchain.

Tested on alpha, arc, cobalt, hp300, i386, landisk, macppc, news68k, sgimips,
sparc, sparc64, sun3, and vax (on simh).
2009-03-23 13:41:00 +00:00
tsutsui
9d27968892 Allow MD standalone Makefiles overriding MI libsa settings
by SA_EXTRADIR variable passed via SAMISCMAKEFLAGS.
2009-03-20 11:31:30 +00:00
tsutsui
3c7a0b7662 Revert previous. MI libsa doesn't provide bcmp(). 2009-03-19 10:20:54 +00:00
he
3b9146b27b Add a prototype for the bcmp() function as well. 2009-03-19 08:38:12 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
tsutsui
d0b9e6c924 - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
  in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
  since they are still in libsa for some MD standalone sources
  (I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
   but they should be replaced with memcmp() anyway)
2009-03-18 12:25:06 +00:00
cegger
248cdce283 ansify function definitions 2009-03-15 21:33:51 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl
02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
cube
9f700fdcd2 Follow the syntax of file conditionals for makeoptions, using minor case
versions of options.
2009-03-13 18:25:58 +00:00
tsutsui
82127a2dd2 Use EXT2_DINODE_SIZE() to get offset of inode, not struct ext2fs_dinode array. 2009-03-02 10:25:00 +00:00
christos
6eda90fc68 catch up with variable inode size. 2009-03-01 19:37:16 +00:00
isaki
80a3550743 Revert previous one. It has already fixed in net.h,v 1.25. 2009-01-31 06:22:46 +00:00
isaki
28468b1f07 Fix build error. Declare getsecs() before (re-)defining it. 2009-01-31 04:11:28 +00:00
he
fddc3457b2 Change the use of formally undocumented features, which have now been
made to fail.  Specifically, change
.ifdef(SYMBOL) -> .ifdef SYMBOL or .if defined(SYMBOL),
and corresponding for .ifndef.

Also correct one error in lib/libm/Makefile (.ifdef (${MKCOMPLEX} != "no")?!?).
2009-01-18 20:42:11 +00:00
tsutsui
4459b5fdab I really hate silly hacks inside #ifndef _STANDALONE in libsa sources... 2009-01-18 02:59:02 +00:00
tsutsui
3f38114d96 Remove __P(). 2009-01-17 14:00:36 +00:00
tsutsui
69cf32a782 Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
 numbers in seconds returned by the machine dependent getsecs() function
 which are used to measure relative time

saseconds_t (currently int):
 numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
2009-01-12 11:32:43 +00:00
uwe
533bbdff7e These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden".  I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
2009-01-07 22:15:18 +00:00
pooka
fed3c1df66 Fix PIC version, it was missing one dereference. Thanks to spz
for access to m68k hardware for testing.
2009-01-06 01:24:56 +00:00
pooka
cbd549e79b Fix previous. I have no idea what crack I was on when I "tested" them. 2009-01-05 01:16:09 +00:00
pooka
59f8fc8f6e Split variables out of Makefile into Makefile.libkern so that we
can easily just .include it for the proper SRCS etc. definitions
in case we're interested in the files but not in building an actual
libkern.{a,o}.  for librump
2009-01-04 18:00:55 +00:00
pooka
c5889d575e Support PIC for inclusion in librump. (m68k untested) 2009-01-04 17:10:46 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
ad
5d7468ebd2 msdosfs -> msdos 2008-11-24 11:27:20 +00:00
matt
0ad7281825 Add new ptree (Patricia / RADIX tree) implementation to NetBSD. 2008-11-20 23:50:08 +00:00
ad
5bf641af07 For the x86 boot loader, autoload a kernel module corresponding to the
root file system type.
2008-11-19 12:36:41 +00:00
ad
c6555ead19 Our qsort() is inappropriate for kernel use because it makes recursive
calls. Replace it with a kheapsort() function in kernel. Pointed out
by tron@.
2008-11-16 16:15:58 +00:00
ad
e5c4df967a Make qsort() available in libkern. 2008-11-16 15:01:26 +00:00
matt
74b13f5d12 Use RET/RETc as appropriate 2008-10-15 18:07:46 +00:00
matt
02ed53f8f6 Need to be __clz[sd]i2 2008-10-14 17:23:33 +00:00
matt
01a00ce83a Add a _clzsi2 for armv4 platforms. 2008-10-14 03:16:20 +00:00
christos
a93db399ff add a LOAD_NOTE flag to make loading the note optional. 2008-09-25 20:59:38 +00:00
gmcgarry
0de5da9678 Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.h
preprocessor macros.
2008-09-08 23:36:53 +00:00
gmcgarry
3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
matt
41f74018fd Add KASSERTMSG(e, msg) for umass.c. XXX directly calls panic. 2008-07-02 15:25:08 +00:00
matt
67b10687dc Add CTASSERT (compile time assert) from FreeBSD.
Causes sources to fail to compile:
<file>:<line>: error: size of array '__ctassert<line>' is negative
2008-07-02 14:39:20 +00:00
matt
48717a981d Move rb.c from sys/lib/libkern to common so it can be in both libc and libkern. 2008-06-30 19:03:59 +00:00
matt
da597625e8 Add some significant improvements to the red-black tree implementation.
Shrink size of rb_node by 25% (merge parent/father pointer and flags).
2008-06-30 16:36:18 +00:00
matt
d982b23b25 Nuke MOVED support. Move rb_parent out of rb_nodes and make it it's own
member.
2008-06-25 04:56:08 +00:00
christos
e4992af055 Make rb use masks instead of bitfields, because it is more portable (bitfields
to unsigned long are not portable), and produces tighter code. Tested on
amd64. approved by gimpy.
2008-06-25 03:06:25 +00:00
christos
e9ad0762c7 Include cpuset. 2008-06-15 20:34:18 +00:00
tron
a36c431c01 Use proper C99 syntax to statically initialize a "rb_node" structure to
fix the build.
2008-06-06 12:29:59 +00:00
ad
13c7f6ff40 Move lib/libkern/rb.h to sys/rb.h, so it can be used by kernel header
files.
2008-06-04 14:31:15 +00:00
ad
e69aa3297c Take $MACHINE into account when looking for modules. 2008-05-20 16:04:08 +00:00
ad
5cb8dd92fe Extract kernel version from the note section and stuff into a global
netbsd_version.
2008-05-20 14:41:06 +00:00
chris
f10d13fdee Extend tftp_stat to return the size of the file, rather than -1.
It's not very efficient, as it has to read the whole file, and count the
block sizes.  However, this is the only way to work out the size using the
tftp protocol.

This is needed to support loading modules from a tftp server with pxeboot.
2008-05-11 11:29:12 +00:00
mlelstv
a4002c76a9 There is also ARP_DEBUG for those who need it. 2008-05-11 04:53:15 +00:00