aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo.David Xu2011-01-111-1/+1
| | | | | | | Submitted by: avg Notes: svn path=/head/; revision=217253
* For the process that already loaded libthr but still not initializedKonstantin Belousov2011-01-101-0/+26
| | | | | | | | | | threading, fall back to libc method of performing __pthread_map_stacks_exec() job. Reported and tested by: Mykola Dzham <i levsha me> Notes: svn path=/head/; revision=217224
* Revert part of r217071 so that us mere mortals can clearly seeDoug Barton2011-01-091-1/+5
| | | | | | | | | what this bit of code is intended to do. :) Approved by: imp Notes: svn path=/head/; revision=217213
* Implement the __pthread_map_stacks_exec() for libthr.Konstantin Belousov2011-01-095-1/+53
| | | | | | | | | | | | | | | Stack creation code is changed to call _rtld_get_stack_prot() to get the stack protection right. There is a race where thread is created during dlopen() of dso that requires executable stacks. Then, _rtld_get_stack_prot() may return PROT_READ | PROT_WRITE, but thread is still not linked into the thread list. In this case, the callback misses the thread stack, and rechecks the required protection afterward. Reviewed by: davidxu Notes: svn path=/head/; revision=217191
* Implement __pthread_map_stacks_exec() callback for libc, to change theKonstantin Belousov2011-01-083-0/+39
| | | | | | | stack protection to allow execution for single-threaded processes. Notes: svn path=/head/; revision=217154
* Fix some style(9) issues.Konstantin Belousov2011-01-081-4/+5
| | | | | | | | | | Do not use strlcpy() where simple assignment is enough. Noted by: bde (long time ago) MFC after: 1 week Notes: svn path=/head/; revision=217144
* Fix struct FILE * leak on error (in disabled by default hesiod support code).Konstantin Belousov2011-01-081-0/+1
| | | | | | | | | Submitted by: henning petersen <henning.petersen t-online de> PR: 153756 MFC after: 1 week Notes: svn path=/head/; revision=217143
* Retire TARGET_ABI.Warner Losh2011-01-071-5/+1
| | | | | | | | | | | | | | | | | | Implement MACHINE_ARCH=mips64e[lb] to build N64 images. This replaces MACHINE_ARCH=mipse[lb] TARGET_ABI=n64. MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires WITHOUT_CDDL due to atomic issues in libzfs. I've not investigated this much, but implemented this to preserve as much of the TARGET_ABI functionality that I could. Since its presence doesn't affect the working cases, I've kept it in for now. Added mips64e[lb] to make universe, so more kernels build. And I think this (finally) closes the curtain on the tbemd tree. Notes: svn path=/head/; revision=217123
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-0768-0/+136
| | | | Notes: svn path=/head/; revision=217108
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-072-0/+4
| | | | Notes: svn path=/head/; revision=217107
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-0772-0/+142
| | | | Notes: svn path=/head/; revision=217106
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-075-0/+10
| | | | Notes: svn path=/head/; revision=217105
* Fix braino in r217101. -Wa is used to supply assembler flag to cc driver.Konstantin Belousov2011-01-071-1/+1
| | | | | | | Noted by: Anonymous <swell.k gmail com> Notes: svn path=/head/; revision=217102
* On amd64 and i386, force assembler to mark objects compiled from theKonstantin Belousov2011-01-071-0/+6
| | | | | | | | | | | assembler source for libcompiler_rt as not needed executable stack. This is done with a hammer instead of properly marking each assembly file with section .note.GNU-stack to avoid modifying contributed source. Discussed with: ed Notes: svn path=/head/; revision=217101
* Emit .note.GNU-stack for the syscall stubs generated by libc.Konstantin Belousov2011-01-071-0/+2
| | | | Notes: svn path=/head/; revision=217099
* Make this work on big endian MIPS, while not breaking it for smallWarner Losh2011-01-061-7/+3
| | | | | | | | endian mips. This will also make it work automatically on all future big endian platforms. Notes: svn path=/head/; revision=217071
* Return 0 instead of garbage value.David Xu2011-01-061-2/+1
| | | | | | | Found by: clang static analyzer Notes: svn path=/head/; revision=217047
* On i386 and amd64, consistently use the following options whenever weDimitry Andric2011-01-051-1/+1
| | | | | | | | | want to avoid using any "advanced" CPU features: -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float Notes: svn path=/head/; revision=217033
* In lib/libstand, sys/boot/ficl and sys/boot/zfs, -mno-sse3 should alsoDimitry Andric2011-01-051-4/+1
| | | | | | | be used for amd64, not just for i386. Notes: svn path=/head/; revision=217029
* Quiet clang warnings by using string literal format strings.Ed Maste2011-01-041-2/+2
| | | | Notes: svn path=/head/; revision=216953
* Because sleepqueue may still being used, we should always check wchan withDavid Xu2011-01-041-6/+0
| | | | | | | queue locked. Notes: svn path=/head/; revision=216949
* Switch mips architectures back to libgcc.Alexander Kabaev2010-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. Notes: svn path=/head/; revision=216804
* Revert most of r210764, now that mdocml does the rightUlrich Spörlein2010-12-283-3/+3
| | | | | | | | | thing with empty quotation macros. Requested by: Alex Kozlov Notes: svn path=/head/; revision=216756
* Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is onlyDavid Xu2010-12-241-2/+2
| | | | | | | significant for lock owner. Notes: svn path=/head/; revision=216687
* Add sleep queue code.David Xu2010-12-221-0/+175
| | | | Notes: svn path=/head/; revision=216642
* MFp4:David Xu2010-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. Notes: svn path=/head/; revision=216641
* Unbreak the build by temprorarily not using include directives inShteryana Shopova2010-12-201-4/+0
| | | | | | | | bsnmpd(1)' def files, until bsd.snmpmod.mk & Makefiles are fixed to pass proper include path flags to gensnmptree. Notes: svn path=/head/; revision=216605
* Bring in a SNMP module that allows configuration of SNMPv3 Notification targets.Shteryana Shopova2010-12-201-0/+4
| | | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: philip Approved by: philip Notes: svn path=/head/; revision=216594
* Sort cross references by section.Rebecca Cran2010-12-181-2/+2
| | | | | | | Reported by: pluknet Notes: svn path=/head/; revision=216515
* Update shmget(2) with POSIX access permissions and remove non-standard SHM_R,Rebecca Cran2010-12-173-13/+11
| | | | | | | SHM_W and machine/param.h. Notes: svn path=/head/; revision=216508
* Fix a memory leak on the error conditionKevin Lo2010-12-141-1/+1
| | | | | | | Reviewed by: rpaulo Notes: svn path=/head/; revision=216432
* Check the return value of malloc().Kevin Lo2010-12-141-0/+5
| | | | | | | | Reviewed by: hselasky MFC after: 3 days Notes: svn path=/head/; revision=216431
* Bump manual page date.Edward Tomasz Napierala2010-12-131-1/+1
| | | | Notes: svn path=/head/; revision=216416
* After PSARC/2010/029, "canonical six" no longer exists.Edward Tomasz Napierala2010-12-131-1/+3
| | | | Notes: svn path=/head/; revision=216415
* Fix stack alignment (required to be to 16 bytes) instead of ptrace andNathan Whitehorn2010-12-112-5/+5
| | | | | | | cerror on powerpc64. Notes: svn path=/head/; revision=216381
* The use of snprintf() to append to a buffer is not valid according to C99Kevin Lo2010-12-111-1/+2
| | | | Notes: svn path=/head/; revision=216369
* Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.cTijl Coosemans2010-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) Notes: svn path=/head/; revision=216351
* Let all .c and .S files under lib/csu consistently use the __FBSDID()Dimitry Andric2010-12-0921-50/+61
| | | | | | | | macro for identification, instead of several different hand-rolled variants (plain .ident, .ascii, etc). Notes: svn path=/head/; revision=216338
* When reopening a stream backed by an open file descriptor, do not closeJohn Baldwin2010-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 Notes: svn path=/head/; revision=216334
* In bsnmpd(1) add support for SNMPv3 message processing model, including ↵Shteryana Shopova2010-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@ Notes: svn path=/head/; revision=216294
* Don't write data into an empty "file."Tim 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 Notes: svn path=/head/; revision=216258
* Another minor nit: Make sure the constant here is a float so the compilerDavid Schultz2010-12-071-1/+1
| | | | | | | doesn't promote the entire expression to double. Notes: svn path=/head/; revision=216248
* Fix various nits in style and comments that were pointed out by bde.David Schultz2010-12-074-13/+16
| | | | | | | Code changes verified with md5. Notes: svn path=/head/; revision=216247
* Add log2() and log2f().David Schultz2010-12-058-12/+149
| | | | Notes: svn path=/head/; revision=216211
* Add a "kernel" log function, based on e_log.c, which is useful forDavid Schultz2010-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). Notes: svn path=/head/; revision=216210
* Move most of the remaining USD/PSD/SMM papers into share/docUlrich Spörlein2010-12-047-9696/+0
| | | | Notes: svn path=/head/; revision=216178
* Remove stale link.Jaakko Heinonen2010-12-041-3/+1
| | | | | | | PR: 151252 Notes: svn path=/head/; revision=216177
* Disable gcc's built-in rint() function when compiling s_nearbyint.c.David Schultz2010-12-031-0/+6
| | | | | | | | | | It results in incorrect optimizations that break nearbyint(). PR: 143358 Reviewed by: bde Notes: svn path=/head/; revision=216137
* Remove two unused variables, left over from the refactoring in r180104.Gavin Atkinson2010-12-021-6/+0
| | | | | | | | | PR: bin/152551 Submitted by: Henning Petersen <henning.petersen t-online.de> MFC after: 2 weeks Notes: svn path=/head/; revision=216121
* Add Serial Management Protocol (SMP) passthrough support to CAM.Kenneth D. Merry2010-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. Notes: svn path=/head/; revision=216088