Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys To mount block devices as XIP, pass physical addr...
details: https://anonhg.NetBSD.org/src/rev/7625b6070f82
branches: uebayasi-xip
changeset: 751615:7625b6070f82
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Sun Feb 28 05:03:58 2010 +0000
description:
To mount block devices as XIP, pass physical address "cookie" used by
bus_space_mmap(9) / pmap_phys_addr(9) via struct mount.
diffstat:
sys/dev/flash.c | 5 +++--
sys/miscfs/genfs/genfs_io.c | 7 ++++---
sys/sys/dkio.h | 4 ++--
3 files changed, 9 insertions(+), 7 deletions(-)
diffs (65 lines):
diff -r 3bc93b07b017 -r 7625b6070f82 sys/dev/flash.c
--- a/sys/dev/flash.c Sun Feb 28 04:36:27 2010 +0000
+++ b/sys/dev/flash.c Sun Feb 28 05:03:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $Id: flash.c,v 1.1.2.3 2010/02/28 04:36:27 uebayasi Exp $ */
+/* $Id: flash.c,v 1.1.2.4 2010/02/28 05:03:58 uebayasi Exp $ */
/*-
* Copyright (c) 2010 Tsubai Masanari. All rights reserved.
@@ -100,7 +100,8 @@
if (sc->sc_addr == 0)
error = EINVAL;
else
- *(paddr_t *)data = sc->sc_addr;
+ *(paddr_t *)data = bus_space_mmap(sc->sc_iot,
+ sc->sc_addr, 0, 0/* XXX prot */, BUS_SPACE_MAP_LINEAR);
break;
#endif
diff -r 3bc93b07b017 -r 7625b6070f82 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c Sun Feb 28 04:36:27 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c Sun Feb 28 05:03:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_io.c,v 1.36.2.2 2010/02/23 07:46:28 uebayasi Exp $ */
+/* $NetBSD: genfs_io.c,v 1.36.2.3 2010/02/28 05:03:58 uebayasi Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.2 2010/02/23 07:46:28 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.3 2010/02/28 05:03:58 uebayasi Exp $");
#include "opt_device_page.h"
#include "opt_xip.h"
@@ -808,7 +808,8 @@
/* unallocated page is redirected to read-only zero-filled page */
phys_addr = uvm_pageofzero_xip_phys_addr();
} else {
- phys_addr = vp->v_mount->mnt_phys_addr +
+ /* bus_space_mmap cookie -> paddr_t */
+ phys_addr = pmap_phys_address(vp->v_mount->mnt_phys_addr) +
(blkno << dev_bshift) +
(off - (lbn << fs_bshift));
}
diff -r 3bc93b07b017 -r 7625b6070f82 sys/sys/dkio.h
--- a/sys/sys/dkio.h Sun Feb 28 04:36:27 2010 +0000
+++ b/sys/sys/dkio.h Sun Feb 28 05:03:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkio.h,v 1.15.2.1 2010/02/11 05:19:35 uebayasi Exp $ */
+/* $NetBSD: dkio.h,v 1.15.2.2 2010/02/28 05:03:58 uebayasi Exp $ */
/*
* Copyright (c) 1987, 1988, 1993
@@ -105,7 +105,7 @@
/* get disk-info dictionary */
#define DIOCGDISKINFO _IOR('d', 127, struct plistref)
- /* get physical address if directly memory-mappable (XIP) */
+ /* get physical address cookie if directly memory-mappable (XIP) */
#define DIOCGPHYSADDR _IOR('d', 128, paddr_t)
#endif /* _SYS_DKIO_H_ */
Home |
Main Index |
Thread Index |
Old Index