forked from KolibriOS/kolibrios
cae5fbcf75
git-svn-id: svn://kolibrios.org@6295 a494cfbc-eb01-0410-851d-a64ba20cac60
23 lines
484 B
C
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;
|
|
}
|
|
|