summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Return 0 instead of garbage value.davidxu2011-01-061-2/+1
| | | | Found by: clang static analyzer
* On i386 and amd64, consistently use the following options whenever wedim2011-01-051-1/+1
| | | | | | want to avoid using any "advanced" CPU features: -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
* In lib/libstand, sys/boot/ficl and sys/boot/zfs, -mno-sse3 should alsodim2011-01-051-4/+1
| | | | be used for amd64, not just for i386.
* Quiet clang warnings by using string literal format strings.emaste2011-01-041-2/+2
|
* Because sleepqueue may still being used, we should always check wchan withdavidxu2011-01-041-6/+0
| | | | queue locked.
* Switch mips architectures back to libgcc.kan2010-12-291-1/+1
| | | | | | MIPS64 n64 binaries are broken with libcompiler_rt at this time. Switch mips back to libgcc until the cause of breakage is analyzed and fixed.
* Revert most of r210764, now that mdocml does the rightuqs2010-12-283-3/+3
| | | | | | thing with empty quotation macros. Requested by: Alex Kozlov
* Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is onlydavidxu2010-12-241-2/+2
| | | | significant for lock owner.
* Add sleep queue code.davidxu2010-12-221-0/+175
|
* MFp4:davidxu2010-12-229-191/+666
| | | | | | | | | | | | | | | - Add flags CVWAIT_ABSTIME and CVWAIT_CLOCKID for umtx kernel based condition variable, this should eliminate an extra system call to get current time. - Add sub-function UMTX_OP_NWAKE_PRIVATE to wake up N channels in single system call. Create userland sleep queue for condition variable, in most cases, thread will wait in the queue, the pthread_cond_signal will defer thread wakeup until the mutex is unlocked, it tries to avoid an extra system call and a extra context switch in time window of pthread_cond_signal and pthread_mutex_unlock. The changes are part of process-shared mutex project.
* Unbreak the build by temprorarily not using include directives insyrinx2010-12-201-4/+0
| | | | | bsnmpd(1)' def files, until bsd.snmpmod.mk & Makefiles are fixed to pass proper include path flags to gensnmptree.
* Bring in a SNMP module that allows configuration of SNMPv3 Notification targets.syrinx2010-12-201-0/+4
| | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: philip Approved by: philip
* Sort cross references by section.brucec2010-12-181-2/+2
| | | | Reported by: pluknet
* Update shmget(2) with POSIX access permissions and remove non-standard SHM_R,brucec2010-12-173-13/+11
| | | | SHM_W and machine/param.h.
* 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
OpenPOWER on IntegriCloud