mmu_common.c (5118ebe8396d2b98217b3d4719e3a420dfb0a929) | mmu_common.c (d6ae8ec6ef2635e521e89fc8708b84245cf00013) |
---|---|
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 --- 44 unchanged lines hidden (view full) --- 53#endif 54 55#ifdef DEBUG_BATS 56# define LOG_BATS(...) qemu_log_mask(CPU_LOG_MMU, __VA_ARGS__) 57#else 58# define LOG_BATS(...) do { } while (0) 59#endif 60 | 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 --- 44 unchanged lines hidden (view full) --- 53#endif 54 55#ifdef DEBUG_BATS 56# define LOG_BATS(...) qemu_log_mask(CPU_LOG_MMU, __VA_ARGS__) 57#else 58# define LOG_BATS(...) do { } while (0) 59#endif 60 |
61void ppc_store_sdr1(CPUPPCState *env, target_ulong value) 62{ 63 PowerPCCPU *cpu = env_archcpu(env); 64 qemu_log_mask(CPU_LOG_MMU, "%s: " TARGET_FMT_lx "\n", __func__, value); 65 assert(!cpu->env.has_hv_mode || !cpu->vhyp); 66#if defined(TARGET_PPC64) 67 if (mmu_is_64bit(env->mmu_model)) { 68 target_ulong sdr_mask = SDR_64_HTABORG | SDR_64_HTABSIZE; 69 target_ulong htabsize = value & SDR_64_HTABSIZE; 70 71 if (value & ~sdr_mask) { 72 qemu_log_mask(LOG_GUEST_ERROR, "Invalid bits 0x"TARGET_FMT_lx 73 " set in SDR1", value & ~sdr_mask); 74 value &= sdr_mask; 75 } 76 if (htabsize > 28) { 77 qemu_log_mask(LOG_GUEST_ERROR, "Invalid HTABSIZE 0x" TARGET_FMT_lx 78 " stored in SDR1", htabsize); 79 return; 80 } 81 } 82#endif /* defined(TARGET_PPC64) */ 83 /* FIXME: Should check for valid HTABMASK values in 32-bit case */ 84 env->spr[SPR_SDR1] = value; 85} 86 |
|
61/*****************************************************************************/ 62/* PowerPC MMU emulation */ 63 64static int pp_check(int key, int pp, int nx) 65{ 66 int access; 67 68 /* Compute access rights */ --- 1536 unchanged lines hidden --- | 87/*****************************************************************************/ 88/* PowerPC MMU emulation */ 89 90static int pp_check(int key, int pp, int nx) 91{ 92 int access; 93 94 /* Compute access rights */ --- 1536 unchanged lines hidden --- |