Page MenuHomeFreeBSD

D60736.diff
No OneTemporary

D60736.diff

diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -648,7 +648,7 @@
}
static void
-m_copyfromunmapped(const struct mbuf *m, int off, int len, caddr_t cp)
+m_copyfromunmapped(const struct mbuf *m, int off, int len, void *data)
{
struct iovec iov;
struct uio uio;
@@ -658,7 +658,7 @@
KASSERT(len >= 0, ("m_copyfromunmapped: negative len %d", len));
KASSERT(off < m->m_len,
("m_copyfromunmapped: len exceeds mbuf length"));
- iov.iov_base = cp;
+ iov.iov_base = data;
iov.iov_len = len;
uio.uio_resid = len;
uio.uio_iov = &iov;
@@ -676,8 +676,9 @@
* continuing for "len" bytes, into the indicated buffer.
*/
void
-m_copydata(const struct mbuf *m, int off, int len, caddr_t cp)
+m_copydata(const struct mbuf *m, int off, int len, void *data)
{
+ char *cp = data;
u_int count;
KASSERT(off >= 0, ("m_copydata, negative off %d", off));
@@ -695,7 +696,7 @@
if ((m->m_flags & M_EXTPG) != 0)
m_copyfromunmapped(m, off, count, cp);
else
- bcopy(mtod(m, caddr_t) + off, cp, count);
+ bcopy(mtod(m, char *) + off, cp, count);
len -= count;
cp += count;
off = 0;
@@ -1248,7 +1249,7 @@
}
static void
-m_copytounmapped(const struct mbuf *m, int off, int len, c_caddr_t cp)
+m_copytounmapped(const struct mbuf *m, int off, int len, const void *data)
{
struct iovec iov;
struct uio uio;
@@ -1257,7 +1258,7 @@
KASSERT(off >= 0, ("m_copytounmapped: negative off %d", off));
KASSERT(len >= 0, ("m_copytounmapped: negative len %d", len));
KASSERT(off < m->m_len, ("m_copytounmapped: len exceeds mbuf length"));
- iov.iov_base = __DECONST(caddr_t, cp);
+ iov.iov_base = __DECONST(void *, data);
iov.iov_len = len;
uio.uio_resid = len;
uio.uio_iov = &iov;
@@ -1276,8 +1277,9 @@
* chain if necessary.
*/
void
-m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp)
+m_copyback(struct mbuf *m0, int off, int len, const void *data)
{
+ const char *cp = data;
int mlen;
struct mbuf *m = m0, *n;
int totlen = 0;
@@ -1291,7 +1293,7 @@
n = m_get(M_NOWAIT, m->m_type);
if (n == NULL)
goto out;
- bzero(mtod(n, caddr_t), MLEN);
+ bzero(mtod(n, char *), MLEN);
n->m_len = min(MLEN, len + off);
m->m_next = n;
}
@@ -1306,7 +1308,7 @@
if ((m->m_flags & M_EXTPG) != 0)
m_copytounmapped(m, off, mlen, cp);
else
- bcopy(cp, off + mtod(m, caddr_t), (u_int)mlen);
+ bcopy(cp, off + mtod(m, char *), (u_int)mlen);
cp += mlen;
len -= mlen;
mlen += off;
@@ -1335,8 +1337,9 @@
* Return 1 if able to complete the job; otherwise 0.
*/
int
-m_append(struct mbuf *m0, int len, c_caddr_t cp)
+m_append(struct mbuf *m0, int len, const void *data)
{
+ const char *cp = data;
struct mbuf *m, *n;
int remainder, space;
@@ -1350,7 +1353,7 @@
*/
if (space > remainder)
space = remainder;
- bcopy(cp, mtod(m, caddr_t) + m->m_len, space);
+ bcopy(cp, mtod(m, char *) + m->m_len, space);
m->m_len += space;
cp += space, remainder -= space;
}
@@ -1363,7 +1366,7 @@
if (n == NULL)
break;
n->m_len = min(MLEN, remainder);
- bcopy(cp, mtod(n, caddr_t), n->m_len);
+ bcopy(cp, mtod(n, char *), n->m_len);
cp += n->m_len, remainder -= n->m_len;
m->m_next = n;
m = n;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -344,7 +344,7 @@
SLIST_ENTRY(mbuf) m_slistpkt;
STAILQ_ENTRY(mbuf) m_stailqpkt;
};
- caddr_t m_data; /* location of data */
+ char *m_data; /* location of data */
int32_t m_len; /* amount of data in this mbuf */
uint32_t m_type:8, /* type of data in this mbuf */
m_flags:24; /* flags; see below */
@@ -823,14 +823,14 @@
void m_adj_decap(struct mbuf *, int);
int m_apply(struct mbuf *, int, int,
int (*)(void *, void *, u_int), void *);
-int m_append(struct mbuf *, int, c_caddr_t);
+int m_append(struct mbuf *, int, const void *);
void m_cat(struct mbuf *, struct mbuf *);
void m_catpkt(struct mbuf *, struct mbuf *);
int m_clget(struct mbuf *m, int how);
void *m_cljget(struct mbuf *m, int how, int size);
struct mbuf *m_collapse(struct mbuf *, int, int);
-void m_copyback(struct mbuf *, int, int, c_caddr_t);
-void m_copydata(const struct mbuf *, int, int, caddr_t);
+void m_copyback(struct mbuf *, int, int, const void *);
+void m_copydata(const struct mbuf *, int, int, void *);
struct mbuf *m_copym(struct mbuf *, int, int, int);
struct mbuf *m_copypacket(struct mbuf *, int);
void m_copy_pkthdr(struct mbuf *, struct mbuf *);
@@ -839,7 +839,7 @@
void m_demote_pkthdr(struct mbuf *);
void m_demote(struct mbuf *, int, int);
struct mbuf *m_devget(char *, int, int, struct ifnet *,
- void (*)(char *, caddr_t, u_int));
+ void (*)(char *, char *, u_int));
void m_dispose_extcontrolm(struct mbuf *m);
struct mbuf *m_dup(const struct mbuf *, int);
int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int);

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 15, 11:19 PM (13 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40873578
Default Alt Text
D60736.diff (4 KB)

Event Timeline