[PATCH 6/8] lib: fwts_mmap.c: add more comments
Colin King
colin.king at canonical.com
Fri May 25 10:40:51 UTC 2012
From: Colin Ian King <colin.king at canonical.com>
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/lib/src/fwts_mmap.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/lib/src/fwts_mmap.c b/src/lib/src/fwts_mmap.c
index fd119d4..c47960d 100644
--- a/src/lib/src/fwts_mmap.c
+++ b/src/lib/src/fwts_mmap.c
@@ -26,6 +26,11 @@
#define PAGE_SIZE 4096
+/*
+ * fwts_mmap()
+ * Try and map physical memory from offset address 'start' and length
+ * 'size'. Return either the address or FWTS_MAP_FAILED if failed to mmap.
+ */
void *fwts_mmap(const off_t start, const size_t size)
{
int fd;
@@ -52,6 +57,10 @@ void *fwts_mmap(const off_t start, const size_t size)
return ret;
}
+/*
+ * fwts_munmap()
+ * Unmap memory mapped wuth fwts_mmap. Needs the mmap'd address and size.
+ */
int fwts_munmap(void *mem, const size_t size)
{
int page_size;
--
1.7.10
More information about the fwts-devel
mailing list