Merge in Lite2: clean up casts for architectures where the size of addresses

are bigger than the size of ints
		add function prototypes
		reorder some fields
Did not add prototype for m_reclaim().  It's only used in kern/uipc_mbuf.c and
  is declared static there.
Reviewed by:	davidg & bde
This commit is contained in:
Jeffrey Hsu 1996-03-11 02:14:16 +00:00
parent 269f85f0de
commit d6c32e1b47
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14491

View File

@ -30,8 +30,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.3 (Berkeley) 1/21/94
* $Id: mbuf.h,v 1.12 1995/12/14 08:32:33 phk Exp $
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
* $Id: mbuf.h,v 1.15 1996/02/25 23:34:03 hsu Exp $
*/
#ifndef _SYS_MBUF_H_
@ -62,25 +62,25 @@
* mtocl(x) - convert pointer within cluster to cluster index #
* cltom(x) - convert cluster # to ptr to beginning of cluster
*/
#define mtod(m,t) ((t)((m)->m_data))
#define dtom(x) ((struct mbuf *)((int)(x) & ~(MSIZE-1)))
#define mtocl(x) (((u_int)(x) - (u_int)mbutl) >> MCLSHIFT)
#define cltom(x) ((caddr_t)((u_int)mbutl + ((u_int)(x) << MCLSHIFT)))
#define mtod(m,t) ((t)((m)->m_data))
#define dtom(x) ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
#define mtocl(x) (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
#define cltom(x) ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
/* header at beginning of each mbuf: */
struct m_hdr {
struct mbuf *mh_next; /* next buffer in chain */
struct mbuf *mh_nextpkt; /* next chain in queue/record */
int mh_len; /* amount of data in this mbuf */
caddr_t mh_data; /* location of data */
int mh_len; /* amount of data in this mbuf */
short mh_type; /* type of data in this mbuf */
short mh_flags; /* flags; see below */
};
/* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
struct pkthdr {
int len; /* total packet length */
struct ifnet *rcvif; /* rcv interface */
struct ifnet *rcvif; /* rcv interface */
int len; /* total packet length */
};
/* description of external storage mapped into mbuf, valid if M_EXT set */
@ -219,8 +219,7 @@ union mcluster {
MBUFLOCK( \
if (mclfree == 0) \
(void)m_clalloc(1, (how)); \
(p) = (caddr_t)mclfree; \
if ((p)) { \
if (((p) = (caddr_t)mclfree) != 0) { \
++mclrefcnt[mtocl(p)]; \
mbstat.m_clfree--; \
mclfree = ((union mcluster *)(p))->mcl_next; \
@ -369,24 +368,24 @@ extern int max_hdr; /* largest link+protocol header */
extern int max_datalen; /* MHLEN - max_hdr */
extern int mbtypes[]; /* XXX */
int m_clalloc __P((int, int));
void m_copyback __P((struct mbuf *, int, int, caddr_t));
struct mbuf *m_retry __P((int, int));
struct mbuf *m_retryhdr __P((int, int));
struct mbuf *m_get __P((int, int));
struct mbuf *m_gethdr __P((int, int));
struct mbuf *m_getclr __P((int, int));
struct mbuf *m_free __P((struct mbuf *));
void m_freem __P((struct mbuf *));
struct mbuf *m_prepend __P((struct mbuf *,int,int));
struct mbuf *m_copym __P((struct mbuf *, int, int, int));
void m_copydata __P((struct mbuf *,int,int,caddr_t));
void m_cat __P((struct mbuf *,struct mbuf *));
void m_adj __P((struct mbuf *,int));
struct mbuf *m_pullup __P((struct mbuf *, int));
struct mbuf *m_split __P((struct mbuf *,int,int));
struct mbuf *m_devget __P((char *, int, int, struct ifnet *,
void (*copy)(char *, caddr_t, u_int)));
struct mbuf *m_free __P((struct mbuf *));
struct mbuf *m_get __P((int, int));
struct mbuf *m_getclr __P((int, int));
struct mbuf *m_gethdr __P((int, int));
struct mbuf *m_prepend __P((struct mbuf *,int,int));
struct mbuf *m_pullup __P((struct mbuf *, int));
struct mbuf *m_retry __P((int, int));
struct mbuf *m_retryhdr __P((int, int));
struct mbuf *m_split __P((struct mbuf *,int,int));
void m_adj __P((struct mbuf *, int));
void m_cat __P((struct mbuf *,struct mbuf *));
int m_clalloc __P((int, int));
void m_copyback __P((struct mbuf *, int, int, caddr_t));
void m_copydata __P((struct mbuf *,int,int,caddr_t));
void m_freem __P((struct mbuf *));
#ifdef MBTYPES
int mbtypes[] = { /* XXX */