Patchwork target-sh4: fix TLB invalidation code

login
register
mail settings
Submitter Alexandre Courbot
Date Jan. 25, 2011, 6:32 a.m.
Message ID <1295937121-30652-1-git-send-email-gnurou@gmail.com>
Download mbox | patch
Permalink /patch/80324/
State New
Headers show

Comments

Alexandre Courbot - Jan. 25, 2011, 6:32 a.m.
In cpu_sh4_invalidate_tlb, the UTLB was invalidated twice and the
ITLB left unchaged, probably because of some unfortunate copy/paste.

Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
---
 target-sh4/helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Aurelien Jarno - Jan. 25, 2011, 8:03 a.m.
On Tue, Jan 25, 2011 at 03:32:01PM +0900, Alexandre Courbot wrote:
> In cpu_sh4_invalidate_tlb, the UTLB was invalidated twice and the
> ITLB left unchaged, probably because of some unfortunate copy/paste.
> 
> Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
> ---
>  target-sh4/helper.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target-sh4/helper.c b/target-sh4/helper.c
> index c34d2f5..aec4d75 100644
> --- a/target-sh4/helper.c
> +++ b/target-sh4/helper.c
> @@ -562,8 +562,8 @@ void cpu_load_tlb(CPUSH4State * env)
>          entry->v = 0;
>      }
>      /* ITLB */
> -    for (i = 0; i < UTLB_SIZE; i++) {
> -        tlb_t * entry = &s->utlb[i];
> +    for (i = 0; i < ITLB_SIZE; i++) {
> +        tlb_t * entry = &s->itlb[i];
>          entry->v = 0;
>      }
>  

Thanks applied.

Patch

diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index c34d2f5..aec4d75 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -562,8 +562,8 @@  void cpu_load_tlb(CPUSH4State * env)
         entry->v = 0;
     }
     /* ITLB */
-    for (i = 0; i < UTLB_SIZE; i++) {
-        tlb_t * entry = &s->utlb[i];
+    for (i = 0; i < ITLB_SIZE; i++) {
+        tlb_t * entry = &s->itlb[i];
         entry->v = 0;
     }