summaryrefslogtreecommitdiffstats
path: root/sys/libkern
Commit message (Collapse)AuthorAgeFilesLines
* MFC r279433 (by rstone): Implement asprintf in libkernmav2015-10-051-0/+77
|
* MFC r277901:dim2015-02-024-4/+4
| | | | | | | | | | Fix a -Wcast-qual warning in libkern's strtol(), by using __DECONST. No functional change. MFC r277903: Similar to r277901, fix more -Wcast-qual warnings in libkern's strtoq(), strtoul() and strtouq(), by using __DECONST. No functional change.
* Clean up our ARM assembly:andrew2014-12-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC 275256: Switch to the ARM unified assembly language as the clang integrated as only supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd MFC 275264: Update _ENTRY to use _EENTRY to reduce the common code. MFC 275321: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd MFC 275322: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd MFC 275416: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. Sponsored by: ABT Systems Ltd MFC 275418: Switch to unified syntax so these can be built with clang 3.5. Sponsored by: ABT Systems Ltd MFC 275519: Add missing END macros to some of the xscale functions. Sponsored by: ABT Systems Ltd MFC 275520: Use the unified syntax in a few more assembly files Sponsored by: ABT Systems Ltd MFC 275521: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. Sponsored by: ABT Systems Ltd MFC 275522: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. Sponsored by: ABT Systems Ltd MFC 275523: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. Sponsored by: ABT Systems Ltd MFC 275524: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. Sponsored by: ABT Systems Ltd
* MFC r274636:delphij2014-12-041-5/+3
| | | | Sync with userland variant.
* MFC: 272906gnn2014-11-131-0/+74
| | | | | | | | | Change the PF hash from Jenkins to Murmur3. In forwarding tests this showed a conservative 3% incrase in PPS. Original Differential Revision: https://reviews.freebsd.org/D461 Submitted by: des Reviewed by: emaste
* MFC r270096:trasz2014-08-311-0/+51
| | | | | | | | | | | | | Bring in the new automounter, similar to what's provided in most other 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 Relnotes: yes Sponsored by: The FreeBSD Foundation
* MFC r269390: Fix unwind info in hand-written asm (avoid nested functions).ian2014-08-111-10/+10
|
* MFC 267291:jhb2014-06-272-4/+4
| | | | | | | | | Use strcasecmp() instead of strcmp() when checking user-supplied encoding 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
* 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.
* Remove the now unused skpc() function.ed2012-01-011-49/+0
| | | | | | | | | 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.
* Introducing memcchr(3).ed2012-01-011-0/+115
| | | | | | | | | | | | | | | | | | | | | 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.
* retire libkern getsavg2011-12-171-77/+0
| | | | | | Inspired by: bde MFC after: 2 months X-MFC-Note: if deemed a part of KPI, just call cngets internally
* Add unicode support to msdosfs and smbfs; original pathes from imura,kevlo2011-11-182-0/+552
| | | | | | bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>. Tested by me in production for several days at work.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* Add strnlen() to libkern.jkim2011-10-041-0/+42
|
* Fix typos - remove duplicate "is".brucec2011-02-231-1/+1
| | | | | | PR: docs/154934 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Add support for asterisk characters when filling in the GELI passworded2010-11-141-1/+9
| | | | | | | | | | | 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)
* Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() generalattilio2010-09-242-0/+403
| | | | | | | | | | 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
* Provide memchr() in the libkern.raj2010-06-021-0/+51
| | | | | | | | This is required by libfdt and will be compiled in conditionally only for FDT-enabled platforms. Reviewed by: imp Sponsored by: The FreeBSD Foundation
* Switch to our preferred 2-clause BSD license.joel2010-04-073-21/+3
| | | | Approved by: bp
* Start copyright notice with /*-joel2010-04-072-2/+2
|
* Move inet_aton() (specular to inet_ntoa(), already present in libkern)attilio2009-11-121-0/+136
| | | | | | | | 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
* done method is supposed to return int.delphij2009-06-221-1/+1
|
* Split tolower/toupper code from usual xlat16 kiconv table, and make itdelphij2009-06-223-24/+168
| | | | | | | | 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)
* add explanatory header licensekmacy2009-06-091-0/+36
|
* move jenkins hash to its own header in libkernkmacy2009-06-091-0/+149
|
* Add memmove() to the kernel, making the kernel compile with Clang.ed2009-02-281-0/+38
| | | | | | | | | | | | 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
* Remove redundant assignment of `s'.ed2009-02-261-1/+0
| | | | | | The variable is already initialized to `nptr'. Found by: LLVM's scan-build
* This commit fixes the issue with alias_sctp.c. Norrs2009-02-141-0/+643
| | | | | | | | | | | | | | 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)
OpenPOWER on IntegriCloud