Commit Graph

2387 Commits

Author SHA1 Message Date
John Baldwin
87dd2f95d2 Add a new helper function for PCI devices to locate the upstream
PCI-express root port of a given PCI device.

Reviewed by:	kib, imp
MFC after:	1 week
Sponsored by:	Chelsio
Differential Revision:	https://reviews.freebsd.org/D4089
2015-11-05 21:27:25 +00:00
John Baldwin
ec603c7297 Add helper routines for PCI device drivers to read, write, and modify
PCI-Express capability registers (that is, PCI config registers in the
standard PCI config space belonging to the PCI-Express capability
register set).

Note that all of the current PCI-e registers are either 16 or 32-bits,
so only widths of 2 or 4 bytes are supported.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Chelsio
Differential Revision:	https://reviews.freebsd.org/D4088
2015-11-05 21:26:06 +00:00
Warner Losh
c64c9b8e46 BUS_ADD_CHILD calls device_add_child. device_add_child does not call
BUS_ADD_CHILD. Make it explicit since it follows the command paradigm
rather than the callback paradigm. Add other clarifying notes as well.
2015-10-28 19:11:06 +00:00
Conrad Meyer
fb61390c99 sysctl(9): Document U8/U16 types from r289773
Suggested by:	ngie
Sponsored by:	EMC / Isilon Storage Division
2015-10-23 15:08:16 +00:00
Conrad Meyer
9f2eb74093 getenv.9: Document behavior of freeenv(NULL)
Fix a couple igor(1)-indicated spelling issues while here.

Suggested by:	jhb
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 16:46:30 +00:00
Conrad Meyer
8b584e9d74 cpuset.9: Link to/from the new page
A follow-up to r289667.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 23:52:37 +00:00
Conrad Meyer
5546be25d6 Document cpuset(9)
A follow-up to r289467.

Coerced by:	jhb
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 23:48:14 +00:00
Conrad Meyer
7ebf41220c Document bitset(9) 2015-10-17 19:55:58 +00:00
Enji Cooper
f2e3428854 Remove MLINKS to more non-existent mbuf(9) macros
X-MFC with: r288295
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-09-27 04:55:43 +00:00
Enji Cooper
c91afdd4d0 Posthumously remove all references to MFREE(9)
The macro was removed in r90227

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-09-27 04:40:54 +00:00
Mark Johnston
e19a95e53b Document the interface for applying advice up to the end of a file.
MFC after:	3 days
2015-09-26 22:20:11 +00:00
Conrad Meyer
0d27967e31 Document bus_get_resource(9).
Suggested by:	Francois Tigeot
Obtained from:	DragonFlyBSD 09301a2b29f3ae5edd39a858f909f8770372f71e
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 14:52:47 +00:00
Hans Petter Selasky
c55f4c9445 Revert r287780 until more developers have their say.
Differential Revision:	https://reviews.freebsd.org/D3521
Requested by:		gnn
2015-09-22 06:51:55 +00:00
Sergey Kandaurov
0eea5207a0 Bump .Dd. 2015-09-15 13:24:52 +00:00
Hans Petter Selasky
9acc0eafd7 Implement callout_drain_async(), inspired by the projects/hps_head
branch.

This function is used to drain a callout via a callback instead of
blocking the caller until the drain is complete. Refer to the
callout_drain_async() manual page for a detailed description.

Limitation: If a lock is used with the callout, the callout can only
be drained asynchronously one time unless the callout_init_mtx()
function is called again. This limitation is not present in
projects/hps_head and will require more invasive changes to the
timeout code, which was not in the scope of this patch.

Differential Revision:	https://reviews.freebsd.org/D3521
Reviewed by:		wblock
MFC after:		1 month
2015-09-14 10:52:26 +00:00
Mark Johnston
99fdade2c6 Document stack_save_td(9) and stack_save_td_running(9).
Reviewed by:	wblock
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3243
2015-09-11 03:56:04 +00:00
Xin LI
28ffe927c2 Expose an interface to determine if an ACE is inherited.
Submitted by:	sef
Reviewed by:	trasz
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3540
2015-09-04 00:14:20 +00:00
Mark Johnston
e98a67279a nv.h lives in sys/ as of r279439. 2015-08-28 00:12:59 +00:00
Warner Losh
ae1f3df434 New 1-Wire bus implementation. 1-Wire controller is abstracted, though
only gpiobus configured via FDT is supported. Bus enumeration is
supported. Devices are created for each device found. 1-Wire
temperature controllers are supported, but other drivers could be
written. Temperatures are polled and reported via a sysctl.  Errors
are reported via sysctl counters. Mis-wired bus detection is included
for more trouble shooting. See ow(4), owc(4) and ow_temp(4) for
details of what's supported and known issues.

