From ca8c391c95d846ae9ea7edbb77615793ca55f4cb Mon Sep 17 00:00:00 2001 From: scw Date: Wed, 5 Nov 2003 10:09:10 +0000 Subject: [PATCH] s/bcopy/memmove/ The kernel's bcopy (actually a wrapper around memcpy) is not guaranteed to handle overlapping regions, even though the old ARM version did. This fixes a problem where the kernel reported more available memory than actually existed. --- sys/arch/shark/ofw/ofw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arch/shark/ofw/ofw.c b/sys/arch/shark/ofw/ofw.c index d82b9759fa00..19640884b2bf 100644 --- a/sys/arch/shark/ofw/ofw.c +++ b/sys/arch/shark/ofw/ofw.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw.c,v 1.32 2003/07/15 03:36:02 lukem Exp $ */ +/* $NetBSD: ofw.c,v 1.33 2003/11/05 10:09:10 scw Exp $ */ /* * Copyright 1997 @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.32 2003/07/15 03:36:02 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.33 2003/11/05 10:09:10 scw Exp $"); #include #include @@ -1539,7 +1539,7 @@ ofw_getphysmeminfo() /* Handle empty block. */ if (mp->size == 0) { - bcopy(mp + 1, mp, (cnt - (mp - tmp)) + memmove(mp, mp + 1, (cnt - (mp - tmp)) * sizeof(struct mem_region)); cnt--; mp--; @@ -1553,7 +1553,7 @@ ofw_getphysmeminfo() if (s < mp1->start) break; if (mp1 < mp) { - bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); + memmove(mp1 + 1, mp1, (char *)mp - (char *)mp1); mp1->start = s; mp1->size = sz; }