1 /* Copyright (C) 2007-2008 The Android Open Source Project 2 ** 3 ** This software is licensed under the terms of the GNU General Public 4 ** License version 2, as published by the Free Software Foundation, and 5 ** may be copied, distributed, and modified under those terms. 6 ** 7 ** This program is distributed in the hope that it will be useful, 8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 ** GNU General Public License for more details. 11 */ 12 #ifndef GOLDFISH_VMEM_H 13 #define GOLDFISH_VMEM_H 14 15 #include "cpu.h" 16 17 // Call these functions instead of cpu_memory_rw_debug and 18 // cpu_get_phys_page_debug to ensure virtual address translation always works 19 // properly, and efficently, under KVM. 20 21 int safe_memory_rw_debug(CPUState *env, target_ulong addr, uint8_t *buf, 22 int len, int is_write); 23 24 hwaddr safe_get_phys_page_debug(CPUState *env, target_ulong addr); 25 26 27 #endif /* GOLDFISH_VMEM_H */ 28