freebsd-nq/sys
Ed Schouten 4170b08388 Implement LIST_PREV().
Regular LISTs have been implemented in such a way that the prev-pointer
does not point to the previous element, but to the next-pointer stored
in the previous element. This is done to simplify LIST_REMOVE(). This
macro can be implemented without knowing the address of the list head.

Unfortunately this makes it harder to implement LIST_PREV(), which is
why this macro was never here. Still, it is possible to implement this
macro. If the prev-pointer points to the list head, we return NULL.
Otherwise we simply subtract the offset of the prev-pointer within the
structure.

It's not as efficient as traversing forward of course, but in practice
it shouldn't be that bad. In almost all use cases, people will want to
compare the value returned by LIST_PREV() against NULL, so an optimizing
compiler will not emit code that does more branching than TAILQs.

While there, make the code a bit more readable by introducing
__member2struct(). This makes STAILQ_LAST() far more readable.

MFC after:	1 month
2012-09-12 21:03:48 +00:00
..
amd64 Simplify pmap_unmapdev(). Since kmem_free() eventually calls pmap_remove(), 2012-09-10 16:11:29 +00:00
arm Add device entry for DWC OTG. 2012-09-11 22:13:37 +00:00
boot Make pxe device in lsdev really include device name, looking like this: 2012-09-12 21:00:37 +00:00
bsm
cam Remove some more NetBSD compat shims and other unused bits from these 2012-09-10 18:49:49 +00:00
cddl Merge recent zfs vendor changes, sync code and adjust userland DEBUG. 2012-09-12 18:05:43 +00:00
compat Remove redundant check 2012-09-12 10:12:03 +00:00
conf Remove some trailing whitespace. 2012-09-12 19:36:54 +00:00
contrib Merge the projects/pf/head branch, that was worked on for last six months, 2012-09-08 06:41:54 +00:00
crypto
ddb
dev Fix TX FIFO sizes. Correct FIFO handling in Host mode. 2012-09-12 19:15:29 +00:00
fs Add VFCF_READONLY flag that indicates ntfs and xfs file systems are 2012-09-12 03:42:52 +00:00
gdb
geom When synchronizing, include in the config dump amount of 2012-09-11 20:20:13 +00:00
gnu/fs Add VFCF_READONLY flag that indicates ntfs and xfs file systems are 2012-09-12 03:42:52 +00:00
i386 Simplify pmap_unmapdev(). Since kmem_free() eventually calls pmap_remove(), 2012-09-10 16:11:29 +00:00
ia64 userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +00:00
isa
kern Add a facility for vgone() to inform the set of subscribed mounts 2012-09-09 19:17:15 +00:00
kgssapi
libkern - Move jenkins.h to jenkins_hash.c 2012-09-04 12:07:33 +00:00
mips Simplify pmap_unmapdev(). Since kmem_free() eventually calls pmap_remove(), 2012-09-10 16:11:29 +00:00
modules Remove some trailing whitespace. 2012-09-12 19:36:54 +00:00
net Merge the projects/pf/head branch, that was worked on for last six months, 2012-09-08 06:41:54 +00:00
net80211
netatalk
netgraph
netinet Whitespace changes. 2012-09-09 08:14:04 +00:00
netinet6 Merge the projects/pf/head branch, that was worked on for last six months, 2012-09-08 06:41:54 +00:00
netipsec In NAT-T transport mode, allow a client to open a new connection just after 2012-09-12 12:14:50 +00:00
netipx
netnatm
netncp
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Remove unneeded ipfw headers introduced in r213447 from Infiniband code. 2012-09-04 10:56:30 +00:00
opencrypto
pc98
pci
powerpc userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +00:00
rpc Fix RPC headers for C++ 2012-09-02 21:04:40 +00:00
security
sparc64 userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +00:00
sys Implement LIST_PREV(). 2012-09-12 21:03:48 +00:00
teken
tools
ufs
vm - Simplify VM code by using vmspace_wired_count() for counting wired 2012-09-05 18:19:54 +00:00
x86
xdr
xen
Makefile