]>
git.proxmox.com Git - mirror_qemu.git/blob - include/exec/tlb-common.h
2 * Common definitions for the softmmu tlb
4 * Copyright (c) 2003 Fabrice Bellard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef EXEC_TLB_COMMON_H
20 #define EXEC_TLB_COMMON_H 1
22 #define CPU_TLB_ENTRY_BITS 5
24 /* Minimalized TLB entry for use by TCG fast path. */
25 typedef union CPUTLBEntry
{
31 * Addend to virtual address to get host address. IO accesses
32 * use the corresponding iotlb value.
37 * Padding to get a power of two size, as well as index
38 * access to addr_{read,write,code}.
40 uint64_t addr_idx
[(1 << CPU_TLB_ENTRY_BITS
) / sizeof(uint64_t)];
43 QEMU_BUILD_BUG_ON(sizeof(CPUTLBEntry
) != (1 << CPU_TLB_ENTRY_BITS
));
46 * Data elements that are per MMU mode, accessed by the fast path.
47 * The structure is aligned to aid loading the pair with one insn.
49 typedef struct CPUTLBDescFast
{
50 /* Contains (n_entries - 1) << CPU_TLB_ENTRY_BITS */
52 /* The array of tlb entries itself. */
54 } CPUTLBDescFast
QEMU_ALIGNED(2 * sizeof(void *));
56 #endif /* EXEC_TLB_COMMON_H */