aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add support for reading MAM attributes to camcontrol(8) and libcam(3).Kenneth D. Merry2015-06-094-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAM is Medium Auxiliary Memory and is most commonly found as flash chips on tapes. This includes support for reading attributes and decoding most known attributes, but does not yet include support for writing attributes or reporting attributes in XML format. libsbuf/Makefile: Add subr_prf.c for the new sbuf_hexdump() function. This function is essentially the same function. libsbuf/Symbol.map: Add a new shared library minor version, and include the sbuf_hexdump() function. libsbuf/Version.def: Add version 1.4 of the libsbuf library. libutil/hexdump.3: Document sbuf_hexdump() alongside hexdump(3), since it is essentially the same function. camcontrol/Makefile: Add attrib.c. camcontrol/attrib.c: Implementation of READ ATTRIBUTE support for camcontrol(8). camcontrol/camcontrol.8: Document the new 'camcontrol attrib' subcommand. camcontrol/camcontrol.c: Add the new 'camcontrol attrib' subcommand. camcontrol/camcontrol.h: Add a function prototype for scsiattrib(). share/man/man9/sbuf.9: Document the existence of sbuf_hexdump() and point users to the hexdump(3) man page for more details. sys/cam/scsi/scsi_all.c: Add a table of known attributes, text descriptions and handler functions. Add a new scsi_attrib_sbuf() function along with a number of other related functions that help decode attributes. scsi_attrib_ascii_sbuf() decodes ASCII format attributes. scsi_attrib_int_sbuf() decodes binary format attributes, and will pass them off to scsi_attrib_hexdump_sbuf() if they're bigger than 8 bytes. scsi_attrib_vendser_sbuf() decodes the vendor and drive serial number attribute. scsi_attrib_volcoh_sbuf() decodes the Volume Coherency Information attribute that LTFS writes out. sys/cam/scsi/scsi_all.h: Add a number of attribute-related structure definitions and other defines. Add function prototypes for all of the functions added in scsi_all.c. sys/kern/subr_prf.c: Add a new function, sbuf_hexdump(). This is the same as the existing hexdump(9) function, except that it puts the result in an sbuf. This also changes subr_prf.c so that it can be compiled in userland for includsion in libsbuf. We should work to change this so that the kernel hexdump implementation is a wrapper around sbuf_hexdump() with a statically allocated sbuf with a drain. That will require a drain function that goes to the kernel printf() buffer that can take a non-NUL terminated string as input. That is because an sbuf isn't NUL-terminated until it is finished, and we don't want to finish it while we're still using it. We should also work to consolidate the userland hexdump and kernel hexdump implemenatations, which are currently separate. This would also mean making applications that currently link in libutil link in libsbuf. sys/sys/sbuf.h: Add the prototype for sbuf_hexdump(), and add another copy of the hexdump flag values if they aren't already defined. Ideally the flags should be defined in one place but the implemenation makes it difficult to do properly. (See above.) Sponsored by: Spectra Logic Corporation MFC after: 1 week Notes: svn path=/head/; revision=284192
* Sync with NetBSD:Baptiste Daroussin2015-06-072-19/+20
| | | | | | | | | | | | | - fix types of rl_completion_entry_function and rl_add_defun - call update pos before completion to refresh the screen From Thomas Eriksson Adjust API to a more modern readline (Ryo Onodera) remove duplicate declaration Notes: svn path=/head/; revision=284108
* Set the correct register when calling sigprocmask in longjmp.Andrew Turner2015-06-061-1/+1
| | | | | | | | Submitted by: Patrick Wildt <patrick@bitrig.org> Obtained from: drahn@bitrig.org Notes: svn path=/head/; revision=284053
* strchr(3): Mdoc fixes.Jilles Tjoelker2015-06-041-3/+5
| | | | Notes: svn path=/head/; revision=284001
* revert r283969,283970 not needed anymore after r283981Baptiste Daroussin2015-06-044-53/+4
| | | | Notes: svn path=/head/; revision=283984
* Remove unused variable and silence clang warnings.Marcelo Araujo2015-06-041-2/+0
| | | | | | | | Differential Revision: D2681 Reviewed by: rodrigc Notes: svn path=/head/; revision=283976
* Clean up unused variable and silence clang warnings.Marcelo Araujo2015-06-041-3/+0
| | | | | | | | Differential Revision: D2682 Reviewed by: rodrigc Notes: svn path=/head/; revision=283975
* Remove unused variables and silence clang warnings.Marcelo Araujo2015-06-041-4/+2
| | | | | | | | Differential Revision: D2686 Reviewed by: rodrigc Notes: svn path=/head/; revision=283974
* Capitalize the list of accepted variablesBaptiste Daroussin2015-06-031-3/+3
| | | | | | | Suggested by: wblock Notes: svn path=/head/; revision=283970
* Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) exceptBaptiste Daroussin2015-06-034-4/+53
| | | | | | | | | | | it takes a new argument allowing to specify the endianness of the database to generate Differential Revision: https://reviews.freebsd.org/D2730 Reviewed by: ian Notes: svn path=/head/; revision=283969
* Fix typoBaptiste Daroussin2015-06-031-2/+2
| | | | Notes: svn path=/head/; revision=283964
* Remove unused variable allocated_ctx reported by clang.Marcelo Araujo2015-06-021-5/+1
| | | | | | | | Differential Revision: D2684 Reviewed by: rodrigc Notes: svn path=/head/; revision=283906
* Remove unused variable spotted by clang.Marcelo Araujo2015-06-011-2/+2
| | | | | | | | Differential Revision: D2685 Reviewed by: rodrigc, stas Notes: svn path=/head/; revision=283868
* Fix a debug statement. Only the callback function (performing theDevin Teske2015-06-011-1/+1
| | | | | | | | | | | incrementing of dpv_overall_oread) knows what its purpose is (and often times it was bytes, not lines). MFC after: 3 days X-MFC-to: stable/10 Notes: svn path=/head/; revision=283863
* Use proper prototype for harmless().Craig Rodrigues2015-05-311-1/+1
| | | | Notes: svn path=/head/; revision=283835
* Make x_putlong() and x_putbytes() prototypes match theCraig Rodrigues2015-05-311-2/+2
| | | | | | | prototypes in <rpc/xdr.h> Notes: svn path=/head/; revision=283834
* Use ANSI C prototypes.Craig Rodrigues2015-05-318-275/+116
| | | | Notes: svn path=/head/; revision=283833
* Add the needed if-then instructions to build as Thumb-2.Andrew Turner2015-05-316-0/+53
| | | | Notes: svn path=/head/; revision=283831
* Remove __ARM_EABI__ from more places in libc as this is the only ARM ABIAndrew Turner2015-05-313-19/+7
| | | | | | | we support. Notes: svn path=/head/; revision=283824
* Use a register to set the cpsr bits. The ip register is safe to be changedAndrew Turner2015-05-312-8/+12
| | | | | | | | | | | within all of these functions, and is only stored in some to correctly pad the stack. This will be needed to build as Thumb-2 as, unlike with ARM instructions, the msr instruction only takes a register as the input. Notes: svn path=/head/; revision=283807
* Removed unused special fork() implementations.Brooks Davis2015-05-293-107/+1
| | | | | | | | | | | | | | The arm version hasn't been used in ages. The mips version uses a valid, but pointless check of v1 and has been unhooked from the build since r276630. Differential Revision: https://reviews.freebsd.org/D2592 Reviewed by: emaste Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=283751
* Fix __fpclassifyl when double == long double. As with r283693 this isAndrew Turner2015-05-291-0/+10
| | | | | | | | | needed on ARM and PowerPC. MFC after: 1 Week Notes: svn path=/head/; revision=283694
* Fix __isinfl on architectures where double == long double. This is theAndrew Turner2015-05-291-3/+5
| | | | | | | | | case on at least ARM and PowerPC. MFC after: 1 week Notes: svn path=/head/; revision=283693
* Export a list of VM objects in the system via a sysctl. The list can beJohn Baldwin2015-05-274-2/+174
| | | | | | | | | | | | | examined via 'vmstat -o'. It can be used to determine which files are using physical pages of memory and how much each is using. Differential Revision: https://reviews.freebsd.org/D2277 Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Norse Corp, Inc. (forward porting to HEAD/10) Notes: svn path=/head/; revision=283624
* Add <sys/user.h> to the SYNOPSIS of the kinfo_get*() functions since theseJohn Baldwin2015-05-274-4/+8
| | | | | | | | | functions all return types that are defined in that header. MFC after: 1 week Notes: svn path=/head/; revision=283622
* Update to ELF Tool Chain r3223Ed Maste2015-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Highlights (upstream revisions): - Fix SHT_GROUP handling in elfcopy/strip (3206 3220 3221) - Misc elfcopy / strip bug fixes (3215 3216 3217) - Many C++ demangler improvements (3199 3200 3201 3202 3203 3204 3205 3208 3210 3211 3212) - Improve GNU binutils compatibility in elfcopy / strip (3213 3214) - Add -g option to readelf(1): dump contents of section groups (3219) - Add EM_IAMCU 32-bit Intel MCU (3198) Also add a compat #define for building with older FreeBSD ELF headers. The GRP_COMDAT flag was added to elf_common.h in r283110, but it's not available during the bootstrap build. It is also convenient to be able to build on older hosts. Thanks to antoine@ for tracking down issues through multiple exp-runs and to kaiw@ for fixing. PR: 198611 (exp-run), 200350 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=283616
* memmem(3): empty little string matches the beginning of the big stringEd Maste2015-05-262-11/+17
| | | | | | | | | | | | | | | This function originated in glibc, and this matches their behaviour (and NetBSD, OpenBSD, and musl). An empty big string (arg "l") is handled by the existing l_len < s_len test. Reviewed by: bapt, ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2657 Notes: svn path=/head/; revision=283584
*-. Upgrade our copy of clang and llvm to 3.6.1 release.Dimitry Andric2015-05-256-13/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This release contains the following cherry-picked revisions from upstream trunk: 226124 226151 226164 226165 226166 226407 226408 226409 226652 226905 226983 227084 227087 227089 227208 227209 227210 227211 227212 227213 227214 227269 227430 227482 227503 227519 227574 227822 227986 227987 227988 227989 227990 228037 228038 228039 228040 228188 228189 228190 228273 228372 228373 228374 228403 228765 228848 228918 229223 229225 229226 229227 229228 229230 229234 229235 229236 229238 229239 229413 229507 229680 229750 229751 229752 229911 230146 230147 230235 230253 230255 230469 230500 230564 230603 230657 230742 230748 230956 231219 231237 231245 231259 231280 231451 231563 231601 231658 231659 231662 231984 231986 232046 232085 232142 232176 232179 232189 232382 232386 232389 232425 232438 232443 232675 232786 232797 232943 232957 233075 233080 233351 233353 233409 233410 233508 233584 233819 233904 234629 234636 234891 234975 234977 235524 235641 235662 235931 236099 236306 236307 Please note that from 3.5.0 onwards, clang and llvm require C++11 support to build; see UPDATING for more information. Notes: svn path=/head/; revision=283526
| | * Vendor import of llvm RELEASE_361/final tag r237755 (effectively, 3.6.1 ↵vendor/llvm/llvm-release_361-r237755vendor/llvm/llvm-3.6.xDimitry Andric2015-05-2180-1266/+1945
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | release): https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_361/final@237755 Notes: svn path=/vendor/llvm/dist/; revision=283176 svn path=/vendor/llvm/llvm-3.6.x/; revision=283619; tag=vendor/llvm/llvm-3.6.x
| * | Vendor import of clang RELEASE_361/final tag r237755 (effectively, 3.6.1 ↵vendor/clang/clang-release_361-r237755vendor/clang/clang-3.6.xDimitry Andric2015-05-2117-81/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | release): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_361/final@237755 Notes: svn path=/vendor/clang/dist/; revision=283178 svn path=/vendor/clang/clang-3.6.x/; revision=283621; tag=vendor/clang/clang-3.6.x
* | | Remove SUBDIR_DEPEND for non-existent libreadline directoryEnji Cooper2015-05-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | libreadline lives under gnu/lib MFC after: 1 week Notes: svn path=/head/; revision=283502
* | | When only 2 bytes can be read from a 4 byte UTF-16 character in a base64Tijl Coosemans2015-05-241-24/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encoded chunk of a UTF-7 string, treat that as an incomplete character and return an error instead of a shift sequence and no error. Also check that the low 2 bytes have a valid value. MFC after: 1 week Notes: svn path=/head/; revision=283418
* | | Fix decoding of UTF-7 when a base64 encoded chunk appears at the end ofTijl Coosemans2015-05-241-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the input buffer. _citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it could restore this state on an incomplete character such that the next call would restart the decoding. The problem was that "-" (end of base64 mode) at the end of a string was also treated as an incomplete character but was also removed from the state buffer. So the initial state would be restored (with base64 mode) and the next call would no longer see the "-" so it continued in base64 mode. This state saving/restoring isn't needed here. It's already handled elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just remove it. Also initialise *nresult. PR: 200398 Tested by: delphij MFC after: 1 week Notes: svn path=/head/; revision=283406
* | | Remove the stray DEBUG_FLAGS=-g line that snuck in with theWarner Losh2015-05-211-1/+0
| | | | | | | | | | | | | | | | | | | | | soft-updates journaling project merge in r207141. Notes: svn path=/head/; revision=283243
* | | Drop libmandoc and incorporate it into the main mandoc MakefileBaptiste Daroussin2015-05-212-45/+0
| | | | | | | | | | | | | | | | | | | | | | | | This simplifies maintainance of mandoc(1). Note that the same direction was taken on OpenBSD Notes: svn path=/head/; revision=283220
* | | Remove clause 3 and 4 from the licenseBaptiste Daroussin2015-05-211-2/+0
| | | | | | | | | | | | | | | | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=283201
* | | Create links to the libprocstat man pages for all of the libprocstat ↵Allan Jude2015-05-212-26/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions so they can be looked up by name Add a cross refrence to libprocstat in the procstat.1 man page Differential Revision: https://reviews.freebsd.org/D2578 Suggested by: jmg Reviewed by: brueffer Approved by: wblock (mentor) MFC after: 1 week Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=283167
* | | Remove the write-only variable phent. We currently do not check theKonstantin Belousov2015-05-201-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size of the program header's entries. Reported by: adrian (by using gcc 4.9) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=283153
* | | Fix underlinkingBaptiste Daroussin2015-05-191-0/+2
| | | | | | | | | | | | Notes: svn path=/head/; revision=283132
* | | All FreeBSD platforms are elf: move i386-elf to i386Ed Maste2015-05-196-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a leftover from when we had both i386 a.out and ELF. Reviewed by: kib, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2591 Notes: svn path=/head/; revision=283125
* | | Use fixed enum values for PMC_CLASSES().John Baldwin2015-05-191-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes one of the frequent causes of ABI breakage when new CPU types are added to hwpmc(4). Differential Revision: https://reviews.freebsd.org/D2586 Reviewed by: davide, emaste, gnn (earlier version) MFC after: 2 weeks Notes: svn path=/head/; revision=283120
* | | Add Performance Monitoring Counters support for AArch64.Ruslan Bukin2015-05-191-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Family-common and CPU-specific counters implemented. Supported CPUs: ARM Cortex A53/57/72. Reviewed by: andrew, bz, emaste, gnn, jhb Sponsored by: ARM Limited Differential Revision: https://reviews.freebsd.org/D2555 Notes: svn path=/head/; revision=283112
* | | Synchronize libedit with NetBSDBaptiste Daroussin2015-05-188-72/+116
| | | | | | | | | | | | | | | | | | | | | | | | It incorporates and fixes our patches to get el_gets return the proper count of characters in unicode mode. Notes: svn path=/head/; revision=283084
* | | Drop some unnecessary casts.Pedro F. Giffuni2015-05-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | Reported by: Clang static analyzer Obtained from: NetBSD Notes: svn path=/head/; revision=283068
* | | In r279493, the functions pzero[f](), qzero[f], pone[f](),Steve Kargl2015-05-174-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and qone[f]() were marked as __inline, but their forward declarations were not updated. Fix the forward declarations to match the actual function declarations. Requested by: bde Notes: svn path=/head/; revision=283032
* | | Some third-party malloc(3) implementations use pthread_setspecific(3)Konstantin Belousov2015-05-151-110/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to handle per-thread information. Since our pthread_setspecific() implementation calls calloc(3) to allocate per-thread specific data storage, things get complicated. Switch the allocator to use bare mmap(2). There is some loss of the allocated page, since e.g. on amd64, PTHREAD_KEYS_MAX * sizeof(struct pthread_specific_elem) is 3K (it actually spans whole page due to padding), but I believe it is more acceptable than additional code for specialized allocator(). The alternatives would either to make the specific data array be part of the struct thread, or use internal bindings to call the libc malloc, avoiding interposing. Also do the style pass over the thr_spec.c, esp. simplify the conditionals nesting by returning early when an error detected. Remove trivial comments. Found by: yuri@rawbw.com PR: 200138 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=282948
* | | Update to ELF Tool Chain r3197Ed Maste2015-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Highlights: - Fix man page markup, whitespace, and typos - Fix sh_info of SHT_GROUP section to point to the correct string - Improve validation in readelf and elfcopy/strip - Handle DWARF 4's DW_AT_high_pc in addr2line Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282918
* | | Add fabs() to arm64 libcEd Maste2015-05-143-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2532 Notes: svn path=/head/; revision=282909
* | | Remove redundant csu subdir logicEd Maste2015-05-121-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The appropriate subdirectories are handled by lib/csu/Makefile. There's no need to duplicate this logic in Makefile.inc1 and lib/Makefile. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2523 Notes: svn path=/head/; revision=282821
* | | Teach bits of libc about Thumb. This adds the if-then instructions neededAndrew Turner2015-05-125-4/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to handle the ARM conditional execution. While here fix a bug found by this in the hard-float code, cc is the opposite of cs. The former is used for 'less than' in floating-point code and is executed when the C (carry) bit is clear, the latter is used when greater than, equal, or unordered, and is executed when the C bit is set. Notes: svn path=/head/; revision=282816