summaryrefslogtreecommitdiffstats
path: root/sys/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Yet more #include de-duplication.krw2014-11-201-2/+1
| | | | ok deraadt@ tedu@
* Sprinkle const whenever possible.miod2014-11-1912-44/+44
|
* Move {recv,send}udp() out of net.c into their own file; to be used shortly.miod2014-11-193-206/+259
| | | | Add the new files to the few md libsa builds which require it.
* Ansify.miod2014-11-191-17/+8
|
* Make the past-ELAST libsa-specific errno values contiguous.miod2014-11-191-6/+6
|
* Remove braindead prototype for a nonexistent function.miod2014-11-191-2/+1
|
* Sprinkle const in static (internal) routines.miod2014-11-192-21/+13
|
* Nuke yet more obvious #include duplications.krw2014-11-181-2/+1
| | | | ok miod@
* typomiod2014-11-091-2/+2
|
* Read the section header string table in the boot blocks' memory, not in themiod2014-10-261-2/+2
| | | | loaded image area.
* ddb: add support for DWARF line number decodingmatthew2014-10-091-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* use NULL instead of (foo *)0; Kent R. Spillnerderaadt2014-07-222-9/+9
|
* remove unneccessary casts; Kent R. Spillnerderaadt2014-07-222-3/+3
|
* zap trailing newlines; "go for it" deraadtokan2014-07-161-2/+1
|
* 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@
* obvious conversion to mallocarray()deraadt2014-07-131-4/+1
|
* Stop using old n_long and n_short types.mpi2014-07-1315-120/+108
|
* move putchar() into libsajasper2014-07-133-5/+72
| | | | "sure" miod@
* move getchar() into libsa where applicablejasper2014-07-122-1/+55
| | | | ok miod@
* guenther (who also should have been credited in previous free size commits)tedu2014-07-121-1/+1
| | | | noticed that i missed committing one file.
* 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
* Rearrange the inequality.brad2014-06-101-3/+3
| | | | | | | | | | Pointed out by LLVM. tftp.c:331:17: error: comparison of unsigned expression < 0 is always false From NetBSD ok miod@
* mop up #ifdef _KERNEL goo; ok miodderaadt2014-06-1021-106/+30
|
* Typo in comment noticed during some recent hibernate debugging. No codemlarkin2014-05-211-2/+2
| | | | change.
* Fix typo: d_addrt -> daddr_tdcoppa2014-04-291-1/+1
| | | | ok bmercer@
* Add ufs2 support and get one step closer to making ffs2 bootable. This work was done by Pedro Martelletto for bitrig. One small tweak to make it buildable with -Werror. "Please commit" miod@bmercer2014-04-162-0/+750
|
* Fix alignment of tftp structure by changing the 'header' member's typeguenther2014-03-283-10/+13
| | | | | | to a struct with the necessary alignment. analysis and ok kettenis@
* 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.
* Do not actually write to the area spanned by the PT_OPENBSD_RANDOMIZE ifmiod2014-02-251-5/+10
| | | | | 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.
* 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
* Try to load entropy data from disk:/etc/random.seed, and additionallyderaadt2013-12-282-2/+17
| | | | | | | 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
* avoid math on void * pointersderaadt2013-11-121-13/+13
| | | | | (a few years ago, people went far too void * happy, it was like a drug or something)
* more a.out/ecoff removal; ok phesslerderaadt2013-10-171-298/+1
|
* 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().