summaryrefslogtreecommitdiffstats
path: root/sys/libkern
Commit message (Collapse)AuthorAgeFilesLines
* Merge ACPICA 20160422.jkim2016-04-271-0/+63
|
* kern: for pointers replace 0 with NULL.pfg2016-04-154-4/+4
| | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle.
* libkern: ffs, fls: s/4/3/ the 3rd BSD clausecem2015-10-226-6/+6
| | | | | Approved by: emaste Sponsored by: EMC / Isilon Storage Division
* Add libkern ffsll() for parity with flsll()cem2015-10-221-0/+48
| | | | | Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3962
* Add the __aeabi_memclr8 symbol, clang 3.7 uses this.andrew2015-09-211-0/+2
| | | | | MFC after: 1 week Sponsored by: ABT Systems Lts
* Remove checks for __ARM_EABI__, we only build for EABI now.andrew2015-07-096-30/+0
| | | | Sponsored by: ABT Systems Ltd
* Add support for __aeabi_memclr4, clang 3.7 calls it.andrew2015-07-091-0/+40
| | | | Sponsored by: ABT Systems Ltd
* Huge cleanup of random(4) code.markm2015-06-302-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * GENERAL - Update copyright. - Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set neither to ON, which means we want Fortuna - If there is no 'device random' in the kernel, there will be NO random(4) device in the kernel, and the KERN_ARND sysctl will return nothing. With RANDOM_DUMMY there will be a random(4) that always blocks. - Repair kern.arandom (KERN_ARND sysctl). The old version went through arc4random(9) and was a bit weird. - Adjust arc4random stirring a bit - the existing code looks a little suspect. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Redo read_random(9) so as to duplicate random(4)'s read internals. This makes it a first-class citizen rather than a hack. - Move stuff out of locked regions when it does not need to be there. - Trim RANDOM_DEBUG printfs. Some are excess to requirement, some behind boot verbose. - Use SYSINIT to sequence the startup. - Fix init/deinit sysctl stuff. - Make relevant sysctls also tunables. - Add different harvesting "styles" to allow for different requirements (direct, queue, fast). - Add harvesting of FFS atime events. This needs to be checked for weighing down the FS code. - Add harvesting of slab allocator events. This needs to be checked for weighing down the allocator code. - Fix the random(9) manpage. - Loadable modules are not present for now. These will be re-engineered when the dust settles. - Use macros for locks. - Fix comments. * src/share/man/... - Update the man pages. * src/etc/... - The startup/shutdown work is done in D2924. * src/UPDATING - Add UPDATING announcement. * src/sys/dev/random/build.sh - Add copyright. - Add libz for unit tests. * src/sys/dev/random/dummy.c - Remove; no longer needed. Functionality incorporated into randomdev.*. * live_entropy_sources.c live_entropy_sources.h - Remove; content moved. - move content to randomdev.[ch] and optimise. * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h - Remove; plugability is no longer used. Compile-time algorithm selection is the way to go. * src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h - Add early (re)boot-time randomness caching. * src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h - Remove; no longer needed. * src/sys/dev/random/uint128.h - Provide a fake uint128_t; if a real one ever arrived, we can use that instead. All that is needed here is N=0, N++, N==0, and some localised trickery is used to manufacture a 128-bit 0ULLL. * src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h - Improve unit tests; previously the testing human needed clairvoyance; now the test will do a basic check of compressibility. Clairvoyant talent is still a good idea. - This is still a long way off a proper unit test. * src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h - Improve messy union to just uint128_t. - Remove unneeded 'static struct fortuna_start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) * src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h - Improve messy union to just uint128_t. - Remove unneeded 'staic struct start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) - Fix some magic numbers elsewhere used as FAST and SLOW. Differential Revision: https://reviews.freebsd.org/D2025 Reviewed by: vsevolod,delphij,rwatson,trasz,jmg Approved by: so (delphij)
* Add more __aeabi_memcpy functions, later versions of clang generate callsandrew2015-05-311-0/+4
| | | | to these functions.
* Move zlib.c from net to libkern.rodrigc2015-04-221-0/+5414
| | | | | | | | | | | | It is not network-specific code and would be better as part of libkern instead. Move zlib.h and zutil.h from net/ to sys/ Update includes to use sys/zlib.h and sys/zutil.h instead of net/ Submitted by: Steve Kiernan stevek@juniper.net Obtained from: Juniper Networks, Inc. GitHub Pull Request: https://github.com/freebsd/freebsd/pull/28 Relnotes: yes
* Implement asprintf in libkernrstone2015-03-011-0/+77
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1877 Reviewed by: pjd, jfv MFC After: 1 month Sponsored by: Sandvine Inc.
* Similar to r277901, fix more -Wcast-qual warnings in libkern's strtoq(),dim2015-01-293-3/+3
| | | | | | strtoul() and strtouq(), by using __DECONST. No functional change. MFC after: 3 days
* Fix a -Wcast-qual warning in libkern's strtol(), by using __DECONST. Nodim2015-01-291-1/+1
| | | | | | functional change. MFC after: 3 days
* Add some new modes to OpenCrypto. These modes are AES-ICM (can be usedjmg2014-12-121-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for counter mode), and AES-GCM. Both of these modes have been added to the aesni module. Included is a set of tests to validate that the software and aesni module calculate the correct values. These use the NIST KAT test vectors. To run the test, you will need to install a soon to be committed port, nist-kat that will install the vectors. Using a port is necessary as the test vectors are around 25MB. All the man pages were updated. I have added a new man page, crypto.7, which includes a description of how to use each mode. All the new modes and some other AES modes are present. It would be good for someone else to go through and document the other modes. A new ioctl was added to support AEAD modes which AES-GCM is one of them. Without this ioctl, it is not possible to test AEAD modes from userland. Add a timing safe bcmp for use to compare MACs. Previously we were using bcmp which could leak timing info and result in the ability to forge messages. Add a minor optimization to the aesni module so that single segment mbufs don't get copied and instead are updated in place. The aesni module needs to be updated to support blocked IO so segmented mbufs don't have to be copied. We require that the IV be specified for all calls for both GCM and ICM. This is to ensure proper use of these functions. Obtained from: p4: //depot/projects/opencrypto Relnotes: yes Sponsored by: FreeBSD Foundation Sponsored by: NetGate
* Use the unified syntax in a few more assembly filesandrew2014-12-051-1/+2
| | | | | MFC after: 1 week Sponsored by: ABT Systems Ltd
* Sync with userland variant.delphij2014-11-171-5/+3
| | | | MFC after: 2 weeks
* Add a complete implementation of MurmurHash3. Tweak both implementationsdes2014-10-181-12/+70
| | | | | | | so they match the established idiom. Document them in hash(9). MFC after: 1 month MFC with: r272906
* Remove duplicated code.delphij2014-10-161-0/+4
| | | | Suggested by: jmg
* Change the PF hash from Jenkins to Murmur3. In forwarding testsgnn2014-10-101-0/+74
| | | | | | | | | this showed a conservative 3% incrase in PPS. Differential Revision: https://reviews.freebsd.org/D461 Submitted by: des Reviewed by: emaste MFC after: 1 month
* Add explicit_bzero(3) and its kernel counterpart.delphij2014-10-071-0/+24
| | | | | Obtained from: OpenBSD MFC after: 2 weeks
* Use __DECONST to avoid compiler warnings (and thus build failures)bz2014-09-081-2/+2
| | | | with gcc on sparc64, mips, and powerpc after r271173.
* Add support for gdb's memory searching capabilities to our in-kernel gdbbenno2014-09-051-0/+62
| | | | | | | | server. Submitted by: Daniel O'Connor <daniel.oconnor@isilon.com> Reviewed by: jhb Sponsored by: EMC Isilon Storage Division
* Bring in the new automounter, similar to what's provided in most othertrasz2014-08-171-0/+51
| | | | | | | | | | | | | UNIX systems, eg. MacOS X and Solaris. It uses Sun-compatible map format, has proper kernel support, and LDAP integration. There are still a few outstanding problems; they will be fixed shortly. Reviewed by: allanjude@, emaste@, kib@, wblock@ (earlier versions) Phabric: D523 MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation
* Fix unwind-info errors in our hand-written arm assembler code.ian2014-08-011-10/+10
| | | | | | | | | | | | | | | | | | | We have functions nested within functions, and places where we start a function then never end it, we just jump to the middle of something else. We tried to express this with nested ENTRY()/END() macros (which result in .fnstart and .fnend directives), but it turns out there's no way to express that nesting in ARM EHABI unwind info, and newer tools treat multiple .fnstart directives without an intervening .fnend as an error. These changes introduce two new macros, EENTRY() and EEND(). EENTRY() creates a global label you can call/jump to just like ENTRY(), but it doesn't emit a .fnstart. EEND() is a no-op that just documents the conceptual endpoint that matches up with the same-named EENTRY(). This is based on patches submitted by Stepan Dyatkovskiy, but I made some changes and added the EEND() stuff, so blame any problems on me. Submitted by: Stepan Dyatkovskiy <stpworld@narod.ru>
* Remove ia64.marcel2014-07-0712-1273/+0
| | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* Use strcasecmp() instead of strcmp() when checking user-supplied encodingjhb2014-06-092-4/+4
| | | | | | | | | | names so that encoding names are treated as case-insensitive. This allows the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior of iconv(1). PR: 167977 Submitted by: buganini@gmail.com MFC after: 1 week
* Fix typoeadler2013-11-291-1/+1
| | | | Reported by: emaste
* Fix typoeadler2013-11-291-1/+1
| | | | Reported by: swildner@DragonFlyBSD.org
* Fix ixp425 boot2 with ARM EABI:andrew2013-09-292-0/+14
| | | | | | | | - libkern is missing __aeabi_llsl, implement this by calling __ashldi3. - Because of how the asm entry macros are defined the boot2 code requires the unwind symbols to exist, include them in boot2. Approved by: re (marius)
* Fix watchdog pretimeout.alfred2013-07-271-0/+47
| | | | | | | | The original API calls for pow2ns, however the new APIs from Linux call for seconds. We need to be able to convert to/from 2^Nns to seconds in both userland and kernel to fix this and properly compare units.
* Attempt to mitigate poor initialization of arc4 by one-shotache2013-04-191-1/+4
| | | | | | | reinitialization from yarrow right after good entropy is harvested. Approved by: secteam (delphij) MFC after: 1 week
* Add __aeabi_memset to libkern, implemented using memset, as clang mayandrew2013-03-161-0/+49
| | | | generate calls to it.
* Add END to ARM libkern assembly functionsandrew2013-03-164-1/+19
|
* Move the __aeabi_unwind_cpp_pr{0,1,2} functions to libkern so they can beandrew2013-03-161-0/+58
| | | | referenced in a non-debug kernel.
* Add __aeabi_memcpy to libkern as clang may generate calls to it.andrew2013-03-101-0/+37
|
* Add __aeabi_ulcmp to allow building of the LINT kernel.andrew2013-01-232-0/+17
|
* Add the required __aeabi_* functions the kernel uses when built for ARM EABIandrew2013-01-173-0/+128
|
* Sync strlcpy with userland version.delphij2012-11-031-33/+17
| | | | MFC after: 1 month
* Sync strlen with userland implementation.delphij2012-11-031-13/+98
| | | | MFC after: 1 month
* s/ is is / is /geadler2012-09-141-1/+1
| | | | | | | s/ a a / a /g Approved by: cperciva MFC after: 3 days
* - Move jenkins.h to jenkins_hash.cglebius2012-09-042-185/+463
| | | | | | | | | | - 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
* Fix unloading of libiconv module.mjg2012-06-111-2/+4
| | | | | | | | 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
* Use strcmp that I replaced by accident.kevlo2012-05-211-3/+3
|
* Fix broken ref countkevlo2012-05-211-0/+1
| | | | Submitted by: gcooper
* Fix improper handling of variadic args with ICDEBUGkevlo2012-05-211-3/+1
| | | | | PR: kern/168095 Submitted by: gcooper
* Remove dead codekevlo2012-05-211-5/+3
|
* Remove second consts in r233288 in order to appease C++ compilers.marius2012-03-261-10/+10
| | | | | | While at it, remove some style(9) bugs in libkern.h. Submitted by: kan
* Declare the CRC lookup-tables const as they hardly should change atmarius2012-03-211-10/+10
| | | | run-time.
* Implement extensions on top of standards instead of the other way around.ed2012-01-032-14/+2
| | | | | Now that index() and rindex() have become unused, simply turn them into wrappers around strchr() and strrchr(), respectively.
* Use strchr() and strrchr().ed2012-01-021-2/+2
| | | | | | | | 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.
OpenPOWER on IntegriCloud