• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "GoldfishDma.h"
16 #include "dma_device.h"
17 
defaultDmaGetHostAddr(uint64_t guest_paddr)18 static void* defaultDmaGetHostAddr(uint64_t guest_paddr) { return nullptr; }
defaultDmaUnlock(uint64_t addr)19 static void defaultDmaUnlock(uint64_t addr) { }
20 
21 namespace emugl {
22 
23 emugl_dma_get_host_addr_t g_emugl_dma_get_host_addr = defaultDmaGetHostAddr;
24 emugl_dma_unlock_t g_emugl_dma_unlock = defaultDmaUnlock;
25 
set_emugl_dma_get_host_addr(emugl_dma_get_host_addr_t f)26 void set_emugl_dma_get_host_addr(emugl_dma_get_host_addr_t f) {
27     g_emugl_dma_get_host_addr = f;
28 }
29 
set_emugl_dma_unlock(emugl_dma_unlock_t f)30 void set_emugl_dma_unlock(emugl_dma_unlock_t f) {
31     g_emugl_dma_unlock = f;
32 }
33 
34 }  // namespace emugl
35