mmu_common.c (691cf34f216141138bb0289735a762dd7d812137) | mmu_common.c (aaf5845b87c6acb7f3e95ea8b45947f98c3fdc7e) |
---|---|
1/* 2 * PowerPC MMU, TLB, SLB and BAT emulation helpers for QEMU. 3 * 4 * Copyright (c) 2003-2007 Jocelyn Mayer 5 * 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 --- 307 unchanged lines hidden (view full) --- 316 317static int mmu6xx_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx, 318 target_ulong eaddr, hwaddr *hashp, 319 MMUAccessType access_type, int type) 320{ 321 PowerPCCPU *cpu = env_archcpu(env); 322 hwaddr hash; 323 target_ulong vsid, sr, pgidx; | 1/* 2 * PowerPC MMU, TLB, SLB and BAT emulation helpers for QEMU. 3 * 4 * Copyright (c) 2003-2007 Jocelyn Mayer 5 * 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 --- 307 unchanged lines hidden (view full) --- 316 317static int mmu6xx_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx, 318 target_ulong eaddr, hwaddr *hashp, 319 MMUAccessType access_type, int type) 320{ 321 PowerPCCPU *cpu = env_archcpu(env); 322 hwaddr hash; 323 target_ulong vsid, sr, pgidx; |
324 int ds, target_page_bits; 325 bool pr, nx; | 324 int target_page_bits; 325 bool pr, ds, nx; |
326 327 /* First try to find a BAT entry if there are any */ 328 if (env->nb_BATs && get_bat_6xx_tlb(env, ctx, eaddr, access_type) == 0) { 329 return 0; 330 } 331 332 /* Perform segment based translation when no BATs matched */ 333 pr = FIELD_EX64(env->msr, MSR, PR); 334 335 sr = env->sr[eaddr >> 28]; 336 ctx->key = (((sr & 0x20000000) && pr) || 337 ((sr & 0x40000000) && !pr)) ? 1 : 0; | 326 327 /* First try to find a BAT entry if there are any */ 328 if (env->nb_BATs && get_bat_6xx_tlb(env, ctx, eaddr, access_type) == 0) { 329 return 0; 330 } 331 332 /* Perform segment based translation when no BATs matched */ 333 pr = FIELD_EX64(env->msr, MSR, PR); 334 335 sr = env->sr[eaddr >> 28]; 336 ctx->key = (((sr & 0x20000000) && pr) || 337 ((sr & 0x40000000) && !pr)) ? 1 : 0; |
338 ds = sr & 0x80000000 ? 1 : 0; | 338 ds = sr & SR32_T; |
339 nx = sr & SR32_NX; 340 vsid = sr & SR32_VSID; 341 target_page_bits = TARGET_PAGE_BITS; 342 qemu_log_mask(CPU_LOG_MMU, 343 "Check segment v=" TARGET_FMT_lx " %d " TARGET_FMT_lx 344 " nip=" TARGET_FMT_lx " lr=" TARGET_FMT_lx 345 " ir=%d dr=%d pr=%d %d t=%d\n", 346 eaddr, (int)(eaddr >> 28), sr, env->nip, env->lr, --- 595 unchanged lines hidden --- | 339 nx = sr & SR32_NX; 340 vsid = sr & SR32_VSID; 341 target_page_bits = TARGET_PAGE_BITS; 342 qemu_log_mask(CPU_LOG_MMU, 343 "Check segment v=" TARGET_FMT_lx " %d " TARGET_FMT_lx 344 " nip=" TARGET_FMT_lx " lr=" TARGET_FMT_lx 345 " ir=%d dr=%d pr=%d %d t=%d\n", 346 eaddr, (int)(eaddr >> 28), sr, env->nip, env->lr, --- 595 unchanged lines hidden --- |