1*a97c4d3cSBruno Larsen (billionai) /*
2*a97c4d3cSBruno Larsen (billionai) * PowerPC BookS emulation generic mmu definitions for qemu.
3*a97c4d3cSBruno Larsen (billionai) *
4*a97c4d3cSBruno Larsen (billionai) * Copyright (c) 2021 Instituto de Pesquisas Eldorado (eldorado.org.br)
5*a97c4d3cSBruno Larsen (billionai) *
6*a97c4d3cSBruno Larsen (billionai) * This library is free software; you can redistribute it and/or
7*a97c4d3cSBruno Larsen (billionai) * modify it under the terms of the GNU Lesser General Public
8*a97c4d3cSBruno Larsen (billionai) * License as published by the Free Software Foundation; either
9*a97c4d3cSBruno Larsen (billionai) * version 2.1 of the License, or (at your option) any later version.
10*a97c4d3cSBruno Larsen (billionai) *
11*a97c4d3cSBruno Larsen (billionai) * This library is distributed in the hope that it will be useful,
12*a97c4d3cSBruno Larsen (billionai) * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*a97c4d3cSBruno Larsen (billionai) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14*a97c4d3cSBruno Larsen (billionai) * Lesser General Public License for more details.
15*a97c4d3cSBruno Larsen (billionai) *
16*a97c4d3cSBruno Larsen (billionai) * You should have received a copy of the GNU Lesser General Public
17*a97c4d3cSBruno Larsen (billionai) * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18*a97c4d3cSBruno Larsen (billionai) */
19*a97c4d3cSBruno Larsen (billionai)
20*a97c4d3cSBruno Larsen (billionai) #ifndef PPC_MMU_BOOKS_H
21*a97c4d3cSBruno Larsen (billionai) #define PPC_MMU_BOOKS_H
22*a97c4d3cSBruno Larsen (billionai)
23*a97c4d3cSBruno Larsen (billionai) /*
24*a97c4d3cSBruno Larsen (billionai) * These correspond to the mmu_idx values computed in
25*a97c4d3cSBruno Larsen (billionai) * hreg_compute_hflags_value. See the tables therein
26*a97c4d3cSBruno Larsen (billionai) */
mmuidx_pr(int idx)27*a97c4d3cSBruno Larsen (billionai) static inline bool mmuidx_pr(int idx) { return !(idx & 1); }
mmuidx_real(int idx)28*a97c4d3cSBruno Larsen (billionai) static inline bool mmuidx_real(int idx) { return idx & 2; }
mmuidx_hv(int idx)29*a97c4d3cSBruno Larsen (billionai) static inline bool mmuidx_hv(int idx) { return idx & 4; }
30*a97c4d3cSBruno Larsen (billionai) #endif /* PPC_MMU_BOOKS_H */
31