summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern
AgeCommit message (Collapse)AuthorFilesLines
2021-03-06ansijsg1-2/+1
2020-11-28Add retguard to macppc kernel locore.S, ofwreal.S, setjmp.Sgkoehler2-7/+7
This changes RETGUARD_SETUP(ffs) to RETGUARD_SETUP(ffs, %r11, %r12) and RETGUARD_CHECK(ffs) to RETGUARD_CHECK(ffs, %r11, %r12) to show that r11 and r12 are in use between setup and check, and to pick registers other than r11 and r12 in some kernel functions. ok mortimer@ deraadt@
2020-10-27Retguared asm macros for powerpc libkerngkoehler2-7/+12
This was in the macppc snap, but I forgot to include it in my last commit "Retguard asm macros for powerpc libc, ld.so"
2020-10-16Use the retguard macros from asm.h to protect the function.deraadt1-1/+3
ok mortimer kettenis
2020-08-13Add __multi3 from compiler_rt-8.xjca1-0/+54
Needed to build a sparc64 kernel with clang 10. ok kettenis@
2020-08-13Move compiler_rt type definitions to a separate headerjca2-32/+68
so that we can reuse them in other compiler_rt routines. ok kettenis@
2020-08-03add aliases for arm eabi long long shift functionsjsg3-0/+12
clang 10 on armv7 references these when building RAMDISK (-Oz) but not GENERIC (-O2). feedback and ok guenther@
2020-07-20__main() is no longer used by any of our toolchainsderaadt1-41/+0
this fell out of a discussion with mortimer ok kettenis
2020-07-18The kernel and bootblocks never reference this file...deraadt1-41/+0
2020-06-10Provide an optimized implementation of ffs(3) in the kernel onnaddy3-0/+47
arm64/powerpc/powerpc64, making use of the count leading zeros instruction. powerpc testing by cwen@; ok kettenis@ deraadt@
2020-04-02Add __lshrti3 to libkern and use it on sparc64jca1-0/+71
With this it's possible to build the kernel using clang. Discussed with claudio@, ok deraadt@
2020-02-26Remove non-__STDC__ assert macros from <lib/libkern/libkern.h>.visa1-22/+1
The macros are defined in a part of the header where a C compiler is required. In addition, the macros expand to C code, so it looks unnecessary to define the asserts with traditional cpp in mind. OK cheloha@, mpi@
2019-11-05Give some END()s to assembly symbols.mpi4-4/+8
ok kettenis@, jca@
2019-04-25Add movstrSI12_i4 for linking -Os/-Oz kernels. Sadly however itderaadt1-0/+19
fails and locks early in boot.
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.millert3-6/+6
2018-07-13Use _ALIGN_TRAPS instead of _ALIGN_TEXT where nops aren't needed.guenther3-6/+6
ok deraadt@
2018-07-10In asm.h ensure NENTRY uses the old-school nop-sled align, but change standardderaadt3-5/+5
ENTRY is a trapsled. Fix a few functions which fall-through into an ENTRY macro. amd64 binaries now are free of double+-nop sequences (except for one assember nit in aes-586.pl). Previous changes by guenther got us here. ok mortimer kettenis
2018-07-03Add retguard macros for libkernmortimer15-12/+43
ok deraadt
2018-04-25use size_t for the size of buffers and strings, not int.dlg2-6/+8
sprinkle some bounded attributes while here. ok deraadt@
2017-10-26Add aliases for __aeabi_idivmod and __aeabi_uidivmod calls clang emits.jsg1-1/+3
Remainder of the division is already stored in r1 in __divsi3/__udivsi3. ok kettenis@
2017-09-08If you use sys/param.h, you don't need sys/types.hderaadt1-2/+1
2017-08-20Fix the __sync_* functions to make them work properlyvisa1-1/+21
as full memory barriers.
2017-05-21Enable radeondrm(4) on loongson to get accelerated graphicsvisa1-0/+317
with the RS780E chipset. OK kettenis@, jsg@
2017-01-24In preparation of compiling our kernels with -ffreestanding, explicitly mapkettenis7-7/+22
a few performance-critical functions to compiler builtins. Since the builtins supported by gcc3, gcc4 and clang are not the same, there are (unfortunately) some compiler checks to make sure we only do the mapping for builtins that are actually supported by the compiler. ok jca@, tom@, guenther@
2016-11-14Copy data by using 64-bit loads and stores rather than 32-bitvisa1-1/+53
operations. This about doubles the routine's throughput. No binary change on the 32-bit bootblocks Discussed with miod@ long ago
2016-09-24Add an implementation of __aeabi_ldivmode() and __aeabi_uldivmod(); clangkettenis2-0/+183
generates calls to these functions when compiling an armv7 kernel. Code from NetBSD's unified userland+kernel implementation, with lots of irrelevant (for us) #ifdefs removed. ok patrick@, guenther@
2016-09-22Add aeabi aliases.kettenis1-1/+4
ok guenther@, patrick@
2016-09-01retire sparctedu21-3422/+0
2016-05-11remove hppa64 port, which we never got going beyond broken single users.deraadt7-2035/+0
hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
2016-03-20" the the " -> " the ", or in a couple of cases replace the superfluouskrw1-2/+2
"the" with the obviously intended word. Started with a "the the" spotted by Mihal Mazurek.
2016-03-10more pieces of vaxderaadt7-319/+0
2016-03-07Sync no-argument function declaration and definition by adding (void).naddy2-4/+4
ok mpi@ millert@
2015-10-01Eliminate the last of the LINTEDn and PRINTFLIKEn comments. In oneguenther1-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@
2015-06-08At some point arm moved to a unified syntax for arm and thumb instructions.jsg2-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@
2015-01-19Make some $OpenBSD$ lines prettier/standardier by eliminatingkrw1-1/+1
superflous '*' after '/*' and adding blank after terminating '$'. Also eases parsing of the lines by simple awk scripts. Aesthetic approval from tedu@.
2015-01-15Sync with libc version.millert2-43/+42
2014-12-30unifdef __APCS_26__ we don't run on anything with a 26 bit program counter.jsg5-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.
2014-12-20Replacing <machine/endian.h> with <sys/endian.h> does not imply removingmiod2-0/+4
<sys/types.h>. kthxbye
2014-12-19Use <sys/endian.h> instead of <machine/endian.h>guenther2-4/+2
ok dlg@ mpi@ bcook@ millert@ miod@
2014-12-19sync with libc, using brnz,pt instead, should be betterderaadt1-5/+4
ok kettenis
2014-12-09Like libc, also for the kernel: Import new amd64 assembly versions ofreyk4-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@
2014-11-29it should not be necessary to clear the direction flagtedu16-26/+8
ok deraadt
2014-11-21mask off high bits from 'c', before operation, otherwise the packingderaadt1-0/+1
logic writes balony. Hunting with tedu, mlarkin, and final bit spotted by naddy in freebsd's version.
2014-11-09typomiod1-2/+2
2014-07-13KASSERTMSG(9): New kernel assertion with messageuebayasi1-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@
2014-07-01Make normalizeRoundAndPackFloat{32,64} non-static; they will be used outsidemiod1-3/+6
of softfloat.c shortly.
2014-06-21Protect explicit_bzero() from link-time optimizationmatthew1-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
2014-06-10mop up #ifdef _KERNEL goo; ok miodderaadt21-106/+30
2014-03-18Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingmiod18-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.
2014-01-19Initialize ci_randseed better using arc4random() + a trick. Remove thederaadt2-17/+4
libkern srandom() API since it is not suitable for this use. ok kettenis miod