summaryrefslogtreecommitdiff
path: root/sys/lib
AgeCommit message (Collapse)Author
2014-12-30unifdef __APCS_26__ we don't run on anything with a 26 bit program counter.Jonathan Gray
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 removingMiod Vallat
<sys/types.h>. kthxbye
2014-12-19Use <sys/endian.h> instead of <machine/endian.h>Philip Guenther
ok dlg@ mpi@ bcook@ millert@ miod@
2014-12-19sync with libc, using brnz,pt instead, should be betterTheo de Raadt
ok kettenis
2014-12-09Like libc, also for the kernel: Import new amd64 assembly versions ofReyk Floeter
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 flagTed Unangst
ok deraadt
2014-11-21mask off high bits from 'c', before operation, otherwise the packingTheo de Raadt
logic writes balony. Hunting with tedu, mlarkin, and final bit spotted by naddy in freebsd's version.
2014-11-20Yet more #include de-duplication.Kenneth R Westerback
ok deraadt@ tedu@
2014-11-19Sprinkle const whenever possible.Miod Vallat
2014-11-19Move {recv,send}udp() out of net.c into their own file; to be used shortly.Miod Vallat
Add the new files to the few md libsa builds which require it.
2014-11-19Ansify.Miod Vallat
2014-11-19Make the past-ELAST libsa-specific errno values contiguous.Miod Vallat
2014-11-19Remove braindead prototype for a nonexistent function.Miod Vallat
2014-11-19Sprinkle const in static (internal) routines.Miod Vallat
2014-11-18Nuke yet more obvious #include duplications.Kenneth R Westerback
ok miod@
2014-11-09typoMiod Vallat
2014-10-26Read the section header string table in the boot blocks' memory, not in theMiod Vallat
loaded image area.
2014-10-09ddb: add support for DWARF line number decodingMatthew Dempsky
This allows ddb's "trace" command to include file and line numbers: ddb{0}> trace Debugger() at Debugger+0x9 [../../../../arch/amd64/amd64/db_interface.c:405] ddb_sysctl() at ddb_sysctl+0x1b4 [../../../../ddb/db_usrreq.c:104] sys___sysctl() at sys___sysctl+0x216 [../../../../kern/kern_sysctl.c:229] syscall() at syscall+0x297 [../../../../sys/syscall_mi.h:84] --- syscall (number 202) --- end of kernel end trace frame: 0x7f7ffffcf1d7, count: -4 acpi_pdirpa+0x4117aa: For this to work, it requires using a new version of boot(8), and booting a kernel with the .debug_line section present (e.g., building with ``makeoptions DEBUG="-g"'' and then booting the bsd.gdb kernel instead of the stripped bsd kernel). Still a WIP, but no failure reports yet. Committing so further development and testing can happen in tree. prodding deraadt, guenther, mlarkin ok mpi
2014-07-22use NULL instead of (foo *)0; Kent R. SpillnerTheo de Raadt
2014-07-22remove unneccessary casts; Kent R. SpillnerTheo de Raadt
2014-07-16zap trailing newlines; "go for it" deraadtOkan Demirmen
2014-07-13KASSERTMSG(9): New kernel assertion with messageMasao Uebayashi
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-13obvious conversion to mallocarray()Theo de Raadt
2014-07-13Stop using old n_long and n_short types.Martin Pieuchot
2014-07-13move putchar() into libsaJasper Lievisse Adriaanse
"sure" miod@
2014-07-12move getchar() into libsa where applicableJasper Lievisse Adriaanse
ok miod@
2014-07-12guenther (who also should have been credited in previous free size commits)Ted Unangst
noticed that i missed committing one file.
2014-07-01Make normalizeRoundAndPackFloat{32,64} non-static; they will be used outsideMiod Vallat
of softfloat.c shortly.
2014-06-21Protect explicit_bzero() from link-time optimizationMatthew Dempsky
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-10Rearrange the inequality.Brad Smith
Pointed out by LLVM. tftp.c:331:17: error: comparison of unsigned expression < 0 is always false From NetBSD ok miod@
2014-06-10mop up #ifdef _KERNEL goo; ok miodTheo de Raadt
2014-05-21Typo in comment noticed during some recent hibernate debugging. No codeMike Larkin
change.
2014-04-29Fix typo: d_addrt -> daddr_tDavid Coppa
ok bmercer@
2014-04-16Add ufs2 support and get one step closer to making ffs2 bootable. This work ↵Brandon Mercer
was done by Pedro Martelletto for bitrig. One small tweak to make it buildable with -Werror. "Please commit" miod@
2014-03-28Fix alignment of tftp structure by changing the 'header' member's typePhilip Guenther
to a struct with the necessary alignment. analysis and ok kettenis@
2014-03-18Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingMiod Vallat
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-02-25Do not actually write to the area spanned by the PT_OPENBSD_RANDOMIZE ifMiod Vallat
LOAD_DATA is not set in flags; allows a two-pass kernel load using COUNT_KERNEL and then LOAD_KERNEL to work; similar to sparc loadfile_sparc.c 1.3.
2014-01-19Initialize ci_randseed better using arc4random() + a trick. Remove theTheo de Raadt
libkern srandom() API since it is not suitable for this use. ok kettenis miod
2014-01-09tiny tweak to asm. prefer memcpy and memmove, with bcopy wrapperTed Unangst
ok guenther
2013-12-28Try to load entropy data from disk:/etc/random.seed, and additionallyTheo de Raadt
use a MD-supplied random function. Then, insert this into the ELF openbsd.randomdata of the kernel, so that it has entropy right from the start. Some help from jsing for the softraid aspects. Also tested by phessler
2013-11-12avoid math on void * pointersTheo de Raadt
(a few years ago, people went far too void * happy, it was like a drug or something)
2013-10-17more a.out/ecoff removal; ok phesslerTheo de Raadt
2013-07-11add fls/flsl functions to find the last bit set in a valueJonathan Gray
from FreeBSD ok mikeb@ haesbaert@ deraadt@
2013-07-05VAX ELF kernel bits.Miod Vallat
2013-06-17m68k kernel memcpy/memmove/bcopy implementation in libkern, remove ovbcopy, ↵Janne Johansson
fix for larger than 128k size copies. Parts from deraadt@, ok (and off-by-one fix) miod@
2013-06-15Fast memmove() implementation for PowerPC, from NetBSD via martin@; withMiod Vallat
bcopy() and memcpy() wrappers.
2013-06-15Fix evil typo causing the wrong pointer to be returned for < 32 bytesMiod Vallat
memcpy() or memmove().
2013-06-15Preserve %o5 around Lbcopy_doubles; prevents the return value from memcpy()Miod Vallat
and memmove() to be incorrect for copies of 32 bytes or more, when the source and destination addresses are nicely aligned.
2013-06-15Make bcopy() involve memmove(), not memcpy().Miod Vallat
Do not bogusly return NULL if dst == src (spotted by tedu@)
2013-06-15Correctly handle a length of zero in memcpy().Miod Vallat
Return the original destination pointer in memcpy() and memmove().