diff mbox

[6/8] lib: fwts_mmap.c: add more comments

Message ID 1337942453-30224-7-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King May 25, 2012, 10:40 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_mmap.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Keng-Yu Lin May 31, 2012, 6:50 a.m. UTC | #1
On Fri, May 25, 2012 at 6:40 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@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
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu June 1, 2012, 1:41 a.m. UTC | #2
On 05/25/2012 06:40 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@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;
Acked-by: Ivan Hu<ivan.hu@canonical.com>
diff mbox

Patch

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;