kolibrios-gitea/drivers/ddk/dma/dma_alloc.c
Sergey Semyonov (Serge) cae5fbcf75 ddk: update
git-svn-id: svn://kolibrios.org@6295 a494cfbc-eb01-0410-851d-a64ba20cac60
2016-02-27 20:06:12 +00:00

23 lines
484 B
C

#include <linux/types.h>
#include <linux/gfp.h>
#include <linux/spinlock.h>
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
void *dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t gfp)
{
void *ret;
size = ALIGN(size,32768);
ret = (void *)KernelAlloc(size);
if (ret) {
__builtin_memset(ret, 0, size);
*dma_handle = GetPgAddr(ret);
}
return ret;
}