Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys m_copyback, m_copyback_cow, m_copydata:



details:   https://anonhg.NetBSD.org/src/rev/8f0358e0bdd4
branches:  trunk
changeset: 569827:8f0358e0bdd4
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Sep 08 12:00:28 2004 +0000

description:
m_copyback, m_copyback_cow, m_copydata:
- caddr_t -> void *
- constify.
partly from openbsd.

diffstat:

 sys/kern/uipc_mbuf.c |  13 ++++++++-----
 sys/sys/mbuf.h       |   8 ++++----
 2 files changed, 12 insertions(+), 9 deletions(-)

diffs (81 lines):

diff -r dddca288021f -r 8f0358e0bdd4 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Wed Sep 08 11:59:01 2004 +0000
+++ b/sys/kern/uipc_mbuf.c      Wed Sep 08 12:00:28 2004 +0000
@@ -115,7 +115,7 @@
 
 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 @@
  * 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 @@
  * 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 @@
 }
 
 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 @@
 }
 
 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);
diff -r dddca288021f -r 8f0358e0bdd4 sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Wed Sep 08 11:59:01 2004 +0000
+++ b/sys/sys/mbuf.h    Wed Sep 08 12:00:28 2004 +0000
@@ -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 @@
 #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);



Home | Main Index | Thread Index | Old Index