uipc_mbuf.c (12662) | uipc_mbuf.c (12819) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 |
34 * $Id: uipc_mbuf.c,v 1.15 1995/12/02 18:58:42 bde Exp $ | 34 * $Id: uipc_mbuf.c,v 1.16 1995/12/07 12:46:59 davidg Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/malloc.h> 41#define MBTYPES 42#include <sys/mbuf.h> --- 14 unchanged lines hidden (view full) --- 57char *mclrefcnt; 58struct mbstat mbstat; 59union mcluster *mclfree; 60int max_linkhdr; 61int max_protohdr; 62int max_hdr; 63int max_datalen; 64 | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/malloc.h> 41#define MBTYPES 42#include <sys/mbuf.h> --- 14 unchanged lines hidden (view full) --- 57char *mclrefcnt; 58struct mbstat mbstat; 59union mcluster *mclfree; 60int max_linkhdr; 61int max_protohdr; 62int max_hdr; 63int max_datalen; 64 |
65static void m_reclaim __P((void)); 66 |
|
65/* ARGSUSED*/ 66static void 67mbinit(dummy) 68 void *dummy; 69{ 70 int s; 71 72#if CLBYTES < 4096 --- 90 unchanged lines hidden (view full) --- 163#undef m_retryhdr 164 if (m != NULL) 165 mbstat.m_wait++; 166 else 167 mbstat.m_drops++; 168 return (m); 169} 170 | 67/* ARGSUSED*/ 68static void 69mbinit(dummy) 70 void *dummy; 71{ 72 int s; 73 74#if CLBYTES < 4096 --- 90 unchanged lines hidden (view full) --- 165#undef m_retryhdr 166 if (m != NULL) 167 mbstat.m_wait++; 168 else 169 mbstat.m_drops++; 170 return (m); 171} 172 |
171void | 173static void |
172m_reclaim() 173{ 174 register struct domain *dp; 175 register struct protosw *pr; 176 int s = splimp(); 177 178 for (dp = domains; dp; dp = dp->dom_next) 179 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) --- 98 unchanged lines hidden (view full) --- 278 return (m); 279} 280 281/* 282 * Make a copy of an mbuf chain starting "off0" bytes from the beginning, 283 * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf. 284 * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller. 285 */ | 174m_reclaim() 175{ 176 register struct domain *dp; 177 register struct protosw *pr; 178 int s = splimp(); 179 180 for (dp = domains; dp; dp = dp->dom_next) 181 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) --- 98 unchanged lines hidden (view full) --- 280 return (m); 281} 282 283/* 284 * Make a copy of an mbuf chain starting "off0" bytes from the beginning, 285 * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf. 286 * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller. 287 */ |
286int MCFail; | 288static int MCFail; |
287 288struct mbuf * 289m_copym(m, off0, len, wait) 290 register struct mbuf *m; 291 int off0, wait; 292 register int len; 293{ 294 register struct mbuf *n, **np; --- 195 unchanged lines hidden (view full) --- 490/* 491 * Rearange an mbuf chain so that len bytes are contiguous 492 * and in the data area of an mbuf (so that mtod and dtom 493 * will work for a structure of size len). Returns the resulting 494 * mbuf chain on success, frees it and returns null on failure. 495 * If there is room, it will add up to max_protohdr-len extra bytes to the 496 * contiguous region in an attempt to avoid being called next time. 497 */ | 289 290struct mbuf * 291m_copym(m, off0, len, wait) 292 register struct mbuf *m; 293 int off0, wait; 294 register int len; 295{ 296 register struct mbuf *n, **np; --- 195 unchanged lines hidden (view full) --- 492/* 493 * Rearange an mbuf chain so that len bytes are contiguous 494 * and in the data area of an mbuf (so that mtod and dtom 495 * will work for a structure of size len). Returns the resulting 496 * mbuf chain on success, frees it and returns null on failure. 497 * If there is room, it will add up to max_protohdr-len extra bytes to the 498 * contiguous region in an attempt to avoid being called next time. 499 */ |
498int MPFail; | 500static int MPFail; |
499 500struct mbuf * 501m_pullup(n, len) 502 register struct mbuf *n; 503 int len; 504{ 505 register struct mbuf *m; 506 register int count; --- 238 unchanged lines hidden --- | 501 502struct mbuf * 503m_pullup(n, len) 504 register struct mbuf *n; 505 int len; 506{ 507 register struct mbuf *m; 508 register int count; --- 238 unchanged lines hidden --- |