summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a memory leak on the error conditionkevlo2010-12-141-1/+1
| | | | Reviewed by: rpaulo
* Check the return value of malloc().kevlo2010-12-141-0/+5
| | | | | Reviewed by: hselasky MFC after: 3 days
* Bump manual page date.trasz2010-12-131-1/+1
|
* After PSARC/2010/029, "canonical six" no longer exists.trasz2010-12-131-1/+3
|
* Fix stack alignment (required to be to 16 bytes) instead of ptrace andnwhitehorn2010-12-112-5/+5
| | | | cerror on powerpc64.
* The use of snprintf() to append to a buffer is not valid according to C99kevlo2010-12-111-1/+2
|
* Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.ctijl2010-12-101-8/+29
| | | | | | | | | in crt1.o. On other architectures crtbrand.c is included from crt1.c, but that's not a C source code file on ia64. Instead it is compiled separately and included in crt1.o using incremental linking. Tested by: dim (previous version) Approved by: kib (mentor)
* Let all .c and .S files under lib/csu consistently use the __FBSDID()dim2010-12-0921-50/+61
| | | | | macro for identification, instead of several different hand-rolled variants (plain .ident, .ascii, etc).
* When reopening a stream backed by an open file descriptor, do not closejhb2010-12-091-12/+9
| | | | | | | | | | | | | the existing file descriptor. Instead, let dup2() atomically close the old file descriptor when assigning the newly opened file to the same descriptor. This closes a race in a multithreaded application where a concurrent open() could allocate the existing file descriptor in between the calls to close() and dup2(). PR: threads/79887 Submitted by: Dmitrij Tejblum tejblum of yandex-team.ru Reviewed by: davidxu MFC after: 1 week
* In bsnmpd(1) add support for SNMPv3 message processing model, including ↵syrinx2010-12-081-2/+9
| | | | | | | | message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). Sponsored by: The FreeBSD Foundation Reviewed by: philip@ (mostly) Approved by: philip@
* Don't write data into an empty "file."kientzle2010-12-073-13/+12
| | | | | | | | In particular, this check avoids a warning when extracting directory entries from certain GNU tar archives that store directory contents. MFC after: 3 days
* Another minor nit: Make sure the constant here is a float so the compilerdas2010-12-071-1/+1
| | | | doesn't promote the entire expression to double.
* Fix various nits in style and comments that were pointed out by bde.das2010-12-074-13/+16
| | | | Code changes verified with md5.
* Add log2() and log2f().das2010-12-058-12/+149
|
* Add a "kernel" log function, based on e_log.c, which is useful fordas2010-12-052-0/+171
| | | | | | | | | | | | | | | implementing accurate logarithms in different bases. This is based on an approach bde coded up years ago. This function should always be inlined; it will be used in only a few places, and rudimentary tests show a 40% performance improvement in implementations of log2() and log10() on amd64. The kernel takes a reduced argument x and returns the same polynomial approximation as e_log.c, but omitting the low-order term. The low-order term is much larger than the rest of the approximation, so the caller of the kernel function can scale it to the appropriate base in extra precision and obtain a much more accurate answer than by using log(x)/log(b).
* Move most of the remaining USD/PSD/SMM papers into share/docuqs2010-12-047-9696/+0
|
* Remove stale link.jh2010-12-041-3/+1
| | | | PR: 151252
* Disable gcc's built-in rint() function when compiling s_nearbyint.c.das2010-12-031-0/+6
| | | | | | | It results in incorrect optimizations that break nearbyint(). PR: 143358 Reviewed by: bde
* Remove two unused variables, left over from the refactoring in r180104.gavin2010-12-021-6/+0
| | | | | | PR: bin/152551 Submitted by: Henning Petersen <henning.petersen t-online.de> MFC after: 2 weeks
* Add Serial Management Protocol (SMP) passthrough support to CAM.ken2010-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes support in the kernel, camcontrol(8), libcam and the mps(4) driver for SMP passthrough. The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00 to determine supported pages, and will now fetch page 0x83 in addition to page 0x80 if supported. Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO. The SMP CCB is intended for SMP requests and responses. The ADVINFO is currently used to fetch cached VPD page 0x83 data from the transport layer, but is intended to be extensible to fetch other types of device-specific data. SMP-only devices are not currently represented in the CAM topology, and so the current semantics are that the SIM will route SMP CCBs to either the addressed device, if it contains an SMP target, or its parent, if it contains an SMP target. (This is noted in cam_ccb.h, since it will change later once we have the ability to have SMP-only devices in CAM's topology.) smp_all.c, smp_all.h: New helper routines for SMP. This includes SMP request building routines, response parsing routines, error decoding routines, and structure definitions for a number of SMP commands. libcam/Makefile: Add smp_all.c to libcam, so that SMP functionality is available to userland applications. camcontrol.8, camcontrol.c: Add smp passthrough support to camcontrol. Several new subcommands are now available: 'smpcmd' functions much like 'cmd', except that it allows the user to send generic SMP commands. 'smprg' sends the SMP report general command, and displays the decoded output. It will automatically fetch extended output if it is available. 'smppc' sends the SMP phy control command, with any number of potential options. Among other things, this allows the user to reset a phy on a SAS expander, or disable a phy on an expander. 'smpmaninfo' sends the SMP report manufacturer information and displays the decoded output. 'smpphylist' displays a list of phys on an expander, and the CAM devices attached to those phys, if any. cam.h, cam.c: Add a status value for SMP errors (CAM_SMP_STATUS_ERROR). Add a missing description for CAM_SCSI_IT_NEXUS_LOST. Add support for SMP commands to cam_error_string(). cam_ccb.h: Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH. SMP commands are by nature bi-directional, and we may need to support bi-directional SCSI commands later. Add the XPT_SMP_IO CCB. Since SMP commands are bi-directional, there are pointers for both the request and response. Add a fill routine for SMP CCBs. Add the XPT_GDEV_ADVINFO CCB. This is currently used to fetch cached page 0x83 data from the transport later, but is extensible to fetch many other types of data. cam_periph.c: Add support in cam_periph_mapmem() for XPT_SMP_IO and XPT_GDEV_ADVINFO CCBs. cam_xpt.c: Add support for executing XPT_SMP_IO CCBs. cam_xpt_internal.h: Add fields for VPD pages 0x00 and 0x83 in struct cam_ed. scsi_all.c: Add scsi_get_sas_addr(), a function that parses VPD page 0x83 data and pulls out a SAS address. scsi_all.h: Add VPD page 0x00 and 0x83 structures, and a prototype for scsi_get_sas_addr(). scsi_pass.c: Add support for mapping buffers in XPT_SMP_IO and XPT_GDEV_ADVINFO CCBs. scsi_xpt.c: In the SCSI probe code, first ask the device for VPD page 0x00. If any VPD pages are supported, that page is required to be implemented. Based on the response, we may probe for the serial number (page 0x80) or device id (page 0x83). Add support for the XPT_GDEV_ADVINFO CCB. sys/conf/files: Add smp_all.c. mps.c: Add support for passing in a uio in mps_map_command(), so we can map a S/G list at once. Add support for SMP passthrough commands in mps_data_cb(). SMP is a special case, because the first buffer in the S/G list is outbound and the second buffer is inbound. Add support for warning the user if the busdma code comes back with more buffers than will work for the command. This will, for example, help the user determine why an SMP command failed if busdma comes back with three buffers. mps_pci.c: Add sys/uio.h. mps_sas.c: Add the SAS address and the parent handle to the list of fields we pull from device page 0 and cache in struct mpssas_target. These are needed for SMP passthrough. Add support for the XPT_SMP_IO CCB. For now, this CCB is routed to the addressed device if it supports SMP, or to its parent if it does not and the parent does. This is necessary because CAM does not currently support SMP-only nodes in the topology. Make SMP passthrough support conditional on __FreeBSD_version >= 900026. This will make it easier to MFC this change to the driver without MFCing the CAM changes as well. mps_user.c: Un-staticize mpi_init_sge() so we can use it for the SMP passthrough code. mpsvar.h: Add a uio and iovecs into struct mps_command for SMP passthrough commands. Add a cm_max_segs field to struct mps_command so that we can warn the user if busdma comes back with too many segments. Clear the cm_reply when a command gets freed. If it is not cleared, reply frames will eventually get freed into the pool multiple times and corrupt the pool. (This fix is from scottl.) Add a prototype for mpi_init_sge(). sys/param.h: Bump __FreeBSD_version to 900026 for the for the inclusion of the XPT_GDEV_ADVINFO and XPT_SMP_IO CAM CCBs.
* Update the documentation to reflect changes to the implementation indas2010-11-301-14/+14
| | | | | | | r197752, which is related to handling of null buffer pointers. Also make a few minor wording changes. Reported by: jh@
* Add <time.h> for ctime(), which we accidentally picked up throughdes2010-11-221-0/+1
| | | | | | | <sys/time.h>. Submitted by: Garrett Cooper <yanegomi@gmail.com> MFC after: 3 days
* Remove obsoleted private symbol.mm2010-11-191-1/+0
| | | | | Approved by: delphij (mentor) MFC after: together with 5.0.0 update
* Correct description of the return values ofhselasky2010-11-181-5/+10
| | | | | | | | the LibUSB v1.0 libusb_control_transfer() function. PR: usb/151851 Submitted by: HIROSHI OOTA Approved by: thompsa (mentor)
* Remove unused autofs userland bits.jhb2010-11-174-859/+0
| | | | Approved by: core
* Don't use -fno-exceptions or -fno-rtti for .c files, when buildingdim2010-11-141-2/+2
| | | | llvm/clang.
* Similar to sys/net/vnet.h, define the linker set name for sys/sys/pcpu.hdim2010-11-142-5/+6
| | | | as a macro, and use it instead of literal strings.
* Always set errno to a sane value when pututxline(3) fails.ed2010-11-141-0/+3
| | | | | For example, it will now return ESRCH when trying to replace a nonexistent entry with DEAD_PROCESS.
* Remove libc_r threading library. It has been disconnected from the buildemaste2010-11-13167-23451/+0
| | | | | | for four years (since r162846). Submitted by: Alexander Best arundel@
* Fix LibUSB v1.0 compliancy.hselasky2010-11-132-4/+11
| | | | | | | | | | 1) We need to allow the USB callback to free the USB transfer itself. 2) The USB transfer buffer should only be automatically freed when freeing the USB transfer. Fixed by: hselasky Submitted by: Gustau Perez i Querol Approved by: thompsa (mentor)
* Fix bug in jn(3) and jnf(3) that led to -inf resultsuqs2010-11-132-2/+12
| | | | | | | | | | | | | | | | | | | | Explanation by Steve: jn[f](n,x) for certain ranges of x uses downward recursion to compute the value of the function. The recursion sequence that is generated is proportional to the actual desired value, so a normalization step is taken. This normalization is j0[f](x) divided by the zeroth sequence member. As Bruce notes, near the zeros of j0[f](x) the computed value can have giga-ULP inaccuracy. I found for the 1st zero of j0f(x) only the leading decimal digit is correct. The solution to the issue is fairly straight forward. The zeros of j0(x) and j1(x) never coincide, so as j0(x) approaches a zero, the normalization constant switches to j1[f](x) divided by the 2nd sequence member. The expectation is that j1[f](x) is a more accurately computed value. PR: bin/144306 Submitted by: Steven G. Kargl <kargl@troutmask.apl.washington.edu> Reviewed by: bde MFC after: 7 days
* Sync with OpenBSD, primarily better signal and terminal handling.delphij2010-11-132-124/+130
| | | | | Obtained from: OpenBSD MFC after: 2 weeks
* Update xz to release 5.0.0mm2010-11-121-3/+4
| | | | | Approved by: delphij (mentor) MFC after: 1 week
* Revert to libgcc for sparc64.ed2010-11-121-3/+5
| | | | | | | | | I've had a report of a sparc64 system where cc1 generates illegal instructions. We still have to diagnose this properly, but instead of hosing all sparc64 boxes out there, fall back to libgcc to prevent more damage. Reported by: Florian Smeets
* This commit implements the SO_USER_COOKIE socket option, which letsluigi2010-11-121-0/+18
| | | | | | | | | | | | | | | | | | | | | | | you tag a socket with an uint32_t value. The cookie can then be used by the kernel for various purposes, e.g. setting the skipto rule or pipe number in ipfw (this is the reason SO_USER_COOKIE has been implemented; however there is nothing ipfw-specific in its implementation). The ipfw-related code that uses the optopn will be committed separately. This change adds a field to 'struct socket', but the struct is not part of any driver or userland-visible ABI so the change should be harmless. See the discussion at http://lists.freebsd.org/pipermail/freebsd-ipfw/2009-October/004001.html Idea and code from Paul Joe, small modifications and manpage changes by myself. Submitted by: Paul Joe MFC after: 1 week
* Make sure to specify the alignment of minbrk and curbrk. They were correctlydim2010-11-112-0/+2
| | | | | | | | aligned by accident with earlier binutils, but no longer are, causing link failures. Submitted by: nwhitehorn Obtained from: projects/binutils-2.17
* Remove some unneeded spaces from the __sym_compat() macro, since newerdim2010-11-111-1/+1
| | | | | versions of gas are more fussy about spaces surrounding '@' signs in versioned symbol names.
* amd64: introduce minidump version 2avg2010-11-111-14/+94
| | | | | | | | | | | | | | | | | | After KVA space was increased to 512GB on amd64 it became impractical to use PTEs as entries in the minidump map of dumped pages, because size of that map alone would already be 1GB. Instead, we now use PDEs as page map entries and employ two stage lookup in libkvm: virtual address -> PDE -> PTE -> physical address. PTEs are now dumped as regular pages. Fixed page map size now is 2MB. libkvm keeps support for accessing amd64 minidumps of version 1. Support for 1GB pages is added. Many thanks to Alan Cox for his guidance, numerous reviews, suggestions, enhancments and corrections. Reviewed by: alc [kernel part] MFC after: 15 days
* Set symbol visibility to hidden.ed2010-11-111-1/+1
| | | | | | | Not doing so may cause all sorts of random libraries to expose libcompiler_rt's functions, which should of course not be done. Discussed with: kan, kib
* Replace libgcc.a by libcompiler_rt.a.ed2010-11-111-0/+2
| | | | | | | | | | | | | | | libcompiler_rt.a is a BSD licensed C language runtime, which implements many routines which are linked into binaries on architectures where certain functionality is missing (e.g. 64 bits mul/div on i386). Unfortunately, libcompiler_rt cannot replace libgcc entirely. Certain features, such as an unwinder for exception handling, are missing. That's why only libgcc.a is replaced for now, because this one does seem to be complete. Tested by: rene (amd64), nwhitehorn (powerpc), droso (i386 exprun) and many others. Thanks! Obtained from: user/ed/compiler-rt
* Import libcompiler_rt into HEAD and add Makefiles.ed2010-11-113-0/+184
|\ | | | | | | Obtained from: user/ed/compiler-rt
| * Import compiler-rt r117047.ed2010-10-21210-0/+11184
|
* If the Zip reader doesn't see a PK signature blockkientzle2010-11-073-3/+93
| | | | | | | | because there's inter-entry garbage, just scan forward to find the next one. This allows us to handle a lot of Zip archives that have been modified in-place. Thanks to: Gleb Kurtsou for sending me a sample archive
* Add minidump support for MIPSgonzo2010-11-074-11/+318
|
* Fix manpage markup.uqs2010-11-063-4/+2
|
* Clarify the naming: Methods that free an object shouldkientzle2010-11-0513-77/+114
| | | | | be called "free". Retain the old "finish" names to preserve source compatibility for now.
* Add a new libc function: cfmakesane(3).ed2010-11-024-6/+37
| | | | | | | | | | | I've noticed various terminal emulators that need to obtain a sane default termios structure use very complex `hacks'. Even though POSIX doesn't provide any functionality for this, extend our termios API with cfmakesane(3), which is similar to the commonly supported cfmakeraw(3), except that it fills the termios structure with sane defaults. Change all code in our base system to use this function, instead of depending on <sys/ttydefaults.h> to provide TTYDEF_*.
* Use sysctl kern.sched.cpusetsize to retrieve size of kernel cpuset.davidxu2010-11-021-8/+5
|
* Prep for the 9.6-ESV-R2 updatedougb2010-10-312-5/+22
|
* When the make target is 'install', don't descend into the clangrpaulo2010-10-301-3/+5
| | | | | libraries subdirectories since there's nothing to do there. This saves us quite a few seconds off installworld, esp. if the disk I/O is slow.
OpenPOWER on IntegriCloud