• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 #pragma once
18 
19 #include <cstdint>
20 
21 #ifdef _MSC_VER
22 # ifdef BUILDING_EMUGL_COMMON_SHARED
23 #  define EMUGL_COMMON_API __declspec(dllexport)
24 # else
25 #  define EMUGL_COMMON_API __declspec(dllimport)
26 #endif
27 #else
28 # define EMUGL_COMMON_API
29 #endif
30 
31 // Function type that describes functions for
32 // accessing Goldfish DMA regions at a specified offset.
33 typedef void* (*emugl_dma_get_host_addr_t)(uint64_t);
34 typedef void (*emugl_dma_unlock_t)(uint64_t);
35 
36 typedef struct {
37     emugl_dma_get_host_addr_t get_host_addr;
38     emugl_dma_unlock_t unlock;
39 } emugl_dma_ops;
40 
41 namespace emugl {
42 
43 EMUGL_COMMON_API extern emugl_dma_get_host_addr_t g_emugl_dma_get_host_addr;
44 EMUGL_COMMON_API extern emugl_dma_unlock_t g_emugl_dma_unlock;
45 
46 EMUGL_COMMON_API void set_emugl_dma_get_host_addr(emugl_dma_get_host_addr_t);
47 EMUGL_COMMON_API void set_emugl_dma_unlock(emugl_dma_unlock_t);
48 
49 }  // namespace emugl
50