mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
parent
4c4ce2f899
commit
9bc7ecb605
@ -21,6 +21,7 @@ extern "C" {
|
||||
void * lx_emul_mem_alloc(unsigned long size);
|
||||
void * lx_emul_mem_alloc_uncached(unsigned long size);
|
||||
void * lx_emul_mem_alloc_aligned(unsigned long size, unsigned long align);
|
||||
void * lx_emul_mem_alloc_aligned_uncached(unsigned long size, unsigned long align);
|
||||
unsigned long lx_emul_mem_dma_addr(void * addr);
|
||||
void lx_emul_mem_free(const void * ptr);
|
||||
unsigned long lx_emul_mem_size(const void * ptr);
|
||||
|
@ -43,6 +43,16 @@ extern "C" void * lx_emul_mem_alloc_uncached(unsigned long size)
|
||||
};
|
||||
|
||||
|
||||
extern "C" void * lx_emul_mem_alloc_aligned_uncached(unsigned long size,
|
||||
unsigned long align)
|
||||
{
|
||||
/* always align memory objects to 32 bytes, like malloc, heap etc. */
|
||||
void * const ptr = Lx_kit::env().uncached_memory.alloc(size, align);
|
||||
lx_emul_forget_pages(ptr, size);
|
||||
return ptr;
|
||||
};
|
||||
|
||||
|
||||
extern "C" unsigned long lx_emul_mem_dma_addr(void * addr)
|
||||
{
|
||||
unsigned long ret = Lx_kit::env().memory.dma_addr(addr);
|
||||
|
@ -29,7 +29,7 @@ void * dma_alloc_attrs(struct device * dev,
|
||||
lx_emul_trace_and_stop(__func__);
|
||||
}
|
||||
|
||||
addr = lx_emul_mem_alloc_uncached(size);
|
||||
addr = lx_emul_mem_alloc_aligned_uncached(size, PAGE_SIZE);
|
||||
*dma_handle = lx_emul_mem_dma_addr(addr);
|
||||
return addr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user