| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
s/ a a / a /g
Approved by: cperciva
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
| |
- Provide missing function that can do hashing of arbitrary sized buffer.
- Refetch lookup3.c and do only minimal edits to it, so that diff between
our jenkins_hash.c and lookup3.c is minimal.
- Add declarations for jenkins_hash(), jenkins_hash32() to sys/hash.h.
- Document these functions in hash(9)
Obtained from: http://burtleburtle.net/bob/c/lookup3.c
|
|
|
|
|
|
|
|
| |
Previously it would either loop infinitely or exit with error leaking a lock.
Reported by: Will DeVries
Approved by: trasz (mentor)
MFC after: 1 week
|
| |
|
|
|
|
| |
Submitted by: gcooper
|
|
|
|
|
| |
PR: kern/168095
Submitted by: gcooper
|
| |
|
|
|
|
|
|
| |
While at it, remove some style(9) bugs in libkern.h.
Submitted by: kan
|
|
|
|
| |
run-time.
|
|
|
|
|
| |
Now that index() and rindex() have become unused, simply turn them into
wrappers around strchr() and strrchr(), respectively.
|
|
|
|
|
|
|
|
| |
It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.
For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.
|
|
|
|
|
|
|
|
|
| |
It was only used by ufs and ext2 and I have really strong doubts that
there are other pieces of code that also use this function. If it turns
out that external drivers use this code as well, I'd be happy to migrate
or revert.
Bump __FreeBSD_version while there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems two of the file system drivers we have in the tree, namely ufs
and ext3, use a function called `skpc()'. The meaning of this function
does not seem to be documented in FreeBSD, but it turns out one needs to
be a VAX programmer to understand what it does.
SPKC is an instruction on the VAX that does the opposite of memchr(). It
searches for the non-equal character. Add a new function called
memcchr() to the tree that has the following advantages over skpc():
- It has a name that makes more sense than skpc(). Just like strcspn()
matches the complement of strspn(), memcchr() is the complement of
memchr().
- It is faster than skpc(). Similar to our strlen() in libc, it compares
entire words, instead of single bytes. It seems that for this routine
this yields a sixfold performance increase on amd64.
- It has a man page.
|
|
|
|
|
|
| |
Inspired by: bde
MFC after: 2 months
X-MFC-Note: if deemed a part of KPI, just call cngets internally
|
|
|
|
|
|
| |
bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>.
Tested by me in production for several days at work.
|
|
|
|
| |
This means that their use is restricted to a single C file.
|
| |
|
|
|
|
|
|
| |
PR: docs/154934
Submitted by: Eitan Adler <lists at eitanadler.com>
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
|
| |
during boot.
Change the last argument of gets() to indicate a visibility flag and add
definitions for the numerical constants. Except for the value 2, gets()
will behave exactly the same, so existing consumers shouldn't break. We
only use it in two places, though.
Submitted by: lme (older version)
|
|
|
|
|
|
|
|
|
|
| |
in the kernel (just as inet_ntoa() and inet_aton()) are and sync their
prototype accordingly with already mentioned functions.
Sponsored by: Sandvine Incorporated
Reviewed by: emaste, rstone
Approved by: dfr
MFC after: 2 weeks
|
|
|
|
|
|
|
|
| |
This is required by libfdt and will be compiled in conditionally only for
FDT-enabled platforms.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
|
|
|
|
| |
Approved by: bp
|
| |
|
|
|
|
|
|
|
|
| |
into libkern in order to made it usable by other modules than alias_proxy.
Obtained from: Sandvine Incorporated
Sponsored by: Sandvine Incorporated
MFC: 1 week
|
| |
|
|
|
|
|
|
|
|
| |
possible to do tolower/toupper independently without code conversion.
Submitted by: imura (but bugs are mine)
Obtained from: http://people.freebsd.org/~imura/kiconv/
(1_kiconv_wctype_kern.diff, 1_kiconv_wctype_user.diff)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When copying big structures, LLVM generates calls to memmove(), because
it may not be able to figure out whether structures overlap. This caused
linker errors to occur. memmove() is now implemented using bcopy().
Ideally it would be the other way around, but that can be solved in the
future. On ARM we don't do add anything, because it already has
memmove().
Discussed on: arch@
Reviewed by: rdivacky
|
|
|
|
|
|
| |
The variable is already initialized to `nptr'.
Found by: LLVM's scan-build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
longer do we require SCTP to be in the kernel for the
lib to be able to handle SCTP. We do this by moving
the CRC32c checksum into libkern/crc32.c and then adjusting
all routines to use the common methods. Note that this
will improve the performance of iSCSI since they were
using the old single 256 bit table lookup versus the
slicing 8 algorithm (which gives a 4x speed up in
CRC32c calculation :-D)
Reviewed by:rwatson, gnn, scottl, paolo
MFC after: 4 week? (assuming we MFC the alias_sctp changes)
|
|
|
|
|
|
|
|
|
|
| |
do not need any locking. Opening and closing translators is serialized
using an sx lock.
Note: This depends on the earlier fix to kern_module.c to properly order
MOD_UNLOAD events.
MFC after: 2 months
|
|
|
|
|
|
|
| |
avoid being picked up by the DTrace fbt provider.
This is called by __udivdi3() for doing 64bit division on a 32bit arch and may
be called from within the dtrace context causing a double fault.
|
|
|
|
|
|
|
|
|
|
|
| |
and bcmp are not the same thing. 'man bcmp' states that the return is
"non-zero" if the two byte strings are not identical. Where as,
'man memcmp' states that the return is the "difference between the
first two differing bytes (treated as unsigned char values" if the
two byte strings are not identical.
So provide a proper memcmp(9), but it is a C implementation not a tuned
assembly implementation. Therefore bcmp(9) should be preferred over memcmp(9).
|
|
|
|
| |
in separate commit.
|
|
|
|
|
|
|
| |
just found it in OpenBSD, see their sys/crypto/arc4.c, function
rc4_keysetup, line ctx->x = ctx->y = 0;
Obtained from: OpenBSD
|
|
|
|
|
|
|
| |
"If you don't get a review within a day or two, I would firmly recommend
backing out the changes"
back out all my changes as unreviewed by secteam@ yet.
|
|
|
|
|
|
| |
draft-kaukonen-cipher-arcfour-03.txt (3.1.5)
2) Drop first 768 bytes as standard RC4-drop(768)
|
| |
|
| |
|
|
|
|
| |
when the FP emulator is compiled-in.
|
|
|
|
| |
MFC After: 3 days
|
|
|
|
|
|
|
|
|
|
| |
timing loops being optimized away.
Once apon a time, gcc promised not to optimize away timing loops, but
gcc started optimizing away the call to a null function in the timing
loop here some time between gcc-3.3.3 and gcc-3.4.6, and it started
optimizing away the timing loop itself some time between gcc-3.4.6
and gcc-4.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
popular names. Hence:
- comment current index() and rindex() functions, as these serve the same
functionality as, respectively, strchr() and strrchr() from userland;
- add inlined version of strchr() and strrchr(), as we tend to use them more
often;
- remove str[r]chr() definitions from ZFS code;
Reviewed by: pjd
Approved by: cognet (mentor)
|
| |
|
|
|
|
|
|
| |
existence of this function as a linkable symbol in standalone
configurations and existing inline memcpy from libkern.h fails
this requirement.
|
| |
|
| |
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
| |
This allows me to "boot -a" over a serial console. Tested on
several machines.
|