summaryrefslogtreecommitdiffstats
path: root/net/nfs.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-03-22 17:09:08 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:11 -0600
commit55d5fd9a84ced5c5feb5eda0db1523fa3c2fc742 (patch)
tree3111a6255f6b933140d445125e5d3b46107982fe /net/nfs.c
parent5c421331d5a8eac754c4509a4c710ef334b823c5 (diff)
downloadtalos-obmc-uboot-55d5fd9a84ced5c5feb5eda0db1523fa3c2fc742.zip
talos-obmc-uboot-55d5fd9a84ced5c5feb5eda0db1523fa3c2fc742.tar.gz
net: Access mapped physmem in net functions
Previously the net functions would access memory assuming physmem did not need to be mapped. In sandbox, that's not the case. Now we map the physmem specified by the user in loadaddr to the buffer that represents that space. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/nfs.c')
-rw-r--r--net/nfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/nfs.c b/net/nfs.c
index 381b75f..8e05ae5 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -26,6 +26,7 @@
#include <command.h>
#include <net.h>
#include <malloc.h>
+#include <mapmem.h>
#include "nfs.h"
#include "bootp.h"
@@ -93,7 +94,10 @@ store_block(uchar *src, unsigned offset, unsigned len)
} else
#endif /* CONFIG_SYS_DIRECT_FLASH_NFS */
{
- (void)memcpy((void *)(load_addr + offset), src, len);
+ void *ptr = map_sysmem(load_addr + offset, len);
+
+ memcpy(ptr, src, len);
+ unmap_sysmem(ptr);
}
if (NetBootFileXferSize < (offset+len))
OpenPOWER on IntegriCloud