cpu.c (fc32b91a88cc9cd560da5488bdca4d69f2bac620) | cpu.c (d6ae8ec6ef2635e521e89fc8708b84245cf00013) |
---|---|
1/* 2 * PowerPC CPU routines for qemu. 3 * 4 * Copyright (c) 2017 Nikunj A Dadhania, IBM Corporation. 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 --- 53 unchanged lines hidden (view full) --- 62} 63 64uint32_t ppc_get_vscr(CPUPPCState *env) 65{ 66 uint32_t sat = (env->vscr_sat.u64[0] | env->vscr_sat.u64[1]) != 0; 67 return env->vscr | (sat << VSCR_SAT); 68} 69 | 1/* 2 * PowerPC CPU routines for qemu. 3 * 4 * Copyright (c) 2017 Nikunj A Dadhania, IBM Corporation. 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 --- 53 unchanged lines hidden (view full) --- 62} 63 64uint32_t ppc_get_vscr(CPUPPCState *env) 65{ 66 uint32_t sat = (env->vscr_sat.u64[0] | env->vscr_sat.u64[1]) != 0; 67 return env->vscr | (sat << VSCR_SAT); 68} 69 |
70#ifdef CONFIG_SOFTMMU 71void ppc_store_sdr1(CPUPPCState *env, target_ulong value) 72{ 73 PowerPCCPU *cpu = env_archcpu(env); 74 qemu_log_mask(CPU_LOG_MMU, "%s: " TARGET_FMT_lx "\n", __func__, value); 75 assert(!cpu->env.has_hv_mode || !cpu->vhyp); 76#if defined(TARGET_PPC64) 77 if (mmu_is_64bit(env->mmu_model)) { 78 target_ulong sdr_mask = SDR_64_HTABORG | SDR_64_HTABSIZE; 79 target_ulong htabsize = value & SDR_64_HTABSIZE; 80 81 if (value & ~sdr_mask) { 82 qemu_log_mask(LOG_GUEST_ERROR, "Invalid bits 0x"TARGET_FMT_lx 83 " set in SDR1", value & ~sdr_mask); 84 value &= sdr_mask; 85 } 86 if (htabsize > 28) { 87 qemu_log_mask(LOG_GUEST_ERROR, "Invalid HTABSIZE 0x" TARGET_FMT_lx 88 " stored in SDR1", htabsize); 89 return; 90 } 91 } 92#endif /* defined(TARGET_PPC64) */ 93 /* FIXME: Should check for valid HTABMASK values in 32-bit case */ 94 env->spr[SPR_SDR1] = value; 95} 96#endif /* CONFIG_SOFTMMU */ 97 | |
98/* GDBstub can read and write MSR... */ 99void ppc_store_msr(CPUPPCState *env, target_ulong value) 100{ 101 hreg_store_msr(env, value, 0); 102} 103 104void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val) 105{ --- 49 unchanged lines hidden --- | 70/* GDBstub can read and write MSR... */ 71void ppc_store_msr(CPUPPCState *env, target_ulong value) 72{ 73 hreg_store_msr(env, value, 0); 74} 75 76void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val) 77{ --- 49 unchanged lines hidden --- |