summaryrefslogtreecommitdiff
path: root/sys/lib
AgeCommit message (Collapse)Author
2011-07-19we need to alias __movstr* as __movmem* for gcc4Jonathan Gray
from NetBSD. ok miod@ drahn@
2011-07-16Make the updated zlib compile with a debug kernel.Joel Sing
ok deraadt@
2011-07-07Replace the cruddy old sys/net/zlib.[ch]. We now use the sys/lib/libzTheo de Raadt
code. Missing chunks of the API are imported from the libc version, with a few #ifdef's to port it into the kernel environment. The bootblocks already used the newer code, and should encounter no surprises since there are so few changes to the existing files. In the kernel, ipcomp and kernel ppp are changed to the new API. ipcomp has been tested. ok tedu the brave
2011-05-28Do not leak memory if ufs_open() fails; reported by and ok martynas@Miod Vallat
2011-04-14Regen.Joel Sing
2011-04-14Use 64-bit operations for address manipulation.Joel Sing
2011-04-14Correctly load p_addr and avoid trashing the source address.Joel Sing
2011-03-13Change daddr_t to daddr32_t. The bootblocks on our architectures onlyTheo de Raadt
do 32-bit block spanning. If later on we get some that can/should do 64-bit, that can be done now using daddr64_t (but of course, we are taking this step to finalize the daddr_t 64-bit conversion). ok miod krw
2011-03-12syncTheo de Raadt
2011-03-12In the original sparc V7 book (and in the v8 book), the divrem leaf code usedTheo de Raadt
local registers for a few temporaries. This was changed to use two global registers. Maybe to permit use in-kernel without conflicting with the register V7 register window handlers. (Was this done by Chris Torek? Is this related to Gordon Irlam's work? Or was it in NetBSD? Hard to tell because NetBSD removed their original cvs tree.) In V8 the ABI was tightened; more global registers became offlimits in different ways. We started supporting sun4m, and did not consider this. As a result, the global registers chosen are the wrong choice. In particular, %g7 is a poor choice for upcoming TLS work. It looks like it is safer to use %g5 and %g6 since these functions are "system software". All re-entrant parts of the system save it. On sparc64 these functions are in libc per ABI requirement, but are unused. On sparc, they occur in bootblocks (no reentrancy), kernel (reentrancy saves globals; kernel is not ABI compliant), userland libc (signal handlers save globals), and ld.so (symbol binding is not re-entrant on its own). Discussed rather extensively with guenther, kettenis, miod and drahn.
2011-01-27s/DST/DEST/ to avoid warnings when building RAMDISK kernels, which defineMiod Vallat
TIMEZONE and DST...
2011-01-10add a new function, explicit_bzero, to be used for erasing "secret" stuff.Ted Unangst
unlike normal bzero, we guarantee that the compiler will not optimize out calls to this function for otherwise dead variables. to be adjusted as needed when compilers and linkers get smarter. ok deraadt miod
2010-12-06- properly remove NENTS now after fixing the fallout.Jasper Lievisse Adriaanse
ok deraadt@
2010-12-06- partially revert previous NENTS removal for arches which got busted.Jasper Lievisse Adriaanse
2010-12-06- drop NENTS(), which was yet another copy of nitems().Jasper Lievisse Adriaanse
no binary change ok deraadt@
2010-07-20Add OpenSSH's timingsafe_bcmp() to libkern.Matthew Dempsky
ok djm@, deraadt@
2010-05-09shuffle an extern around so gcc4 doesn't whinge about incomplete typesJonathan Gray
as suggested by miod. ok miod@
2010-04-20destintation -> destinationMiod Vallat
2010-04-01Allow for multiple CPUs by moving to an array of cpu_info.Joel Sing
ok kettenis@
2009-12-12Provide a correct version for little endian kernels... sighMiod Vallat
2009-11-30Allow the bootblocks to provide an optional Elfxx_Phdr check, and abort theMiod Vallat
file load if necessary. Will be used very shortly.
2009-11-07remove gcc 1 workaround we no longer care about whichJonathan Gray
was breaking non GNUC defining compilers. Came up during a conversation with ragge@, positive comments from several.
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2009-08-19<machine/macros.h> would provide inline version of a few of the functionsMiod Vallat
traditionnaly found in libkern. However, the memcmp() flavour would behave as bcmp() with only two possible return values: zero and positive non-zero. This broke the name cache RB trees which now rely upon proper memcmp() semantics(negative value, zero, or positive value). Just give up on these macros and provide the same code as libc, in libkern. As a side effect, this no longer uses the cmpc3 instruction, which is not implemented and requires (slow) kernel emulation, on the original uVax.
2009-05-24ansi func declsJonathan Gray
2009-05-14Add two hooks allowing MD code get a MD header to be included if needed,Miod Vallat
and to override the way HEAP_START and HEAP_LIMIT are defined.
2009-03-02Send valid ERROR packets to prematurely terminate a transfer.Kenneth R Westerback
According to RFC1350 there should be always be a terminating NUL. Andre Gillibert on bugs@ pointed out that the misformed packets caused Gentoo Linux's tftpd (atftpd) to crash trying to transfer pxeboot to an OpenBSD machine. This is slightly different diff than the one proposed by Andre, but he confirms it also fixes the problem. "looks like a better diff to me" deraadt@.
2009-01-25memcpy needs a prototype which is in systm.hAlexander Yurchenko
ok form@ kettenis@
2009-01-18If open() failed because the file does not exist, a struct sd for this fileMiod Vallat
won't be allocated. Check for this in close() so as not to free() bogus pointers.
2008-10-15make random(9) return per-cpu values (by saving the seed in the cpuinfo),Theo de Raadt
which are uniform for the profclock on each cpu in a SMP system (but using a different seed for each cpu). on all cpus, avoid seeding with a value out of the [0, 2^31-1] range (since that is not stable) ok kettenis drahn
2008-10-10Use the MI random() for all cases; no need for a MD version since itTheo de Raadt
has never been performance sensitive. Running on all platforms, discussed with millert and kettenis, ok toby
2008-10-07unbreak ieeefp emulation code wrt converting double to unsignedMartynas Venckus
long ints for alpha. we've got only one instruction (cvttq) to convert double-t to quadword, and float64_to_int64 did not take into account the unsigned conversions therefore, overflow always occured, and half of the unsigned range (LONG_MAX .. ULONG_MAX) was broken introduce roundAndPackInt64NoOverflow and float64_to_int64_no_overflow for softfloat, that works with unsigned integers as well. note that this will return zero for nan/inf/oflow/uflow, raising exception flag perl is happy now looked over by miod@ tested by naddy@, and by me on nick@'s alpha
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-05-14These files are not used (and some of them would not compile anyway).Miod Vallat
2008-05-08KNFJoel Sing
2008-05-08Fix alignment - sizeof(long) does not always match the address size of theJoel Sing
ELF image being loaded. ok miod@
2008-04-20Catch up with dismantled libkern.Mark Kettenis
2008-04-20Remove the random() function from locore.s (which used sparcv7 instructions,Mark Kettenis
including mulscc to do multiplications) and switch to the generic random.c code.
2008-04-19Change ELF loader to use the LMA as the load address for theTobias Weingartner
various segments. Hopefully this will help remove various hacks in the boot loader in the future. This should have no effect on most architectures (as we tend to have LMA == VMA). ok drahn@, soft ok's various others.
2008-03-31Correctly load ZMAGIC a.out binaries.Miod Vallat
2008-03-31Fix format strings in a.out loader.Miod Vallat
2008-03-30Let this compile with BOOT_AOUT defined.Miod Vallat
2008-02-25delete prototypes for functions which the kernel does not haveTheo de Raadt
from brynet@gmail.com
2008-01-23Cleanup cn_pri. Change constants to more meaningful names, rather thanJoel Sing
the hp300 related ones currently in use. CN_NORMAL becomes CN_LOWPRI, CN_INTERNAL becomes CN_MIDPRI and CN_REMOTE becomes CN_HIGHPRI. ok miod@
2008-01-06repair build of boot code where it uses an undefind __ashldi3 on some archsOtto Moerbeek
boot code uses 32-bit blknos anyway
2007-12-29Override SoftFloat's countLeadingZeros32() with a faster, ff1-based, versionMiod Vallat
on m88k.
2007-12-29Unifdef NO_IEEE in the libkern softfloat code, and put an appropriate ruleMiod Vallat
in files.alpha to compensate for NO_IEEE kernels. This will allow the softfloat code to be used by other platforms than alpha.
2007-11-28place a comment as to why these are otherwise emptyTheo de Raadt
2007-11-27mips64 also needs memcpy.S, otherwise memcpy.c gets built, which conflictsJoel Sing
with bcopy.S ok miod@
2007-11-26mips64 needs at least these to build; spotted by jsingTheo de Raadt