uipc_mbuf.c (1817) | uipc_mbuf.c (3308) |
---|---|
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$ | 34 * $Id: uipc_mbuf.c,v 1.3 1994/08/02 07:43:02 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#include <sys/map.h> 42#define MBTYPES 43#include <sys/mbuf.h> 44#include <sys/kernel.h> 45#include <sys/syslog.h> 46#include <sys/domain.h> 47#include <sys/protosw.h> 48 49#include <vm/vm.h> 50 | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/malloc.h> 41#include <sys/map.h> 42#define MBTYPES 43#include <sys/mbuf.h> 44#include <sys/kernel.h> 45#include <sys/syslog.h> 46#include <sys/domain.h> 47#include <sys/protosw.h> 48 49#include <vm/vm.h> 50 |
51void m_reclaim __P(()); 52 | |
53extern vm_map_t mb_map; 54struct mbuf *mbutl; 55char *mclrefcnt; 56 57void 58mbinit() 59{ 60 int s; --- 149 unchanged lines hidden (view full) --- 210 register struct mbuf *m; 211{ 212 register struct mbuf *n; 213 214 if (m == NULL) 215 return; 216 do { 217 MFREE(m, n); | 51extern vm_map_t mb_map; 52struct mbuf *mbutl; 53char *mclrefcnt; 54 55void 56mbinit() 57{ 58 int s; --- 149 unchanged lines hidden (view full) --- 208 register struct mbuf *m; 209{ 210 register struct mbuf *n; 211 212 if (m == NULL) 213 return; 214 do { 215 MFREE(m, n); |
218 } while (m = n); | 216 m = n; 217 } while (m); |
219} 220 221/* 222 * Mbuffer utility routines. 223 */ 224 225/* 226 * Lesser-used path for M_PREPEND: --- 223 unchanged lines hidden (view full) --- 450 m->m_pkthdr.len = count; 451 for (; m; m = m->m_next) { 452 if (m->m_len >= count) { 453 m->m_len = count; 454 break; 455 } 456 count -= m->m_len; 457 } | 218} 219 220/* 221 * Mbuffer utility routines. 222 */ 223 224/* 225 * Lesser-used path for M_PREPEND: --- 223 unchanged lines hidden (view full) --- 449 m->m_pkthdr.len = count; 450 for (; m; m = m->m_next) { 451 if (m->m_len >= count) { 452 m->m_len = count; 453 break; 454 } 455 count -= m->m_len; 456 } |
458 while (m = m->m_next) 459 m->m_len = 0; | 457 while (m->m_next) 458 (m = m->m_next) ->m_len = 0; |
460 } 461} 462 463/* 464 * Rearange an mbuf chain so that len bytes are contiguous 465 * and in the data area of an mbuf (so that mtod and dtom 466 * will work for a structure of size len). Returns the resulting 467 * mbuf chain on success, frees it and returns null on failure. --- 197 unchanged lines hidden --- | 459 } 460} 461 462/* 463 * Rearange an mbuf chain so that len bytes are contiguous 464 * and in the data area of an mbuf (so that mtod and dtom 465 * will work for a structure of size len). Returns the resulting 466 * mbuf chain on success, frees it and returns null on failure. --- 197 unchanged lines hidden --- |