diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-18 08:47:10 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-18 08:47:10 +0000 |
commit | 36f696517b1723d627b79aa924bac7c678de01b0 (patch) | |
tree | ea0063b4b3fdd86185f8e73885316f07b6c0dbe1 /target-ppc/op_helper_mem.h | |
parent | 33d68b5f00011c8101aec93ba1bb2b470e35151d (diff) | |
download | qemu-36f696517b1723d627b79aa924bac7c678de01b0.zip qemu-36f696517b1723d627b79aa924bac7c678de01b0.tar.gz qemu-36f696517b1723d627b79aa924bac7c678de01b0.tar.bz2 |
As icbi is not a priviledge instruction and is treated as a load by the MMU
it needs to be implemented for every MMU translation mode.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2492 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper_mem.h')
-rw-r--r-- | target-ppc/op_helper_mem.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/target-ppc/op_helper_mem.h b/target-ppc/op_helper_mem.h index ccee714..49ec1c4 100644 --- a/target-ppc/op_helper_mem.h +++ b/target-ppc/op_helper_mem.h @@ -242,6 +242,35 @@ void glue(do_stsw_le_64, MEMSUFFIX) (int src) } #endif +/* Instruction cache invalidation helper */ +void glue(do_icbi, MEMSUFFIX) (void) +{ + uint32_t tmp; + /* Invalidate one cache line : + * PowerPC specification says this is to be treated like a load + * (not a fetch) by the MMU. To be sure it will be so, + * do the load "by hand". + */ + tmp = glue(ldl, MEMSUFFIX)((uint32_t)T0); + T0 &= ~(ICACHE_LINE_SIZE - 1); + tb_invalidate_page_range((uint32_t)T0, (uint32_t)(T0 + ICACHE_LINE_SIZE)); +} + +#if defined(TARGET_PPC64) +void glue(do_icbi_64, MEMSUFFIX) (void) +{ + uint64_t tmp; + /* Invalidate one cache line : + * PowerPC specification says this is to be treated like a load + * (not a fetch) by the MMU. To be sure it will be so, + * do the load "by hand". + */ + tmp = glue(ldq, MEMSUFFIX)((uint64_t)T0); + T0 &= ~(ICACHE_LINE_SIZE - 1); + tb_invalidate_page_range((uint64_t)T0, (uint64_t)(T0 + ICACHE_LINE_SIZE)); +} +#endif + /* PPC 601 specific instructions (POWER bridge) */ // XXX: to be tested void glue(do_POWER_lscbx, MEMSUFFIX) (int dest, int ra, int rb) |