Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch bcopy -> memcpy, bzero -> memset, bcmp -> memcmp.
details: https://anonhg.NetBSD.org/src/rev/4a97461752db
branches: trunk
changeset: 513027:4a97461752db
user: wiz <wiz%NetBSD.org@localhost>
date: Sun Jul 22 11:29:44 2001 +0000
description:
bcopy -> memcpy, bzero -> memset, bcmp -> memcmp.
Reviewed by Matt Thomas, ok'd by Tsubai Masanari.
diffstat:
sys/arch/macppc/dev/am79c950.c | 18 +++++-----
sys/arch/macppc/dev/ams.c | 4 +-
sys/arch/macppc/dev/if_bm.c | 28 +++++++++---------
sys/arch/macppc/dev/if_gm.c | 18 +++++-----
sys/arch/macppc/dev/if_mc.c | 10 +++---
sys/arch/macppc/dev/mediabay.c | 4 +-
sys/arch/macppc/dev/mesh.c | 6 +-
sys/arch/macppc/dev/ofb.c | 10 +++---
sys/arch/macppc/dev/pm_direct.c | 6 +-
sys/arch/macppc/dev/wdc_obio.c | 6 +-
sys/arch/macppc/dev/zs.c | 15 +++++----
sys/arch/macppc/macppc/autoconf.c | 6 +-
sys/arch/macppc/macppc/bus_dma.c | 4 +-
sys/arch/macppc/macppc/cpu.c | 4 +-
sys/arch/macppc/macppc/disksubr.c | 4 +-
sys/arch/macppc/macppc/extintr.c | 4 +-
sys/arch/macppc/macppc/machdep.c | 38 ++++++++++++------------
sys/arch/macppc/macppc/mainbus.c | 4 +-
sys/arch/macppc/pci/bandit.c | 4 +-
sys/arch/macppc/pci/grackle.c | 6 +-
sys/arch/macppc/pci/pci_machdep.c | 10 +++---
sys/arch/macppc/pci/uninorth.c | 8 ++--
sys/arch/macppc/stand/installboot/installboot.c | 6 +-
sys/arch/macppc/stand/ofwboot/Locore.c | 4 +-
sys/arch/macppc/stand/ofwboot/boot.c | 8 ++--
sys/arch/macppc/stand/ofwboot/hfs.c | 4 +-
sys/arch/macppc/stand/ofwboot/netif_of.c | 6 +-
sys/arch/macppc/stand/ofwboot/ofdev.c | 4 +-
sys/arch/powerpc/fpu/fpu_emu.c | 14 ++++----
sys/arch/powerpc/ibm4xx/pmap.c | 18 +++++-----
sys/arch/powerpc/ibm4xx/trap.c | 14 ++++----
sys/arch/powerpc/mpc6xx/pmap.c | 8 ++--
sys/arch/powerpc/powerpc/db_interface.c | 10 +++---
sys/arch/powerpc/powerpc/fpu.c | 4 +-
sys/arch/powerpc/powerpc/mem.c | 4 +-
sys/arch/powerpc/powerpc/ofw_machdep.c | 12 +++---
sys/arch/powerpc/powerpc/pmap.c | 24 +++++++-------
sys/arch/powerpc/powerpc/powerpc_machdep.c | 4 +-
sys/arch/powerpc/powerpc/process_machdep.c | 12 +++---
sys/arch/powerpc/powerpc/trap.c | 12 +++---
sys/arch/powerpc/powerpc/vm_machdep.c | 10 +++---
41 files changed, 198 insertions(+), 197 deletions(-)
diffs (truncated from 1651 to 300 lines):
diff -r d846c8af9a8c -r 4a97461752db sys/arch/macppc/dev/am79c950.c
--- a/sys/arch/macppc/dev/am79c950.c Sun Jul 22 10:40:09 2001 +0000
+++ b/sys/arch/macppc/dev/am79c950.c Sun Jul 22 11:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am79c950.c,v 1.10 2000/11/15 01:02:13 thorpej Exp $ */
+/* $NetBSD: am79c950.c,v 1.11 2001/07/22 11:29:46 wiz Exp $ */
/*-
* Copyright (c) 1997 David Huang <khym%bga.com@localhost>
@@ -107,7 +107,7 @@
/*
* Compare two Ether/802 addresses for equality, inlined and
- * unrolled for speed. Use this like bcmp().
+ * unrolled for speed. Use this like memcmp().
*
* XXX: Add <machine/inlines.h> for stuff like this?
* XXX: or maybe add it to libkern.h instead?
@@ -167,10 +167,10 @@
DELAY(100);
NIC_PUT(sc, MACE_IMR, ~0);
- bcopy(lladdr, sc->sc_enaddr, ETHER_ADDR_LEN);
+ memcpy(sc->sc_enaddr, lladdr, ETHER_ADDR_LEN);
printf(": address %s\n", ether_sprintf(lladdr));
- bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
+ memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_ioctl = mcioctl;
ifp->if_start = mcstart;
@@ -223,8 +223,8 @@
ina->x_host =
*(union ns_host *)LLADDR(ifp->if_sadl);
else {
- bcopy(ina->x_host.c_host,
- LLADDR(ifp->if_sadl),
+ memcpy(LLADDR(ifp->if_sadl),
+ ina->x_host.c_host,
sizeof(sc->sc_enaddr));
}
/* Set new address. */
@@ -476,7 +476,7 @@
u_char *data = mtod(m, u_char *);
len = m->m_len;
totlen += len;
- bcopy(data, buff, len);
+ memcpy(buff, data, len);
buff += len;
MFREE(m, n);
}
@@ -487,7 +487,7 @@
#if 0
if (totlen < ETHERMIN + sizeof(struct ether_header)) {
int pad = ETHERMIN + sizeof(struct ether_header) - totlen;
- bzero(sc->sc_txbuf + totlen, pad);
+ memset(sc->sc_txbuf + totlen, 0, pad);
totlen = ETHERMIN + sizeof(struct ether_header);
}
#endif
@@ -717,7 +717,7 @@
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
- bcopy(pkt, mtod(m, caddr_t), len);
+ memcpy(mtod(m, caddr_t), pkt, len);
pkt += len;
totlen -= len;
*mp = m;
diff -r d846c8af9a8c -r 4a97461752db sys/arch/macppc/dev/ams.c
--- a/sys/arch/macppc/dev/ams.c Sun Jul 22 10:40:09 2001 +0000
+++ b/sys/arch/macppc/dev/ams.c Sun Jul 22 11:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */
+/* $NetBSD: ams.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@@ -308,7 +308,7 @@
sc->sc_class = buffer[7];
sc->sc_buttons = buffer[8];
sc->sc_res = (int)*(short *)&buffer[5];
- bcopy(&(buffer[1]), sc->sc_devid, 4);
+ memcpy(sc->sc_devid, &(buffer[1]), 4);
} else if (buffer[1] == 0x9a &&
((buffer[2] == 0x20) || (buffer[2] == 0x21))) {
/*
diff -r d846c8af9a8c -r 4a97461752db sys/arch/macppc/dev/if_bm.c
--- a/sys/arch/macppc/dev/if_bm.c Sun Jul 22 10:40:09 2001 +0000
+++ b/sys/arch/macppc/dev/if_bm.c Sun Jul 22 11:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bm.c,v 1.15 2000/11/15 01:02:13 thorpej Exp $ */
+/* $NetBSD: if_bm.c,v 1.16 2001/07/22 11:29:46 wiz Exp $ */
/*-
* Copyright (C) 1998, 1999, 2000 Tsubai Masanari. All rights reserved.
@@ -202,7 +202,7 @@
if (strcmp(ca->ca_name, "ethernet") == 0) {
char name[64];
- bzero(name, 64);
+ memset(name, 0, 64);
OF_package_to_path(ca->ca_node, name, sizeof(name));
OF_open(name);
sc->sc_flags |= BMAC_BMACPLUS;
@@ -221,7 +221,7 @@
printf(": cannot get mac-address\n");
return;
}
- bcopy(laddr, sc->sc_enaddr, 6);
+ memcpy(sc->sc_enaddr, laddr, 6);
sc->sc_txdma = mapiodev(ca->ca_reg[2], NBPG);
sc->sc_rxdma = mapiodev(ca->ca_reg[4], NBPG);
@@ -241,7 +241,7 @@
intr_establish(ca->ca_intr[0], IST_LEVEL, IPL_NET, bmac_intr, sc);
intr_establish(ca->ca_intr[2], IST_LEVEL, IPL_NET, bmac_rint, sc);
- bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
+ memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_ioctl = bmac_ioctl;
ifp->if_start = bmac_start;
@@ -393,9 +393,9 @@
data = sc->sc_txbuf;
eh = (struct ether_header *)data;
- bzero(data, sizeof(eh) + ETHERMIN);
- bcopy(sc->sc_enaddr, eh->ether_dhost, ETHER_ADDR_LEN);
- bcopy(sc->sc_enaddr, eh->ether_shost, ETHER_ADDR_LEN);
+ memset(data, 0, sizeof(eh) + ETHERMIN);
+ memcpy(eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN);
+ memcpy(eh->ether_shost, sc->sc_enaddr, ETHER_ADDR_LEN);
bmac_transmit_packet(sc, data, sizeof(eh) + ETHERMIN);
bmac_start(ifp);
@@ -413,8 +413,8 @@
dbdma_reset(sc->sc_txdma);
dbdma_reset(sc->sc_rxdma);
- bzero(sc->sc_txcmd, BMAC_TXBUFS * sizeof(dbdma_command_t));
- bzero(sc->sc_rxcmd, (BMAC_RXBUFS + 1) * sizeof(dbdma_command_t));
+ memset(sc->sc_txcmd, 0, BMAC_TXBUFS * sizeof(dbdma_command_t));
+ memset(sc->sc_rxcmd, 0, (BMAC_RXBUFS + 1) * sizeof(dbdma_command_t));
for (i = 0; i < BMAC_RXBUFS; i++) {
DBDMA_BUILD(cmd, DBDMA_CMD_IN_LAST, 0, BMAC_BUFLEN,
@@ -644,7 +644,7 @@
MFREE(m, n);
continue;
}
- bcopy(mtod(m, caddr_t), buff, len);
+ memcpy(buff, mtod(m, caddr_t), len);
buff += len;
tlen += len;
MFREE(m, n);
@@ -694,7 +694,7 @@
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
- bcopy(pkt, mtod(m, caddr_t), len);
+ memcpy(mtod(m, caddr_t), pkt, len);
pkt += len;
totlen -= len;
*mp = m;
@@ -753,8 +753,8 @@
ina->x_host =
*(union ns_host *)LLADDR(ifp->if_sadl);
else {
- bcopy(ina->x_host.c_host,
- LLADDR(ifp->if_sadl),
+ memcpy(LLADDR(ifp->if_sadl),
+ ina->x_host.c_host,
sizeof(sc->sc_enaddr));
}
/* Set new address. */
@@ -886,7 +886,7 @@
ETHER_FIRST_MULTI(step, &sc->sc_ethercom, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+ if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
/*
* We must listen to a range of multicast addresses.
* For now, just accept all multicasts, rather than
diff -r d846c8af9a8c -r 4a97461752db sys/arch/macppc/dev/if_gm.c
--- a/sys/arch/macppc/dev/if_gm.c Sun Jul 22 10:40:09 2001 +0000
+++ b/sys/arch/macppc/dev/if_gm.c Sun Jul 22 11:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gm.c,v 1.13 2001/06/17 19:54:47 tsubai Exp $ */
+/* $NetBSD: if_gm.c,v 1.14 2001/07/22 11:29:46 wiz Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@@ -165,7 +165,7 @@
OF_getprop(node, "local-mac-address", laddr, sizeof laddr);
OF_getprop(node, "assigned-addresses", reg, sizeof reg);
- bcopy(laddr, sc->sc_laddr, sizeof laddr);
+ memcpy(sc->sc_laddr, laddr, sizeof laddr);
sc->sc_reg = reg[2];
if (pci_intr_map(pa, &ih)) {
@@ -189,7 +189,7 @@
return;
}
p = (void *)roundup((vaddr_t)p, 0x800);
- bzero(p, 2048 * (NRXBUF + NTXBUF) + 2 * 0x800);
+ memset(p, 0, 2048 * (NRXBUF + NTXBUF) + 2 * 0x800);
sc->sc_rxlist = (void *)p;
p += 0x800;
@@ -221,7 +221,7 @@
gmac_reset(sc);
gmac_init_mac(sc);
- bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
+ memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_ioctl = gmac_ioctl;
ifp->if_start = gmac_start;
@@ -450,7 +450,7 @@
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
- bcopy(pkt, mtod(m, caddr_t), len);
+ memcpy(mtod(m, caddr_t), pkt, len);
pkt += len;
totlen -= len;
*mp = m;
@@ -536,7 +536,7 @@
MFREE(m, n);
continue;
}
- bcopy(mtod(m, caddr_t), buff, len);
+ memcpy(buff, mtod(m, caddr_t), len);
buff += len;
tlen += len;
MFREE(m, n);
@@ -710,7 +710,7 @@
ETHER_FIRST_MULTI(step, ec, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6)) {
+ if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6)) {
/*
* We must listen to a range of multicast addresses.
* For now, just accept all multicasts, rather than
@@ -806,8 +806,8 @@
ina->x_host =
*(union ns_host *)LLADDR(ifp->if_sadl);
else {
- bcopy(ina->x_host.c_host,
- LLADDR(ifp->if_sadl),
+ memcpy(LLADDR(ifp->if_sadl),
+ ina->x_host.c_host,
sizeof(sc->sc_enaddr));
}
/* Set new address. */
diff -r d846c8af9a8c -r 4a97461752db sys/arch/macppc/dev/if_mc.c
--- a/sys/arch/macppc/dev/if_mc.c Sun Jul 22 10:40:09 2001 +0000
+++ b/sys/arch/macppc/dev/if_mc.c Sun Jul 22 11:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mc.c,v 1.4 2001/06/08 00:32:02 matt Exp $ */
+/* $NetBSD: if_mc.c,v 1.5 2001/07/22 11:29:46 wiz Exp $ */
/*-
* Copyright (c) 1997 David Huang <khym%bga.com@localhost>
@@ -128,8 +128,8 @@
sc->sc_tail = 0;
sc->sc_txdmacmd = dbdma_alloc(sizeof(dbdma_command_t) * 2);
sc->sc_rxdmacmd = (void *)dbdma_alloc(sizeof(dbdma_command_t) * 8);
- bzero(sc->sc_txdmacmd, sizeof(dbdma_command_t) * 2);
- bzero(sc->sc_rxdmacmd, sizeof(dbdma_command_t) * 8);
+ memset(sc->sc_txdmacmd, 0, sizeof(dbdma_command_t) * 2);
+ memset(sc->sc_rxdmacmd, 0, sizeof(dbdma_command_t) * 8);
printf(": irq %d,%d,%d",
ca->ca_intr[0], ca->ca_intr[1], ca->ca_intr[2]);
@@ -142,7 +142,7 @@
/* allocate memory for transmit buffer and mark it non-cacheable */
sc->sc_txbuf = malloc(NBPG, M_DEVBUF, M_WAITOK);
sc->sc_txbuf_phys = kvtop(sc->sc_txbuf);
- bzero(sc->sc_txbuf, NBPG);
+ memset(sc->sc_txbuf, 0, NBPG);
/*
* allocate memory for receive buffer and mark it non-cacheable
@@ -154,7 +154,7 @@
*/
sc->sc_rxbuf = malloc(MC_NPAGES * NBPG, M_DEVBUF, M_WAITOK);
sc->sc_rxbuf_phys = kvtop(sc->sc_rxbuf);
- bzero(sc->sc_rxbuf, MC_NPAGES * NBPG);
+ memset(sc->sc_rxbuf, 0, MC_NPAGES * NBPG);
if ((int)sc->sc_txbuf & PGOFSET)
printf("txbuf is not page-aligned\n");
diff -r d846c8af9a8c -r 4a97461752db sys/arch/macppc/dev/mediabay.c
--- a/sys/arch/macppc/dev/mediabay.c Sun Jul 22 10:40:09 2001 +0000
+++ b/sys/arch/macppc/dev/mediabay.c Sun Jul 22 11:29:44 2001 +0000
Home |
Main Index |
Thread Index |
Old Index