qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: edgar.iglesias@gmail.com
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 06/10] microblaze: Move the saving of the reservation addr into gen_load
Date: Thu, 24 Oct 2013 23:08:53 +0200	[thread overview]
Message-ID: <1382648937-14769-7-git-send-email-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <1382648937-14769-1-git-send-email-edgar.iglesias@gmail.com>

From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>

No functional change.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
---
 target-microblaze/translate.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 232015a..021a504 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -863,7 +863,7 @@ static void dec_imm(DisasContext *dc)
 }
 
 static inline void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
-                            unsigned int size)
+                            unsigned int size, bool exclusive)
 {
     int mem_index = cpu_mmu_index(dc->env);
 
@@ -875,6 +875,10 @@ static inline void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
         tcg_gen_qemu_ld32u(dst, addr, mem_index);
     } else
         cpu_abort(dc->env, "Incorrect load size %d\n", size);
+
+    if (exclusive) {
+        tcg_gen_st_tl(addr, cpu_env, offsetof(CPUMBState, res_addr));
+    }
 }
 
 static inline TCGv *compute_ldst_addr(DisasContext *dc, TCGv *t)
@@ -1046,7 +1050,7 @@ static void dec_load(DisasContext *dc)
          * into v. If the load succeeds, we verify alignment of the
          * address and if that succeeds we write into the destination reg.
          */
-        gen_load(dc, v, *addr, size);
+        gen_load(dc, v, *addr, size, ex);
 
         tcg_gen_movi_tl(cpu_SR[SR_PC], dc->pc);
         gen_helper_memalign(cpu_env, *addr, tcg_const_tl(dc->rd),
@@ -1061,20 +1065,19 @@ static void dec_load(DisasContext *dc)
         tcg_temp_free(v);
     } else {
         if (dc->rd) {
-            gen_load(dc, cpu_R[dc->rd], *addr, size);
+            gen_load(dc, cpu_R[dc->rd], *addr, size, ex);
             if (rev) {
                 dec_byteswap(dc, cpu_R[dc->rd], cpu_R[dc->rd], size);
             }
         } else {
             /* We are loading into r0, no need to reverse.  */
-            gen_load(dc, env_imm, *addr, size);
+            gen_load(dc, env_imm, *addr, size, ex);
         }
     }
 
     if (ex) { /* lwx */
         /* no support for for AXI exclusive so always clear C */
         write_carryi(dc, 0);
-        tcg_gen_st_tl(*addr, cpu_env, offsetof(CPUMBState, res_addr));
     }
 
     if (addr == &t)
-- 
1.7.10.4

  parent reply	other threads:[~2013-10-24 21:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 21:08 [Qemu-devel] [PATCH 00/10] MicroBlaze queue edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 01/10] microblaze: Clarify expected input of write_carry edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 02/10] microblaze: Make write_carryi input a boolean edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 03/10] microblaze: Simplify andn by using tcg_gen_andc edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 04/10] microblaze: Improve srl edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 05/10] microblaze: Improve src edgar.iglesias
2013-10-24 21:08 ` edgar.iglesias [this message]
2013-10-24 21:08 ` [Qemu-devel] [PATCH 07/10] microblaze: Turn res_addr into a tcg global edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 08/10] microblaze: At swx, check that the reserved word is unmodified edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 09/10] hw/microblaze: Indentation cleanups edgar.iglesias
2013-10-24 21:08 ` [Qemu-devel] [PATCH 10/10] hw/microblaze: Add support for loading initrd images edgar.iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382648937-14769-7-git-send-email-edgar.iglesias@gmail.com \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).