This has been tested on Raspberry Pi-B, Pi2 and Beagle Bone Black
with up to 7 devices.

Differential Revision: https://reviews.freebsd.org/D2956
Relnotes: yes
MFC after: 2 weeks
Reviewed by: loos@ (with many insightful comments)
2015-08-27 23:33:38 +00:00
Bryan Drewery
75824a7b3e Remove reference to non-existent kern_openat(9).
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2015-08-20 22:14:43 +00:00
Bryan Drewery
7ec1b6b672 Add link for rw_unlock(9) to rwlock(9).
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2015-08-20 18:22:06 +00:00
Mariusz Zaborski
347a39b4a6 Add support for the arrays in nvlist library.
- Add
  nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist,
  descriptor} functions.
- Add support for (un)packing arrays.
- Add the nvl_array_next field to the nvlist structure.
  If an array is added by the nvlist_{move,add}_nvlist_array function
  this field will contains next element in the array.
- Add the nitems field to the nvpair and nvpair_header structure.
  This field contains number of elements in the array.
- Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of
  an array.
- Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only
  on packing/unpacking.
- Add new API for traversing arrays (nvlist_get_array_next).
- Add the nvlist_get_pararr function which combines the
  nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in
  the array it will return next element from array. If nvlist is last
  element in array or it isn't in array it will return his
  container (parent). This function should simplify traveling over nvlist.
- Add tests for new features.
- Add documentation for new functions.
- Add my copyright.
- Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file.

PR:		191083
Reviewed by:	allanjude (doc)
Approved by:	pjd (mentor)
2015-08-15 06:34:49 +00:00
Alan Cox
cff0a327b8 Stop describing an acquire operation as a read barrier and a release
operation as a write barrier.  That description has never been correct,
and it has caused confusion.  An acquire operation orders writes as well
as reads, and a release operation orders reads as well as writes.

Also, explicitly say that a thread doesn't see its own accesses being
reordered.  The reordering of a thread's accesses is only (potentially)
visible to another thread.  Thus, memory barriers need only be used to
control the ordering of accesses between threads, not within a thread.

Reviewed by:	bde, kib
Discussed with:	jhb
MFC after:	1 week
2015-08-14 17:49:03 +00:00
Christian Brueffer
548afe2bec Fix mandoc warnings/errors.
MFC after:	1 week
2015-08-12 11:56:19 +00:00
Mariusz Zaborski
89ca10c6e2 Make the nvlist_next(9) function handle NULL pointer variable.
This simplifies removing the first element from nvlist.

Reviewed by:	AllanJude
Approved by:	pjd (mentor)
2015-08-11 17:41:32 +00:00
Alan Cox
a61bd9573f Revise the text about the atomicity of the defined operations across
multiple processors.  In particular, clearly state that the operations
are always atomic when they are applied to the default memory type
that is used by the kernel (and applications).

Reviewed by:	kib, jhb (an earlier version)
MFC after:	1 week
2015-08-09 07:45:15 +00:00
Jason A. Harmening
cbaa6a0e0c Create man page for pmap_quick_enter_page(9) and pmap_quick_remove_page(9)
Reviewed by:	kib, brueffer, wblock
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D3312
2015-08-07 12:13:15 +00:00
Edward Tomasz Napierala
cdc3449233 Revert r286236; vgonel() is a static function.
Sponsored by:	The FreeBSD Foundation
2015-08-04 08:16:18 +00:00
Edward Tomasz Napierala
6a968be547 Document vgonel(9).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-08-03 16:30:47 +00:00
John-Mark Gurney
94d919b999 mark this function as deprecated, and put the warning first, since I
doubt most people will read to the end...  Note the use of sys/cdefs.h
for pre-C11 compilers...

I didn't included a note about being compatibile w/ userland since a
C11 feature should be obviously usable in userland...

Suggested by:	imp
2015-08-02 00:22:14 +00:00
John-Mark Gurney
215397449a The implementation note isn't true anymore..
Not that anyone reads it, but those that do, remind them that this
isn't usable in userland...  I can't wait till this doc is wrong..
2015-07-31 03:28:02 +00:00
Warner Losh
aa255ef6dd Teach sysctl about the new optional suffix after IK to specify
precision. Update input as well. Add IK to the manual (it was missing
completely).

Differential Revision: https://reviews.freebsd.org/D3181
2015-07-29 02:34:25 +00:00
Edward Tomasz Napierala
208a8b9532 Update Capsicum and Mandatory Access Control manual pages
to no longer claim they are experimental.

Reviewed by:	rwatson@, wblock@
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2985
2015-07-25 15:56:49 +00:00
Ed Schouten
50f960e60e Fix a small typo: "the the".
Spotted by:	wblock
2015-07-16 15:43:55 +00:00
Ed Schouten
707d98fe2f Implement the CloudABI random_get() system call.
The random_get() system call works similar to getentropy()/getrandom()
on OpenBSD/Linux. It fills a buffer with random data.

