mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
s390x/mmu: Use access type definitions instead of magic values
Since there are now proper definitions for the MMU access type, let's use them in the s390x MMU code, too, instead of the hard-to-understand magic values. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
b4ab4572b3
commit
217a4acb21
2 changed files with 6 additions and 6 deletions
|
@ -68,7 +68,7 @@ static void trigger_prot_fault(CPUS390XState *env, target_ulong vaddr,
|
|||
{
|
||||
uint64_t tec;
|
||||
|
||||
tec = vaddr | (rw == 1 ? FS_WRITE : FS_READ) | 4 | asc >> 46;
|
||||
tec = vaddr | (rw == MMU_DATA_STORE ? FS_WRITE : FS_READ) | 4 | asc >> 46;
|
||||
|
||||
DPRINTF("%s: trans_exc_code=%016" PRIx64 "\n", __func__, tec);
|
||||
|
||||
|
@ -85,7 +85,7 @@ static void trigger_page_fault(CPUS390XState *env, target_ulong vaddr,
|
|||
int ilen = ILEN_LATER;
|
||||
uint64_t tec;
|
||||
|
||||
tec = vaddr | (rw == 1 ? FS_WRITE : FS_READ) | asc >> 46;
|
||||
tec = vaddr | (rw == MMU_DATA_STORE ? FS_WRITE : FS_READ) | asc >> 46;
|
||||
|
||||
DPRINTF("%s: vaddr=%016" PRIx64 " bits=%d\n", __func__, vaddr, bits);
|
||||
|
||||
|
@ -94,7 +94,7 @@ static void trigger_page_fault(CPUS390XState *env, target_ulong vaddr,
|
|||
}
|
||||
|
||||
/* Code accesses have an undefined ilc. */
|
||||
if (rw == 2) {
|
||||
if (rw == MMU_INST_FETCH) {
|
||||
ilen = 2;
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
|
|||
|
||||
r = mmu_translate_region(env, vaddr, asc, asce, level, raddr, flags, rw,
|
||||
exc);
|
||||
if ((rw == 1) && !(*flags & PAGE_WRITE)) {
|
||||
if (rw == MMU_DATA_STORE && !(*flags & PAGE_WRITE)) {
|
||||
trigger_prot_fault(env, vaddr, asc, rw, exc);
|
||||
return -1;
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t asc,
|
|||
* Instruction: Primary
|
||||
* Data: Secondary
|
||||
*/
|
||||
if (rw == 2) {
|
||||
if (rw == MMU_INST_FETCH) {
|
||||
r = mmu_translate_asce(env, vaddr, PSW_ASC_PRIMARY, env->cregs[1],
|
||||
raddr, flags, rw, exc);
|
||||
*flags &= ~(PAGE_READ | PAGE_WRITE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue