~ubuntu-branches/ubuntu/utopic/qemu/utopic

« back to all changes in this revision

Viewing changes to debian/patches/arm64/0032-target-arm-A64-add-support-for-BR-BLR-and-RET-insns.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn, Serge Hallyn, dann frazier
  • Date: 2014-01-10 12:19:08 UTC
  • Revision ID: package-import@ubuntu.com-20140110121908-6lsn06rypqbokbaf
Tags: 1.7.0+dfsg-2ubuntu6
[ Serge Hallyn ]
* add arm64 patchset from upstream.  The three arm virt patches previously
  pushed are in that set, so drop them.

[ dann frazier ]
* Add packaging for qemu-system-aarch64. This package is currently only
  available for arm64, as full software emulation is not yet supported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 9a43acf1cad20eb16aa85657b28983e015d47d04 Mon Sep 17 00:00:00 2001
 
2
From: Alexander Graf <agraf@suse.de>
 
3
Date: Tue, 17 Dec 2013 19:42:33 +0000
 
4
Subject: [PATCH 32/49] target-arm: A64: add support for BR, BLR and RET insns
 
5
 
 
6
Implement BR, BLR and RET. This is all of the 'unconditional
 
7
branch (register)' instruction category except for ERET
 
8
and DPRS (which are system mode only).
 
9
 
 
10
Signed-off-by: Alexander Graf <agraf@suse.de>
 
11
[claudio: reimplemented on top of new decoder structure]
 
12
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
 
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 
14
Reviewed-by: Richard Henderson <rth@twiddle.net>
 
15
---
 
16
 target-arm/translate-a64.c | 43 +++++++++++++++++++++++++++++++++++++++++--
 
17
 1 file changed, 41 insertions(+), 2 deletions(-)
 
18
 
 
19
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
 
20
index ead5658..b694665 100644
 
21
--- a/target-arm/translate-a64.c
 
22
+++ b/target-arm/translate-a64.c
 
23
@@ -384,10 +384,49 @@ static void disas_exc(DisasContext *s, uint32_t insn)
 
24
     unsupported_encoding(s, insn);
 
25
 }
 
26
 
 
27
-/* Unconditional branch (register) */
 
28
+/* C3.2.7 Unconditional branch (register)
 
29
+ *  31           25 24   21 20   16 15   10 9    5 4     0
 
30
+ * +---------------+-------+-------+-------+------+-------+
 
31
+ * | 1 1 0 1 0 1 1 |  opc  |  op2  |  op3  |  Rn  |  op4  |
 
32
+ * +---------------+-------+-------+-------+------+-------+
 
33
+ */
 
34
 static void disas_uncond_b_reg(DisasContext *s, uint32_t insn)
 
35
 {
 
36
-    unsupported_encoding(s, insn);
 
37
+    unsigned int opc, op2, op3, rn, op4;
 
38
+
 
39
+    opc = extract32(insn, 21, 4);
 
40
+    op2 = extract32(insn, 16, 5);
 
41
+    op3 = extract32(insn, 10, 6);
 
42
+    rn = extract32(insn, 5, 5);
 
43
+    op4 = extract32(insn, 0, 5);
 
44
+
 
45
+    if (op4 != 0x0 || op3 != 0x0 || op2 != 0x1f) {
 
46
+        unallocated_encoding(s);
 
47
+        return;
 
48
+    }
 
49
+
 
50
+    switch (opc) {
 
51
+    case 0: /* BR */
 
52
+    case 2: /* RET */
 
53
+        break;
 
54
+    case 1: /* BLR */
 
55
+        tcg_gen_movi_i64(cpu_reg(s, 30), s->pc);
 
56
+        break;
 
57
+    case 4: /* ERET */
 
58
+    case 5: /* DRPS */
 
59
+        if (rn != 0x1f) {
 
60
+            unallocated_encoding(s);
 
61
+        } else {
 
62
+            unsupported_encoding(s, insn);
 
63
+        }
 
64
+        return;
 
65
+    default:
 
66
+        unallocated_encoding(s);
 
67
+        return;
 
68
+    }
 
69
+
 
70
+    tcg_gen_mov_i64(cpu_pc, cpu_reg(s, rn));
 
71
+    s->is_jmp = DISAS_JUMP;
 
72
 }
 
73
 
 
74
 /* C3.2 Branches, exception generating and system instructions */
 
75
-- 
 
76
1.8.5.2
 
77