make functions which are used to replace inline code static inline, to keep the performance characteristics of current code.
resolve conflicts, kill remaining caddr_t.
new NetBSD sources, after the caddr_t removal.
resolve conflicts from boolean_t changes.
new NetBSD sources, after the boolean_t changes.
resolve conflicts.
new NetBSD sources
Swap the 2nd and 3rd argument of mptr* and m_datarange*, to be consistent with other mbuf functions which accept "off and "len" arguments. Thanks to Xrefactory, http://xref-tech.com
add forgotten parentheses around macro argument.
In m_move_pkthdr, dont't forget to update m_contig after the packet header has been removed. Extract a common macro M_CLEAR_PKTHDR for this.
more verbose panic message.
move the debugging check for consistent m_pkthdr.len to m_length.
Move the new inline functions from mbuf.h to uipc_mbuf.c for easier debugging. Correct operator in the flags-manipulating macros.
forgot a semicolon
add a fourth "flags" argument to the mptr and mptr_rw macros, with the same values as for m_datarange. mptr_pullup now becomes mptr(..., MP_PULLUP).
use M_ADJSTART in M_PREPEND, and reset m_contig at more places.
Add a m_contig member to struct mbuf, which describes how much data is guaranteed to be contiguous. Add macros to manipulate m_data and m_len, which take care of updating m_contig. (If m_data and m_len are manipulated directly, nothing bad happens, only it may happen that a contiguous region is created when not necessary.) Adapt the mbuf routines to those macros. Adapt m_pulldown0 (the backend for mptr* and m_pulldown) to respect m_contig.
Add m_datarange and m_datarange_rw functions, which correspond to mptr_pullup and mptr_rw macros, but without the sizeof magic - they accept an explicit "len" argument. Rename some flags to the m_pulldown0 internal function and add new flags to request blocking allocation, alignment and leading space in a newly allocated mbuf. (The intent is to duplicate the functionality of m_copyup.) The new functions accept those flags, too. Change the semantics of mptr a bit - now it assumes that all the data are in the first mbuf, even in the case ofa nonzero offset. Revert to upstream version 1.110 of uipc_mbuf.c, this is what corresponds to my kernel snapshot.
delete an incorrect optimization.
Introduce a mptr_pullup(struct mbuf **mp, type, int off) macro, which returns a pointer to the data at offset off in the mbuf chain **mp, cast to a const pointer to type, while ensuring that (sizeof type) is contiguous. Also introduce a mptr macro, which does not make the data contiguous, only checks this and panic if they are not.
Eliminate an unnecessary difference from the original in-kernel version.
import of the original NetBSD files, 2nd attempt.
Subset of kernel sources suitable for being compiled in userland. Includes uipc_mbuf.c, uipc_mbuf2.c, mbuf.h and everything needed by them to compile and being usable for userland programs (typically unit tests). Target platform is Valgrind on Linux/i386, tested with a sample program (not included). Could work under NetBSD/i386 too, but untested. Other platforms will need different machine directories. The Makefiles are for GNU Make.
Initial revision
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.