Message ID | 1337942453-30224-7-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
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>
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 --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;