m_copyback, m_copyback_cow, m_copydata:

- caddr_t -> void *
- constify.
partly from openbsd.
This commit is contained in:
yamt 2004-09-08 12:00:28 +00:00
parent 80c1fe0c1d
commit 7b09a1e089
2 changed files with 12 additions and 9 deletions

View File

@ -115,7 +115,7 @@ struct pool_allocator mclpool_allocator = {
static struct mbuf *m_copym0(struct mbuf *, int, int, int, int);
static struct mbuf *m_split0(struct mbuf *, int, int, int);
static int m_copyback0(struct mbuf **, int, int, caddr_t, int, int);
static int m_copyback0(struct mbuf **, int, int, const void *, int, int);
/* flags for m_copyback0 */
#define M_COPYBACK0_COPYBACK 0x0001 /* copyback from cp */
@ -665,9 +665,10 @@ nospace:
* continuing for "len" bytes, into the indicated buffer.
*/
void
m_copydata(struct mbuf *m, int off, int len, caddr_t cp)
m_copydata(struct mbuf *m, int off, int len, void *vp)
{
unsigned count;
char *cp = vp;
if (off < 0 || len < 0)
panic("m_copydata");
@ -1062,7 +1063,7 @@ m_devget(char *buf, int totlen, int off0, struct ifnet *ifp,
* chain if necessary.
*/
void
m_copyback(struct mbuf *m0, int off, int len, caddr_t cp)
m_copyback(struct mbuf *m0, int off, int len, const void *cp)
{
#if defined(DEBUG)
struct mbuf *origm = m0;
@ -1085,7 +1086,7 @@ m_copyback(struct mbuf *m0, int off, int len, caddr_t cp)
}
struct mbuf *
m_copyback_cow(struct mbuf *m0, int off, int len, caddr_t cp, int how)
m_copyback_cow(struct mbuf *m0, int off, int len, const void *cp, int how)
{
int error;
@ -1141,12 +1142,14 @@ m_makewritable(struct mbuf **mp, int off, int len, int how)
}
int
m_copyback0(struct mbuf **mp0, int off, int len, caddr_t cp, int flags, int how)
m_copyback0(struct mbuf **mp0, int off, int len, const void *vp, int flags,
int how)
{
int mlen;
struct mbuf *m, *n;
struct mbuf **mp;
int totlen = 0;
const char *cp = vp;
KASSERT(mp0 != NULL);
KASSERT(*mp0 != NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbuf.h,v 1.97 2004/09/08 11:59:01 yamt Exp $ */
/* $NetBSD: mbuf.h,v 1.98 2004/09/08 12:00:28 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2001 The NetBSD Foundation, Inc.
@ -815,10 +815,10 @@ void m_claimm(struct mbuf *, struct mowner *);
#endif
void m_clget(struct mbuf *, int);
int m_mballoc(int, int);
void m_copyback(struct mbuf *, int, int, caddr_t);
struct mbuf *m_copyback_cow(struct mbuf *, int, int, caddr_t, int);
void m_copyback(struct mbuf *, int, int, const void *);
struct mbuf *m_copyback_cow(struct mbuf *, int, int, const void *, int);
int m_makewritable(struct mbuf **, int, int, int);
void m_copydata(struct mbuf *, int, int, caddr_t);
void m_copydata(struct mbuf *, int, int, void *);
void m_freem(struct mbuf *);
void m_reclaim(void *, int);
void mbinit(void);