This commit is contained in:
Taku Shimosawa
2011-12-02 12:35:38 +09:00
parent 5fdb3b2bb2
commit 7999653a00
18 changed files with 536 additions and 64 deletions

32
kernel/copy.c Normal file
View File

@@ -0,0 +1,32 @@
#include <aal/dma.h>
#include <amemcpy.h>
int memcpy_async(unsigned long dest, unsigned long src,
unsigned long len, int wait, unsigned long *notify)
{
struct aal_dma_request req;
unsigned long fin = 0;
if (notify)
*notify = 0;
memset(&req, 0, sizeof(req));
req.src_phys = src;
req.dest_phys = dest;
req.size = len;
if (notify) {
req.notify = (void *)virt_to_phys(notify);
req.priv = (void *)1;
} else if (wait) {
req.notify = (void *)virt_to_phys(&fin);
req.priv = (void *)1;
}
aal_mc_dma_request(0, &req);
if (wait) {
while (!fin) {
barrier();
}
}
return 0;
}