Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/flash add a function to get the size of the flash de...
details: https://anonhg.NetBSD.org/src/rev/9a46cdda5184
branches: trunk
changeset: 767757:9a46cdda5184
user: ahoka <ahoka%NetBSD.org@localhost>
date: Fri Jul 29 20:48:33 2011 +0000
description:
add a function to get the size of the flash device
diffstat:
sys/dev/flash/flash.c | 14 ++++++++++++--
sys/dev/flash/flash.h | 3 ++-
2 files changed, 14 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r a9da903bf7b0 -r 9a46cdda5184 sys/dev/flash/flash.c
--- a/sys/dev/flash/flash.c Fri Jul 29 19:57:38 2011 +0000
+++ b/sys/dev/flash/flash.c Fri Jul 29 20:48:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: flash.c,v 1.8 2011/07/15 19:19:57 cliff Exp $ */
+/* $NetBSD: flash.c,v 1.9 2011/07/29 20:48:33 ahoka Exp $ */
/*-
* Copyright (c) 2011 Department of Software Engineering,
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: flash.c,v 1.8 2011/07/15 19:19:57 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: flash.c,v 1.9 2011/07/29 20:48:33 ahoka Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -525,6 +525,16 @@
return sc->sc_dev;
}
+flash_size_t
+flash_get_size(dev_t dev)
+{
+ const struct flash_softc *sc;
+
+ sc = flash_get_softc(dev);
+
+ return sc->sc_partinfo.part_size;
+}
+
static inline flash_off_t
flash_get_part_offset(struct flash_softc * const sc, size_t poffset)
{
diff -r a9da903bf7b0 -r 9a46cdda5184 sys/dev/flash/flash.h
--- a/sys/dev/flash/flash.h Fri Jul 29 19:57:38 2011 +0000
+++ b/sys/dev/flash/flash.h Fri Jul 29 20:48:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: flash.h,v 1.6 2011/07/15 19:19:57 cliff Exp $ */
+/* $NetBSD: flash.h,v 1.7 2011/07/29 20:48:33 ahoka Exp $ */
/*-
* Copyright (c) 2011 Department of Software Engineering,
@@ -123,6 +123,7 @@
const struct flash_interface *flash_get_interface(dev_t);
const struct flash_softc *flash_get_softc(dev_t);
device_t flash_get_device(dev_t);
+flash_size_t flash_get_size(dev_t);
/* flash operations should be used through these */
int flash_erase(device_t, struct flash_erase_instruction *);
Home |
Main Index |
Thread Index |
Old Index