• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #include "android/emulation/GoldfishDma.h"
3 #include "emugl/common/dma_device.h"
4 
defaultDmaAddBuffer(void * pipe,uint64_t guest_paddr,uint64_t size)5 static void defaultDmaAddBuffer(void* pipe, uint64_t guest_paddr, uint64_t size) { }
defaultDmaRemoveBuffer(uint64_t guest_paddr)6 static void defaultDmaRemoveBuffer(uint64_t guest_paddr) { }
defaultDmaGetHostAddr(uint64_t guest_paddr)7 static void* defaultDmaGetHostAddr(uint64_t guest_paddr) {
8     return nullptr;
9 }
defaultDmaInvalidateHostMappings()10 static void defaultDmaInvalidateHostMappings() { }
11 
defaultDmaUnlock(uint64_t addr)12 static void defaultDmaUnlock(uint64_t addr) { }
13 
14 emugl_dma_add_buffer_t g_emugl_dma_add_buffer = defaultDmaAddBuffer;
15 emugl_dma_remove_buffer_t g_emugl_dma_remove_buffer = defaultDmaRemoveBuffer;
16 emugl_dma_get_host_addr_t g_emugl_dma_get_host_addr = defaultDmaGetHostAddr;
17 emugl_dma_invalidate_host_mappings_t g_emugl_dma_invalidate_host_mappings = defaultDmaInvalidateHostMappings;
18 emugl_dma_unlock_t g_emugl_dma_unlock = defaultDmaUnlock;
19 
set_emugl_dma_add_buffer(emugl_dma_add_buffer_t f)20 void set_emugl_dma_add_buffer(emugl_dma_add_buffer_t f) {
21     g_emugl_dma_add_buffer = f;
22 }
23 
set_emugl_dma_remove_buffer(emugl_dma_remove_buffer_t f)24 void set_emugl_dma_remove_buffer(emugl_dma_remove_buffer_t f) {
25     g_emugl_dma_remove_buffer = f;
26 }
27 
set_emugl_dma_get_host_addr(emugl_dma_get_host_addr_t f)28 void set_emugl_dma_get_host_addr(emugl_dma_get_host_addr_t f) {
29     g_emugl_dma_get_host_addr = f;
30 }
31 
set_emugl_dma_invalidate_host_mappings(emugl_dma_invalidate_host_mappings_t f)32 void set_emugl_dma_invalidate_host_mappings(emugl_dma_invalidate_host_mappings_t f) {
33     g_emugl_dma_invalidate_host_mappings = f;
34 }
35 
set_emugl_dma_unlock(emugl_dma_unlock_t f)36 void set_emugl_dma_unlock(emugl_dma_unlock_t f) {
37     g_emugl_dma_unlock = f;
38 }
39