mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
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.
This commit is contained in:
parent
5e0fc49ea8
commit
0453d3cbb3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16206
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
/*
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 @@ tcp_output(tp)
|
||||
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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user