This change introduces a new function, read_random_uio(), that is used
to implement read() on the random devices. We can call into this
function from within the CloudABI compatibility layer.

Approved by:	secteam
Reviewed by:	jmg, markm, wblock
Obtained from:	https://github.com/NuxiNL/freebsd
Differential Revision:	https://reviews.freebsd.org/D3053
2015-07-14 18:45:15 +00:00
Christian Brueffer
9870187435 Markup fixes. 2015-07-13 15:26:03 +00:00
Christian Brueffer
647cdd025a Fix a typo and duplicate word. 2015-07-13 14:25:15 +00:00
John-Mark Gurney
f405d8eb61 some additional improvements to the documentation...
Sponsored by:	Netflix, Inc.
2015-07-11 04:20:56 +00:00
John-Mark Gurney
94b591186d yet more documentation improvements... Many changes were made to the
OCF w/o documentation...

Document the new (8+ year old) device_t way of handling things, that
_unregister_all will leave no threads in newsession, the _SYNC flag,
the requirement that a flag be specified...

Other minor changes like breaking up a wall of text into paragraphs...
2015-07-08 22:46:45 +00:00
Patrick Kelsey
fe3ff217dd Replace use of .Po Pc with the preferred .Pq for single line
enclosures in iovctl.conf(5), iovctl(8), pci(9), and
pci_iov_schema(9).

Differential Revision: https://reviews.freebsd.org/D3000
Reviewed by: wblock
Approved by: jmallett (mentor)
2015-07-08 16:16:44 +00:00
Warner Losh
abb14e5ded The results of the vote are in. This reflects that vote. Single
line statements inside of braces is recognized as an acceptable
style.
	http://reviews.freebsd.org/V3
As always, this isn't license for wholesale change, etc.
2015-07-06 20:10:47 +00:00
Mark Johnston
4b4ad3a219 Rename the dtrace-* man pages to dtrace_* for consistency with other
subsection man pages (e.g. geom_*, mac_*, snd_*).
2015-07-05 23:23:12 +00:00
Konstantin Belousov
e6e979f5d0 Document the locking context for the directly dispatched callouts.
Cross-reference timeout(9).

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-07-05 19:29:24 +00:00
Mariusz Zaborski
58c86148dd Move nvlist documentation to the FreeBSD Kernel Developer's sections.
Approved by:	pjd (mentor)
2015-07-04 10:27:30 +00:00
John-Mark Gurney
e08d13cf83 more word smithing wrt the crd_inject field...
We've already defined IV earlier, so no need to expand it a second
time here...
2015-07-03 01:55:06 +00:00
John-Mark Gurney
2ca5eb5d2d update the documentation of the _IV_ flags... _IV_PRESENT doesn't
mean what you think it should...  This will be fixed in the future
with a flag rename, but document what the flag really does and make
the _IV_ flags clear what their presents (or lack there of) means...

Reviewed by:	gnn, eri (both earlier version)
2015-07-03 00:37:16 +00:00
John-Mark Gurney
0812640475 add units to the length and count so that it's clear what they
are measured in...  Gems like: "len is the length of the buffer."
aren't useful in man pages.
2015-06-30 19:06:14 +00:00
Mark Murray
c4f9c760c9 Updated random(4) boot/shutdown scripting.
Fix the man pages as well.

Differential Revision: https://reviews.freebsd.org/D2924
Approved by: so (delphij)
2015-06-30 17:09:41 +00:00
Mark Murray
d1b06863fb Huge cleanup of random(4) code.
* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
  neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
  random(4) device in the kernel, and the KERN_ARND sysctl will
  return nothing. With RANDOM_DUMMY there will be a random(4) that
  always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
  through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
  suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
  This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
  there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
  behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
  (direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
  weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
  weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
  when the dust settles.
- Use macros for locks.
- Fix comments.

* src/share/man/...
- Update the man pages.

* src/etc/...
- The startup/shutdown work is done in D2924.

* src/UPDATING
- Add UPDATING announcement.

* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.

* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.

* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.

* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
  selection is the way to go.

* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.

* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.

* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
  that instead. All that is needed here is N=0, N++, N==0, and some
  localised trickery is used to manufacture a 128-bit 0ULLL.

* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
  now the test will do a basic check of compressibility. Clairvoyant
  talent is still a good idea.
- This is still a long way off a proper unit test.

* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])

* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.

Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)
2015-06-30 17:00:45 +00:00
Konstantin Belousov
7705435606 The barriers, provided by _acq and _rel atomics, are acquire and
release barriers, not read and write barriers.  They fence all memory
accesses from the respective side, not limited by the kind of
operation.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-06-20 17:18:46 +00:00