1 // Copyright (C) 2016 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 #pragma once 15 16 // Interface between android-emu non-base libraries and emugl 17 18 #include "host-common/GoldfishDma.h" 19 #include "host-common/goldfish_sync.h" 20 #include "host-common/FeatureControl.h" 21 22 // Crash reporter 23 typedef void (*emugl_crash_reporter_t)(const char* format, ...); 24 25 // Feature control 26 typedef bool (*emugl_feature_is_enabled_t)(android::featurecontrol::Feature feature); 27 28 // Goldfish sync device 29 typedef uint64_t (*emugl_sync_create_timeline_t)(); 30 typedef int (*emugl_sync_create_fence_t)(uint64_t timeline, uint32_t pt); 31 typedef void (*emugl_sync_timeline_inc_t)(uint64_t timeline, uint32_t howmuch); 32 typedef void (*emugl_sync_destroy_timeline_t)(uint64_t timeline); 33 34 typedef void (*emugl_sync_trigger_wait_t)(uint64_t glsync, uint64_t thread, uint64_t timeline); 35 typedef void (*emugl_sync_register_trigger_wait_t)(emugl_sync_trigger_wait_t trigger_fn); 36 37 typedef bool (*emugl_sync_device_exists_t)(); 38 39 // OpenGL timestamped logger 40 typedef void (*emugl_logger_t)(const char* fmt, ...); 41 typedef struct { 42 emugl_logger_t coarse; 43 emugl_logger_t fine; 44 } emugl_logger_struct; 45 46 // Function type that describes functions for 47 // accessing Goldfish DMA regions at a specified offset. 48 typedef void* (*emugl_dma_get_host_addr_t)(uint64_t); 49 typedef void (*emugl_dma_unlock_t)(uint64_t); 50 51 typedef struct { 52 emugl_dma_get_host_addr_t get_host_addr; 53 emugl_dma_unlock_t unlock; 54 } emugl_dma_ops; 55