diff options
author | bde <bde@FreeBSD.org> | 1996-06-08 08:19:03 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-06-08 08:19:03 +0000 |
commit | 11d257651da74ba5cbe2ef53e48cb48b442da014 (patch) | |
tree | 3b9bca5073ac6e148e368b3f541dea769969481d | |
parent | 2aabf9403776db6ad169efb7b6d1bc783e05f5d9 (diff) | |
download | FreeBSD-src-11d257651da74ba5cbe2ef53e48cb48b442da014.zip FreeBSD-src-11d257651da74ba5cbe2ef53e48cb48b442da014.tar.gz |
Changed some memcpy()'s back to bcopy()'s.
gcc only inlines memcpy()'s whose count is constant and didn't inline
these. I want memcpy() in the kernel go away so that it's obvious that
it doesn't need to be optimized. Now it is only used for one struct
copy in si.c.
-rw-r--r-- | sys/net/bpf.c | 4 | ||||
-rw-r--r-- | sys/netinet/if_ether.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 10 | ||||
-rw-r--r-- | sys/netinet/tcp_output.c | 4 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 4 |
6 files changed, 15 insertions, 15 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index e903b68..c335ea0 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -37,7 +37,7 @@ * * @(#)bpf.c 8.2 (Berkeley) 3/28/94 * - * $Id: bpf.c,v 1.24 1996/04/07 17:32:23 bde Exp $ + * $Id: bpf.c,v 1.25 1996/06/08 06:12:58 davidg Exp $ */ #include "bpfilter.h" @@ -1100,7 +1100,7 @@ bpf_mcopy(src_arg, dst_arg, len) if (m == 0) panic("bpf_mcopy"); count = min(m->m_len, len); - (void)memcpy((caddr_t)dst, mtod(m, caddr_t), count); + bcopy(mtod(m, void *), dst, count); m = m->m_next; dst += count; len -= count; diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index bd6ea2a..4354d93 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.28 1996/02/20 17:54:17 fenner Exp $ + * $Id: if_ether.c,v 1.29 1996/03/23 01:32:29 fenner Exp $ */ /* @@ -348,7 +348,7 @@ arpresolve(ac, rt, m, dst, desten, rt0) */ if ((rt->rt_expire == 0 || rt->rt_expire > time.tv_sec) && sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) { - (void)memcpy(desten, LLADDR(sdl), sdl->sdl_alen); + bcopy(LLADDR(sdl), desten, sdl->sdl_alen); return 1; } /* diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index fe6e162..e7e2b42 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.41 1996/04/12 09:24:22 phk Exp $ + * $Id: ip_input.c,v 1.42 1996/05/08 04:28:57 gpalmer Exp $ */ #include <sys/param.h> @@ -946,7 +946,7 @@ save_rte(option, dst) #endif if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst))) return; - (void)memcpy(ip_srcrt.srcopt, option, olen); + bcopy(option, ip_srcrt.srcopt, olen); ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr); ip_srcrt.dst = dst; } diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index cf12527..7777114 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 - * $Id: ip_output.c,v 1.38 1996/05/21 20:47:31 peter Exp $ + * $Id: ip_output.c,v 1.39 1996/05/22 17:23:08 wollman Exp $ */ #define _IP_VHL @@ -513,7 +513,7 @@ ip_insertoptions(m, opt, phlen) ovbcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip)); } ip = mtod(m, struct ip *); - (void)memcpy(ip + 1, p->ipopt_list, (unsigned)optlen); + bcopy(p->ipopt_list, ip + 1, optlen); *phlen = sizeof(struct ip) + optlen; ip->ip_vhl = IP_MAKE_VHL(IPVERSION, *phlen >> 2); ip->ip_len += optlen; @@ -549,7 +549,7 @@ ip_optcopy(ip, jp) if (optlen > cnt) optlen = cnt; if (IPOPT_COPIED(opt)) { - (void)memcpy(dp, cp, (unsigned)optlen); + bcopy(cp, dp, optlen); dp += optlen; } } @@ -683,8 +683,8 @@ ip_ctloutput(op, so, level, optname, mp) *mp = m = m_get(M_WAIT, MT_SOOPTS); if (inp->inp_options) { m->m_len = inp->inp_options->m_len; - (void)memcpy(mtod(m, void *), - mtod(inp->inp_options, void *), (unsigned)m->m_len); + bcopy(mtod(inp->inp_options, void *), + mtod(m, void *), m->m_len); } else m->m_len = 0; break; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index f4d03f1..4297cd2 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 - * $Id: tcp_output.c,v 1.19 1996/03/11 15:13:32 davidg Exp $ + * $Id: tcp_output.c,v 1.20 1996/04/15 03:46:32 davidg Exp $ */ #include <sys/param.h> @@ -560,7 +560,7 @@ send: ti->ti_seq = htonl(tp->snd_max); ti->ti_ack = htonl(tp->rcv_nxt); if (optlen) { - (void)memcpy(ti + 1, opt, optlen); + bcopy(opt, ti + 1, optlen); ti->ti_off = (sizeof (struct tcphdr) + optlen) >> 2; } ti->ti_flags = flags; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index e285b04..7dfc52b 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 - * $Id: udp_usrreq.c,v 1.26 1996/05/09 20:15:26 wollman Exp $ + * $Id: udp_usrreq.c,v 1.27 1996/06/05 17:20:35 wollman Exp $ */ #include <sys/param.h> @@ -370,7 +370,7 @@ udp_saveopt(p, size, type) if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL) return ((struct mbuf *) NULL); cp = (struct cmsghdr *) mtod(m, struct cmsghdr *); - (void)memcpy(CMSG_DATA(cp), p, size); + bcopy(p, CMSG_DATA(cp), size); size += sizeof(*cp); m->m_len = size; cp->cmsg_len = size; |