Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc Replace memcpy's of obviously overlapping r...
details: https://anonhg.NetBSD.org/src/rev/4df621c1d5ef
branches: trunk
changeset: 513029:4df621c1d5ef
user: wiz <wiz%NetBSD.org@localhost>
date: Sun Jul 22 13:08:09 2001 +0000
description:
Replace memcpy's of obviously overlapping regions with memmove.
Noted by Izumi Tsutsui.
diffstat:
sys/arch/powerpc/ibm4xx/pmap.c | 10 +++++-----
sys/arch/powerpc/powerpc/pmap.c | 20 ++++++++++----------
2 files changed, 15 insertions(+), 15 deletions(-)
diffs (105 lines):
diff -r a06fcf3769df -r 4df621c1d5ef sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c Sun Jul 22 12:20:29 2001 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c Sun Jul 22 13:08:09 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.2 2001/07/22 11:29:45 wiz Exp $ */
+/* $NetBSD: pmap.c,v 1.3 2001/07/22 13:08:09 wiz Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -391,8 +391,8 @@
*/
if (sz == 0) {
empty:
- memcpy(mp, mp + 1,
- (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp, mp + 1,
+ (cnt - (mp - avail)) * sizeof *mp);
cnt--;
mp--;
continue;
@@ -405,7 +405,7 @@
if (s < mp1->start)
break;
if (mp1 < mp) {
- memcpy(mp1 + 1, mp1, (char *)mp - (char *)mp1);
+ memmove(mp1 + 1, mp1, (char *)mp - (char *)mp1);
mp1->start = s;
mp1->size = sz;
} else {
@@ -434,7 +434,7 @@
msgbuf_paddr = mp->start + mp->size - sz;
mp->size -= sz;
if (mp->size <= 0)
- memcpy(mp, mp + 1, (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp, mp + 1, (cnt - (mp - avail)) * sizeof *mp);
#endif
printf("Loading pages\n");
diff -r a06fcf3769df -r 4df621c1d5ef sys/arch/powerpc/powerpc/pmap.c
--- a/sys/arch/powerpc/powerpc/pmap.c Sun Jul 22 12:20:29 2001 +0000
+++ b/sys/arch/powerpc/powerpc/pmap.c Sun Jul 22 13:08:09 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.45 2001/07/22 11:29:46 wiz Exp $ */
+/* $NetBSD: pmap.c,v 1.46 2001/07/22 13:08:09 wiz Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -388,8 +388,8 @@
*/
if (sz == 0) {
empty:
- memcpy(mp, mp + 1,
- (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp, mp + 1,
+ (cnt - (mp - avail)) * sizeof *mp);
cnt--;
mp--;
continue;
@@ -402,7 +402,7 @@
if (s < mp1->start)
break;
if (mp1 < mp) {
- memcpy(mp1 + 1, mp1, (char *)mp - (char *)mp1);
+ memmove(mp1 + 1, mp1, (char *)mp - (char *)mp1);
mp1->start = s;
mp1->size = sz;
} else {
@@ -441,15 +441,15 @@
if (s)
mp->size = s;
else {
- memcpy(mp, mp + 1,
- (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp, mp + 1,
+ (cnt - (mp - avail)) * sizeof *mp);
mp = avail;
}
break;
}
if (s != 0) {
- memcpy(mp + 1, mp,
- (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp + 1, mp,
+ (cnt - (mp - avail)) * sizeof *mp);
mp++->size = s;
cnt++;
}
@@ -481,7 +481,7 @@
mp->size -= sz;
mp->start += sz;
if (mp->size <= 0)
- memcpy(mp, mp + 1, (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp, mp + 1, (cnt - (mp - avail)) * sizeof *mp);
for (i = 0; i < ptab_cnt; i++)
LIST_INIT(potable + i);
LIST_INIT(&pv_page_freelist);
@@ -502,7 +502,7 @@
msgbuf_paddr = mp->start + mp->size - sz;
mp->size -= sz;
if (mp->size <= 0)
- memcpy(mp, mp + 1, (cnt - (mp - avail)) * sizeof *mp);
+ memmove(mp, mp + 1, (cnt - (mp - avail)) * sizeof *mp);
#endif
for (mp = avail; mp->size; mp++)
Home |
Main Index |
Thread Index |
Old Index