summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate the last of the LINTEDn and PRINTFLIKEn comments. In oneguenther2015-10-011-3/+0
| | | | | | | case, by deleting some useless '& of an array' we also eliminate the need for the casts which prompted the original lint warnings ok deraadt@
* At some point arm moved to a unified syntax for arm and thumb instructions.jsg2015-06-082-39/+43
| | | | | | | | | While binutils supports both "unified" and "divided" syntax (defaulting to divided) the integrated assembler in clang only supports unified names so switch some files to unified syntax. Similiar changes were made in bitrig and freebsd. No difference in objdump -d output. tested on zaurus by deraadt@, ok miod@
* Make some $OpenBSD$ lines prettier/standardier by eliminatingkrw2015-01-191-1/+1
| | | | | | | superflous '*' after '/*' and adding blank after terminating '$'. Also eases parsing of the lines by simple awk scripts. Aesthetic approval from tedu@.
* Sync with libc version.millert2015-01-152-43/+42
|
* unifdef __APCS_26__ we don't run on anything with a 26 bit program counter.jsg2014-12-305-61/+5
| | | | | This codepath was removed in the NetBSD code this is derived from back in 2003 and was removed in Bitrig earlier this year. No binary change.
* Replacing <machine/endian.h> with <sys/endian.h> does not imply removingmiod2014-12-202-0/+4
| | | | <sys/types.h>. kthxbye
* Use <sys/endian.h> instead of <machine/endian.h>guenther2014-12-192-4/+2
| | | | ok dlg@ mpi@ bcook@ millert@ miod@
* sync with libc, using brnz,pt instead, should be betterderaadt2014-12-191-5/+4
| | | | ok kettenis
* Like libc, also for the kernel: Import new amd64 assembly versions ofreyk2014-12-094-93/+442
| | | | | | | | | | strchr/index, strrchr/rindex, and strlen that provide a significantly faster performance than our previous .c or .S implementations. Based on NetBSD's code. Tested with different amd64 CPUs. ok deraadt@ mikeb@
* it should not be necessary to clear the direction flagtedu2014-11-2916-26/+8
| | | | ok deraadt
* mask off high bits from 'c', before operation, otherwise the packingderaadt2014-11-211-0/+1
| | | | | logic writes balony. Hunting with tedu, mlarkin, and final bit spotted by naddy in freebsd's version.
* typomiod2014-11-091-2/+2
|
* KASSERTMSG(9): New kernel assertion with messageuebayasi2014-07-131-1/+17
| | | | | | | | | | | | | | | | | | | | | | | KASSERT() is annoying as it only prints the expression as a string. If you (developers) want to know a little more information, you have to do: #ifdef DIAGNOSTIC if (bad) panic(...); #endif KASSERTMSG() replaces it into a single line: KASSERTMSG(!bad, ...); Taken from NetBSD. (There is a concern that KASSERT() messages are too long; consume more memory, and not friendly for small monitors. This have to be considered & revisited later.) "Like" from henning@ Man page review & advices from jmc@ and schwarze@
* Make normalizeRoundAndPackFloat{32,64} non-static; they will be used outsidemiod2014-07-011-3/+6
| | | | of softfloat.c shortly.
* Protect explicit_bzero() from link-time optimizationmatthew2014-06-211-7/+12
| | | | | | | | | | | | | | | | | | | | Modern compiler toolchains are capable of optimizing even across translation unit boundaries, so simply moving the memory clearing into a separate function is not guaranteed to clear memory. To avoid this, we take advantage of ELF weak symbol semantics, and insert a call to an empty, weakly named function. The semantics of calling this function aren't determinable until load time, so the compiler and linker need to keep the memset() call. There are still ways a toolchain might defeat this trick (e.g., optimistically expecting the weak symbol to not be overloaded, and only calling memset() if it is; promoting weak symbols to strong symbols at link-time when emitting a static binary because they won't be interposed; implementing load-time optimizations). But at least for the foreseeable future, these seem unlikely. ok deraadt
* mop up #ifdef _KERNEL goo; ok miodderaadt2014-06-1021-106/+30
|
* Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingmiod2014-03-1818-1046/+0
| | | | | | | this hardware alive is becoming increasingly difficult, and I should heed the message sent by the three disks which have died on me over the last few days. Noone sane will mourn these ports anyway. So long, and thanks for the fish.
* Initialize ci_randseed better using arc4random() + a trick. Remove thederaadt2014-01-192-17/+4
| | | | | libkern srandom() API since it is not suitable for this use. ok kettenis miod
* tiny tweak to asm. prefer memcpy and memmove, with bcopy wrappertedu2014-01-092-29/+28
| | | | ok guenther
* add fls/flsl functions to find the last bit set in a valuejsg2013-07-113-1/+95
| | | | | from FreeBSD ok mikeb@ haesbaert@ deraadt@
* VAX ELF kernel bits.miod2013-07-055-79/+79
|
* m68k kernel memcpy/memmove/bcopy implementation in libkern, remove ovbcopy, fix for larger than 128k size copies. Parts from deraadt@, ok (and off-by-one fix) miod@jj2013-06-173-3/+134
|
* Fast memmove() implementation for PowerPC, from NetBSD via martin@; withmiod2013-06-153-1/+170
| | | | bcopy() and memcpy() wrappers.
* Fix evil typo causing the wrong pointer to be returned for < 32 bytesmiod2013-06-151-2/+2
| | | | memcpy() or memmove().
* Preserve %o5 around Lbcopy_doubles; prevents the return value from memcpy()miod2013-06-151-4/+5
| | | | | and memmove() to be incorrect for copies of 32 bytes or more, when the source and destination addresses are nicely aligned.
* Make bcopy() involve memmove(), not memcpy().miod2013-06-152-4/+3
| | | | Do not bogusly return NULL if dst == src (spotted by tedu@)
* Correctly handle a length of zero in memcpy().miod2013-06-151-7/+14
| | | | Return the original destination pointer in memcpy() and memmove().
* Don't return garbage in memcpy() but the original destination pointer.miod2013-06-151-0/+1
|
* give bcopy() the ovbcopy() semanticsmiod2013-06-151-1/+2
|
* regenkettenis2013-06-142-2/+0
|
* ovbcopy begonekettenis2013-06-142-4/+2
|
* regenkettenis2013-06-142-0/+4
|
* Fix memcpy/memmove return value.kettenis2013-06-142-2/+6
|
* new integral bcopy/memmove/memcpy, pulled out of sparc locorederaadt2013-06-133-3/+421
| | | | tested by beck
* syncronize "look in other file" messagesderaadt2013-06-134-4/+4
|
* merged bcopy/memmove/memcpyderaadt2013-06-133-129/+142
| | | | tested by bcallah, proofed by jasper, ok tedu
* rework the memcpy family to all use one function body and implementtedu2013-06-133-272/+248
| | | | desired semantics. ok deraadt
* Remove pointless instruction in the memcpy path that snuck in with thekettenis2013-06-131-2/+0
| | | | | | previous commit. ok deraadt@
* take libc bcopy, gut the #ifdefs for other modes, and place it here.deraadt2013-06-131-0/+116
| | | | | Now deficient architectures can use this if they need to. conf/files already tries to pull this in (pointed out by mlarkin)
* ovbcopy begonederaadt2013-06-131-4/+1
|
* same bcopy/memmove/memcpy methodology for vax.deraadt2013-06-133-158/+19
| | | | checked over by mlarkin
* merge bcopy/memmove/memcpy into one file, with jumps so that it is morederaadt2013-06-133-3/+113
| | | | | | likely to be in the cache (like how the explanation is split between multiple commits?) tested by various
* merge memcpy/memmove/bcopy into one file, with sub-jumps.deraadt2013-06-133-3/+271
| | | | ok .... I guess noone, because it is summer
* merge bcopy/memcpy/memmove into one function.deraadt2013-06-133-104/+89
| | | | ok mlarkin tedu
* From now on, the MI libkern memcpy should not do overlap handling.deraadt2013-06-121-16/+4
|
* regenkettenis2013-06-111-45/+45
|
* Optimize memcpy(9) by always doing a forward copy; it should never be usedkettenis2013-06-111-9/+9
| | | | | | | | for overlapping copies. Attempt to be instruction cache friendly by turning things around and make memcpy(9) use the forward copy branch of memmove(9), and implement bcopy(9) by swapping its arguments and dropping into memmove(9). Same change as the one just made to for hppa.
* remove ovbcopy supportderaadt2013-06-1114-20/+0
| | | | ok kettenis
* regenkettenis2013-06-111-43/+43
|
* Optimize memcpy(9) by always doing a forward copy; it should never be usedkettenis2013-06-111-9/+9
| | | | | | | | for overlapping copies. Attempt to be instruction cache friendly by turning things around and make memcpy(9) use the forward copy branch of memmove(9), and implement bcopy(9) by swapping its arguments and dropping into memmove(9). ok deraadt@