[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1261413866-30634-1-git-send-email-vapier@gentoo.org>
Date: Mon, 21 Dec 2009 11:44:26 -0500
From: Mike Frysinger <vapier@...too.org>
To: uclinux-dev@...inux.org, David Howells <dhowells@...hat.com>,
David McCullough <davidm@...pgear.com>,
Greg Ungerer <gerg@...inux.org>,
Paul Mundt <lethal@...ux-sh.org>
Cc: uclinux-dist-devel@...ckfin.uclinux.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] nommu: implement vmap/vunmap with kmalloc
git-svn-id: svn://localhost/svn/linux-kernel/trunk@...3 526b6c2d-f592-4532-a319-5dd88ccb003d
---
mm/nommu.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/mm/nommu.c b/mm/nommu.c
index 8687973..d28ab94 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -360,14 +360,26 @@ EXPORT_SYMBOL(vmalloc_32_user);
void *vmap(struct page **pages, unsigned int count, unsigned long flags, pgprot_t prot)
{
- BUG();
- return NULL;
+ unsigned int i;
+ void *new_map, *page_data;
+
+ new_map = kmalloc(count << PAGE_SHIFT, GFP_KERNEL);
+ if (!new_map)
+ return NULL;
+
+ for (i = 0; i < count; ++i) {
+ page_data = kmap(pages[i]);
+ memcpy(new_map + (i << PAGE_SHIFT), page_data, PAGE_SIZE);
+ kunmap(page_data);
+ }
+
+ return new_map;
}
EXPORT_SYMBOL(vmap);
void vunmap(const void *addr)
{
- BUG();
+ kfree(addr);
}
EXPORT_SYMBOL(vunmap);
--
1.6.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists