1c97d6d2cSSergio Andres Gomez Del Real /* 2c97d6d2cSSergio Andres Gomez Del Real * Copyright (C) 2016 Veertu Inc, 3c97d6d2cSSergio Andres Gomez Del Real * Copyright (C) 2017 Google Inc, 4c97d6d2cSSergio Andres Gomez Del Real * 5c97d6d2cSSergio Andres Gomez Del Real * This program is free software; you can redistribute it and/or 6996feed4SSergio Andres Gomez Del Real * modify it under the terms of the GNU Lesser General Public 7996feed4SSergio Andres Gomez Del Real * License as published by the Free Software Foundation; either 88af82b8eSChetan Pant * version 2.1 of the License, or (at your option) any later version. 9c97d6d2cSSergio Andres Gomez Del Real * 10c97d6d2cSSergio Andres Gomez Del Real * This program is distributed in the hope that it will be useful, 11c97d6d2cSSergio Andres Gomez Del Real * but WITHOUT ANY WARRANTY; without even the implied warranty of 12996feed4SSergio Andres Gomez Del Real * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13996feed4SSergio Andres Gomez Del Real * Lesser General Public License for more details. 14c97d6d2cSSergio Andres Gomez Del Real * 15996feed4SSergio Andres Gomez Del Real * You should have received a copy of the GNU Lesser General Public 16996feed4SSergio Andres Gomez Del Real * License along with this program; if not, see <http://www.gnu.org/licenses/>. 17c97d6d2cSSergio Andres Gomez Del Real */ 18a8b991b5SMarkus Armbruster 19a8b991b5SMarkus Armbruster #ifndef X86_MMU_H 20a8b991b5SMarkus Armbruster #define X86_MMU_H 21c97d6d2cSSergio Andres Gomez Del Real 22c97d6d2cSSergio Andres Gomez Del Real #define PT_PRESENT (1 << 0) 23c97d6d2cSSergio Andres Gomez Del Real #define PT_WRITE (1 << 1) 24c97d6d2cSSergio Andres Gomez Del Real #define PT_USER (1 << 2) 25c97d6d2cSSergio Andres Gomez Del Real #define PT_WT (1 << 3) 26c97d6d2cSSergio Andres Gomez Del Real #define PT_CD (1 << 4) 27c97d6d2cSSergio Andres Gomez Del Real #define PT_ACCESSED (1 << 5) 28c97d6d2cSSergio Andres Gomez Del Real #define PT_DIRTY (1 << 6) 29c97d6d2cSSergio Andres Gomez Del Real #define PT_PS (1 << 7) 30c97d6d2cSSergio Andres Gomez Del Real #define PT_GLOBAL (1 << 8) 31c97d6d2cSSergio Andres Gomez Del Real #define PT_NX (1llu << 63) 32c97d6d2cSSergio Andres Gomez Del Real 33c97d6d2cSSergio Andres Gomez Del Real /* error codes */ 34c97d6d2cSSergio Andres Gomez Del Real #define MMU_PAGE_PT (1 << 0) 35c97d6d2cSSergio Andres Gomez Del Real #define MMU_PAGE_WT (1 << 1) 36c97d6d2cSSergio Andres Gomez Del Real #define MMU_PAGE_US (1 << 2) 37c97d6d2cSSergio Andres Gomez Del Real #define MMU_PAGE_NX (1 << 3) 38c97d6d2cSSergio Andres Gomez Del Real 39*f8436a16SPhilippe Mathieu-Daudé bool mmu_gva_to_gpa(CPUState *cpu, target_ulong gva, uint64_t *gpa); 40c97d6d2cSSergio Andres Gomez Del Real 41*f8436a16SPhilippe Mathieu-Daudé void vmx_write_mem(CPUState *cpu, target_ulong gva, void *data, int bytes); 42*f8436a16SPhilippe Mathieu-Daudé void vmx_read_mem(CPUState *cpu, void *data, target_ulong gva, int bytes); 43c97d6d2cSSergio Andres Gomez Del Real 44a8b991b5SMarkus Armbruster #endif /* X86_MMU_H */ 45