summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch494
1 files changed, 162 insertions, 332 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
index 6582af01..1dc6b695 100644
--- a/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
@@ -1,37 +1,33 @@
1From 34e572e123b166122cc54a8d8e66676c36515711 Mon Sep 17 00:00:00 2001 1From 928d8d1f05274ab6029e4da7d659312c769beded Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Thu, 31 Jan 2019 14:36:00 +0530 3Date: Thu, 31 Jan 2019 14:36:00 +0530
4Subject: [PATCH 40/43] [Patch, microblaze]: Adding 64 bit MB support Added new 4Subject: [PATCH 40/40] [Patch, microblaze]: Adding 64 bit MB support
5 architecture to Microblaze 64-bit support to GDB Signed-off-by :Nagaraju
6 Mekala <nmekala@xilix.com>
7 5
8Merged on top of binutils work. 6Added new architecture to Microblaze 64-bit support to GDB
9 7
10Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> 8Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
11--- 9---
12 bfd/archures.c | 2 + 10 bfd/archures.c | 2 +
13 bfd/bfd-in2.h | 2 + 11 bfd/bfd-in2.h | 2 +
14 bfd/cpu-microblaze.c | 12 +- 12 bfd/cpu-microblaze.c | 16 +-
15 bfd/elf32-microblaze.c | 93 +------- 13 bfd/elf32-microblaze.c | 9 +
16 gas/config/tc-microblaze.c | 16 +- 14 gas/config/tc-microblaze.c | 14 ++
17 gas/config/tc-microblaze.h | 4 + 15 gas/config/tc-microblaze.h | 4 +
18 gdb/Makefile.in | 2 +-
19 gdb/features/Makefile | 3 + 16 gdb/features/Makefile | 3 +
20 gdb/features/microblaze-core.xml | 6 +- 17 gdb/features/microblaze-core.xml | 6 +-
21 gdb/features/microblaze-stack-protect.xml | 4 +- 18 gdb/features/microblaze-with-stack-protect.c | 4 +-
22 gdb/features/microblaze-with-stack-protect.c | 8 +-
23 gdb/features/microblaze.c | 6 +- 19 gdb/features/microblaze.c | 6 +-
24 gdb/features/microblaze64-core.xml | 69 ++++++ 20 gdb/features/microblaze64-core.xml | 69 +++++++
25 gdb/features/microblaze64-stack-protect.xml | 12 + 21 gdb/features/microblaze64-stack-protect.xml | 12 ++
26 .../microblaze64-with-stack-protect.c | 79 +++++++ 22 .../microblaze64-with-stack-protect.c | 79 ++++++++
27 .../microblaze64-with-stack-protect.xml | 12 + 23 .../microblaze64-with-stack-protect.xml | 12 ++
28 gdb/features/microblaze64.c | 77 +++++++ 24 gdb/features/microblaze64.c | 77 ++++++++
29 gdb/features/microblaze64.xml | 11 + 25 gdb/features/microblaze64.xml | 11 ++
30 gdb/microblaze-tdep.c | 207 ++++++++++++++++-- 26 gdb/microblaze-linux-tdep.c | 29 ++-
31 gdb/microblaze-tdep.h | 8 +- 27 gdb/microblaze-tdep.c | 176 ++++++++++++++++--
28 gdb/microblaze-tdep.h | 9 +-
32 .../microblaze-with-stack-protect.dat | 4 +- 29 .../microblaze-with-stack-protect.dat | 4 +-
33 opcodes/microblaze-opc.h | 1 - 30 20 files changed, 504 insertions(+), 40 deletions(-)
34 22 files changed, 504 insertions(+), 134 deletions(-)
35 create mode 100644 gdb/features/microblaze64-core.xml 31 create mode 100644 gdb/features/microblaze64-core.xml
36 create mode 100644 gdb/features/microblaze64-stack-protect.xml 32 create mode 100644 gdb/features/microblaze64-stack-protect.xml
37 create mode 100644 gdb/features/microblaze64-with-stack-protect.c 33 create mode 100644 gdb/features/microblaze64-with-stack-protect.c
@@ -40,10 +36,10 @@ Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
40 create mode 100644 gdb/features/microblaze64.xml 36 create mode 100644 gdb/features/microblaze64.xml
41 37
42diff --git a/bfd/archures.c b/bfd/archures.c 38diff --git a/bfd/archures.c b/bfd/archures.c
43index 647cf0d8d4..3fdf7c3c0e 100644 39index 551ec8732f0..627d81261da 100644
44--- a/bfd/archures.c 40--- a/bfd/archures.c
45+++ b/bfd/archures.c 41+++ b/bfd/archures.c
46@@ -512,6 +512,8 @@ DESCRIPTION 42@@ -522,6 +522,8 @@ DESCRIPTION
47 . bfd_arch_lm32, {* Lattice Mico32. *} 43 . bfd_arch_lm32, {* Lattice Mico32. *}
48 .#define bfd_mach_lm32 1 44 .#define bfd_mach_lm32 1
49 . bfd_arch_microblaze,{* Xilinx MicroBlaze. *} 45 . bfd_arch_microblaze,{* Xilinx MicroBlaze. *}
@@ -53,10 +49,10 @@ index 647cf0d8d4..3fdf7c3c0e 100644
53 . bfd_arch_tilegx, {* Tilera TILE-Gx. *} 49 . bfd_arch_tilegx, {* Tilera TILE-Gx. *}
54 .#define bfd_mach_tilepro 1 50 .#define bfd_mach_tilepro 1
55diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 51diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
56index 33c9cb62d9..db624c62b9 100644 52index 8902d9c7939..0e5071c235d 100644
57--- a/bfd/bfd-in2.h 53--- a/bfd/bfd-in2.h
58+++ b/bfd/bfd-in2.h 54+++ b/bfd/bfd-in2.h
59@@ -2411,6 +2411,8 @@ enum bfd_architecture 55@@ -1922,6 +1922,8 @@ enum bfd_architecture
60 bfd_arch_lm32, /* Lattice Mico32. */ 56 bfd_arch_lm32, /* Lattice Mico32. */
61 #define bfd_mach_lm32 1 57 #define bfd_mach_lm32 1
62 bfd_arch_microblaze,/* Xilinx MicroBlaze. */ 58 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
@@ -66,7 +62,7 @@ index 33c9cb62d9..db624c62b9 100644
66 bfd_arch_tilegx, /* Tilera TILE-Gx. */ 62 bfd_arch_tilegx, /* Tilera TILE-Gx. */
67 #define bfd_mach_tilepro 1 63 #define bfd_mach_tilepro 1
68diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c 64diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c
69index c91ba46f75..8e7bcead28 100644 65index f94dc2c177b..4dbc149155e 100644
70--- a/bfd/cpu-microblaze.c 66--- a/bfd/cpu-microblaze.c
71+++ b/bfd/cpu-microblaze.c 67+++ b/bfd/cpu-microblaze.c
72@@ -30,8 +30,8 @@ const bfd_arch_info_type bfd_microblaze_arch[] = 68@@ -30,8 +30,8 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
@@ -80,16 +76,23 @@ index c91ba46f75..8e7bcead28 100644
80 "microblaze", /* Architecture name. */ 76 "microblaze", /* Architecture name. */
81 "MicroBlaze", /* Printable name. */ 77 "MicroBlaze", /* Printable name. */
82 3, /* Section align power. */ 78 3, /* Section align power. */
83@@ -46,7 +46,7 @@ const bfd_arch_info_type bfd_microblaze_arch[] = 79@@ -43,11 +43,11 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
84 32, /* 32 bits in an address. */ 80 0 /* Maximum offset of a reloc from the start of an insn. */
85 8, /* 8 bits in a byte. */ 81 },
86 bfd_arch_microblaze, /* Architecture. */ 82 {
83- 32, /* Bits in a word. */
84- 32, /* Bits in an address. */
85- 8, /* Bits in a byte. */
86+ 32, /* 32 bits in a word. */
87+ 32, /* 32 bits in an address. */
88+ 8, /* 8 bits in a byte. */
89 bfd_arch_microblaze, /* Architecture number. */
87- 0, /* Machine number - 0 for now. */ 90- 0, /* Machine number - 0 for now. */
88+ bfd_mach_microblaze, /* 32 bit Machine */ 91+ bfd_mach_microblaze, /* 32 bit Machine */
89 "microblaze", /* Architecture name. */ 92 "microblaze", /* Architecture name. */
90 "MicroBlaze", /* Printable name. */ 93 "MicroBlaze", /* Printable name. */
91 3, /* Section align power. */ 94 3, /* Section align power. */
92@@ -62,7 +62,7 @@ const bfd_arch_info_type bfd_microblaze_arch[] = 95@@ -64,7 +64,7 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
93 32, /* 32 bits in an address. */ 96 32, /* 32 bits in an address. */
94 8, /* 8 bits in a byte. */ 97 8, /* 8 bits in a byte. */
95 bfd_arch_microblaze, /* Architecture. */ 98 bfd_arch_microblaze, /* Architecture. */
@@ -98,110 +101,20 @@ index c91ba46f75..8e7bcead28 100644
98 "microblaze", /* Architecture name. */ 101 "microblaze", /* Architecture name. */
99 "MicroBlaze", /* Printable name. */ 102 "MicroBlaze", /* Printable name. */
100 3, /* Section align power. */ 103 3, /* Section align power. */
101@@ -76,8 +76,8 @@ const bfd_arch_info_type bfd_microblaze_arch[] = 104@@ -80,7 +80,7 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
102 64, /* 32 bits in a word. */
103 64, /* 32 bits in an address. */ 105 64, /* 32 bits in an address. */
104 8, /* 8 bits in a byte. */ 106 8, /* 8 bits in a byte. */
105- bfd_arch_microblaze, /* Architecture. */ 107 bfd_arch_microblaze, /* Architecture. */
106- 0, /* Machine number - 0 for now. */ 108- 0, /* Machine number - 0 for now. */
107+ bfd_arch_microblaze, /* Architecture. */
108+ bfd_mach_microblaze64, /* 64 bit Machine */ 109+ bfd_mach_microblaze64, /* 64 bit Machine */
109 "microblaze", /* Architecture name. */ 110 "microblaze", /* Architecture name. */
110 "MicroBlaze", /* Printable name. */ 111 "MicroBlaze", /* Printable name. */
111 3, /* Section align power. */ 112 3, /* Section align power. */
112diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 113diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
113index c280431df6..f9996eae12 100644 114index a4b15882d77..d33f709b8b3 100644
114--- a/bfd/elf32-microblaze.c 115--- a/bfd/elf32-microblaze.c
115+++ b/bfd/elf32-microblaze.c 116+++ b/bfd/elf32-microblaze.c
116@@ -767,87 +767,6 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name) 117@@ -3585,6 +3585,14 @@ microblaze_elf_finish_dynamic_sections (bfd *output_bfd,
117 return _bfd_elf_is_local_label_name (abfd, name);
118 }
119
120-/* Support for core dump NOTE sections. */
121-static bfd_boolean
122-microblaze_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
123-{
124- int offset;
125- unsigned int size;
126-
127- switch (note->descsz)
128- {
129- default:
130- return FALSE;
131-
132- case 228: /* Linux/MicroBlaze */
133- /* pr_cursig */
134- elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
135-
136- /* pr_pid */
137- elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
138-
139- /* pr_reg */
140- offset = 72;
141- size = 50 * 4;
142-
143- break;
144- }
145-
146- /* Make a ".reg/999" section. */
147- return _bfd_elfcore_make_pseudosection (abfd, ".reg",
148- size, note->descpos + offset);
149-}
150-
151-static bfd_boolean
152-microblaze_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
153-{
154- switch (note->descsz)
155- {
156- default:
157- return FALSE;
158-
159- case 128: /* Linux/MicroBlaze elf_prpsinfo */
160- elf_tdata (abfd)->core->program
161- = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
162- elf_tdata (abfd)->core->command
163- = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
164- }
165-
166- /* Note that for some reason, a spurious space is tacked
167- onto the end of the args in some (at least one anyway)
168- implementations, so strip it off if it exists. */
169-
170- {
171- char *command = elf_tdata (abfd)->core->command;
172- int n = strlen (command);
173-
174- if (0 < n && command[n - 1] == ' ')
175- command[n - 1] = '\0';
176- }
177-
178- return TRUE;
179-}
180-
181-/* The microblaze linker (like many others) needs to keep track of
182- the number of relocs that it decides to copy as dynamic relocs in
183- check_relocs for each symbol. This is so that it can later discard
184- them if they are found to be unnecessary. We store the information
185- in a field extending the regular ELF linker hash table. */
186-
187-struct elf32_mb_dyn_relocs
188-{
189- struct elf32_mb_dyn_relocs *next;
190-
191- /* The input section of the reloc. */
192- asection *sec;
193-
194- /* Total number of relocs copied for the input section. */
195- bfd_size_type count;
196-
197- /* Number of pc-relative relocs copied for the input section. */
198- bfd_size_type pc_count;
199-};
200-
201 /* ELF linker hash entry. */
202
203 struct elf32_mb_link_hash_entry
204@@ -3683,6 +3602,14 @@ microblaze_elf_finish_dynamic_sections (bfd *output_bfd,
205 return TRUE; 118 return TRUE;
206 } 119 }
207 120
@@ -216,42 +129,30 @@ index c280431df6..f9996eae12 100644
216 /* Hook called by the linker routine which adds symbols from an object 129 /* Hook called by the linker routine which adds symbols from an object
217 file. We use it to put .comm items in .sbss, and not .bss. */ 130 file. We use it to put .comm items in .sbss, and not .bss. */
218 131
219@@ -3752,8 +3679,6 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 132@@ -3657,5 +3665,6 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
220 #define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol 133
221 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections 134 #define elf_backend_grok_prstatus microblaze_elf_grok_prstatus
222 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook 135 #define elf_backend_grok_psinfo microblaze_elf_grok_psinfo
223-
224-#define elf_backend_grok_prstatus microblaze_elf_grok_prstatus
225-#define elf_backend_grok_psinfo microblaze_elf_grok_psinfo
226+#define elf_backend_object_p elf_microblaze_object_p 136+#define elf_backend_object_p elf_microblaze_object_p
227 137
228 #include "elf32-target.h" 138 #include "elf32-target.h"
229diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c 139diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
230index 3ff6a14baf..95a1e69729 100644 140index 62daa56b47a..b22f6de2df6 100644
231--- a/gas/config/tc-microblaze.c 141--- a/gas/config/tc-microblaze.c
232+++ b/gas/config/tc-microblaze.c 142+++ b/gas/config/tc-microblaze.c
233@@ -426,7 +426,10 @@ md_begin (void) 143@@ -437,6 +437,11 @@ md_begin (void)
234 const char *prev_name = "";
235 144
236 opcode_hash_control = hash_new (); 145 opcode_hash_control = hash_new ();
237- 146
238+ if (microblaze_arch_size == 64) 147+ if (microblaze_arch_size == 64)
239+ bfd_set_arch_mach (stdoutput, bfd_arch_microblaze, bfd_mach_microblaze64); 148+ bfd_set_arch_mach (stdoutput, bfd_arch_microblaze, bfd_mach_microblaze64);
240+ else 149+ else
241+ bfd_set_arch_mach (stdoutput, bfd_arch_microblaze, bfd_mach_microblaze); 150+ bfd_set_arch_mach (stdoutput, bfd_arch_microblaze, bfd_mach_microblaze);
151+
242 /* Insert unique names into hash table. */ 152 /* Insert unique names into hash table. */
243 for (opcode = (struct opcodes *)opcodes; opcode->name; opcode ++) 153 for (opcode = (struct op_code_struct *)opcodes; opcode->name; opcode ++)
244 { 154 {
245@@ -1348,7 +1351,7 @@ md_assemble (char * str) 155@@ -3494,6 +3499,15 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED)
246 if ((temp != 0) && (temp != 0xFFFF8000))
247 {
248 /* Needs an immediate inst. */
249- opcode1 = (struct op_code_struct *) hash_find (opcode_hash_control, "imm");
250+ opcode1 = (struct op_code_struct *) hash_find (opcode_hash_control, "imm");
251 if (opcode1 == NULL)
252 {
253 as_bad (_("unknown opcode \"%s\""), "imm");
254@@ -3431,6 +3434,15 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED)
255 } 156 }
256 157
257 158
@@ -268,7 +169,7 @@ index 3ff6a14baf..95a1e69729 100644
268 found a machine specific op in an expression, 169 found a machine specific op in an expression,
269 then we create relocs accordingly. */ 170 then we create relocs accordingly. */
270diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h 171diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h
271index 9d38d2ced5..13f58917e7 100644 172index 7435a70ef5e..90c2a4a5558 100644
272--- a/gas/config/tc-microblaze.h 173--- a/gas/config/tc-microblaze.h
273+++ b/gas/config/tc-microblaze.h 174+++ b/gas/config/tc-microblaze.h
274@@ -23,6 +23,10 @@ 175@@ -23,6 +23,10 @@
@@ -282,34 +183,21 @@ index 9d38d2ced5..13f58917e7 100644
282 #ifndef TARGET_BYTES_BIG_ENDIAN 183 #ifndef TARGET_BYTES_BIG_ENDIAN
283 /* Used to initialise target_big_endian. */ 184 /* Used to initialise target_big_endian. */
284 #define TARGET_BYTES_BIG_ENDIAN 1 185 #define TARGET_BYTES_BIG_ENDIAN 1
285diff --git a/gdb/Makefile.in b/gdb/Makefile.in
286index 8c9a3c07c0..15387197c7 100644
287--- a/gdb/Makefile.in
288+++ b/gdb/Makefile.in
289@@ -2265,7 +2265,7 @@ ALLDEPFILES = \
290 m68k-tdep.c \
291 microblaze-linux-tdep.c \
292 microblaze-tdep.c \
293- microblaze-linux-nat.c \
294+ microblaze-linux-nat.c \
295 mingw-hdep.c \
296 mips-fbsd-nat.c \
297 mips-fbsd-tdep.c \
298diff --git a/gdb/features/Makefile b/gdb/features/Makefile 186diff --git a/gdb/features/Makefile b/gdb/features/Makefile
299index 3d84ca09a1..fdeec19753 100644 187index d0af9a47b48..2c3cf91b69f 100644
300--- a/gdb/features/Makefile 188--- a/gdb/features/Makefile
301+++ b/gdb/features/Makefile 189+++ b/gdb/features/Makefile
302@@ -64,6 +64,7 @@ WHICH = aarch64 \ 190@@ -46,6 +46,7 @@
303 i386/x32-avx-avx512-linux \ 191 # List of .dat files to create in ../regformats/
304 mips-linux mips-dsp-linux \ 192 WHICH = mips-linux mips-dsp-linux \
305 microblaze-with-stack-protect \ 193 microblaze-with-stack-protect \
306+ microblaze64-with-stack-protect \ 194+ microblaze64-with-stack-protect \
307 mips64-linux mips64-dsp-linux \ 195 mips64-linux mips64-dsp-linux \
308 nios2-linux \ 196 nios2-linux \
309 rs6000/powerpc-32 \ 197 rs6000/powerpc-32 \
310@@ -135,7 +136,9 @@ XMLTOC = \ 198@@ -107,7 +108,9 @@ OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))
311 arm/arm-with-vfpv2.xml \ 199 # to make on the command line.
312 arm/arm-with-vfpv3.xml \ 200 XMLTOC = \
313 microblaze-with-stack-protect.xml \ 201 microblaze-with-stack-protect.xml \
314+ microblaze64-with-stack-protect.xml \ 202+ microblaze64-with-stack-protect.xml \
315 microblaze.xml \ 203 microblaze.xml \
@@ -318,7 +206,7 @@ index 3d84ca09a1..fdeec19753 100644
318 mips-linux.xml \ 206 mips-linux.xml \
319 mips64-dsp-linux.xml \ 207 mips64-dsp-linux.xml \
320diff --git a/gdb/features/microblaze-core.xml b/gdb/features/microblaze-core.xml 208diff --git a/gdb/features/microblaze-core.xml b/gdb/features/microblaze-core.xml
321index 88c93e5d66..5bc3e49f84 100644 209index f272650a41b..d1f2282fd1e 100644
322--- a/gdb/features/microblaze-core.xml 210--- a/gdb/features/microblaze-core.xml
323+++ b/gdb/features/microblaze-core.xml 211+++ b/gdb/features/microblaze-core.xml
324@@ -8,7 +8,7 @@ 212@@ -8,7 +8,7 @@
@@ -343,24 +231,11 @@ index 88c93e5d66..5bc3e49f84 100644
343 <reg name="rtlbsx" bitsize="32"/> 231 <reg name="rtlbsx" bitsize="32"/>
344 <reg name="rtlblo" bitsize="32"/> 232 <reg name="rtlblo" bitsize="32"/>
345 <reg name="rtlbhi" bitsize="32"/> 233 <reg name="rtlbhi" bitsize="32"/>
346+ <reg name="slr" bitsize="32"/> 234+ <reg name="rslr" bitsize="32"/>
347+ <reg name="shr" bitsize="32"/> 235+ <reg name="rshr" bitsize="32"/>
348 </feature>
349diff --git a/gdb/features/microblaze-stack-protect.xml b/gdb/features/microblaze-stack-protect.xml
350index 870c148bb0..a7f27b903c 100644
351--- a/gdb/features/microblaze-stack-protect.xml
352+++ b/gdb/features/microblaze-stack-protect.xml
353@@ -7,6 +7,6 @@
354
355 <!DOCTYPE feature SYSTEM "gdb-target.dtd">
356 <feature name="org.gnu.gdb.microblaze.stack-protect">
357- <reg name="rslr" bitsize="32"/>
358- <reg name="rshr" bitsize="32"/>
359+ <reg name="slr" bitsize="32"/>
360+ <reg name="shr" bitsize="32"/>
361 </feature> 236 </feature>
362diff --git a/gdb/features/microblaze-with-stack-protect.c b/gdb/features/microblaze-with-stack-protect.c 237diff --git a/gdb/features/microblaze-with-stack-protect.c b/gdb/features/microblaze-with-stack-protect.c
363index b39aa19887..609934e2b4 100644 238index b39aa198874..ab162fd2588 100644
364--- a/gdb/features/microblaze-with-stack-protect.c 239--- a/gdb/features/microblaze-with-stack-protect.c
365+++ b/gdb/features/microblaze-with-stack-protect.c 240+++ b/gdb/features/microblaze-with-stack-protect.c
366@@ -14,7 +14,7 @@ initialize_tdesc_microblaze_with_stack_protect (void) 241@@ -14,7 +14,7 @@ initialize_tdesc_microblaze_with_stack_protect (void)
@@ -381,19 +256,8 @@ index b39aa19887..609934e2b4 100644
381 tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int"); 256 tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int");
382 tdesc_create_reg (feature, "rear", 34, 1, NULL, 32, "int"); 257 tdesc_create_reg (feature, "rear", 34, 1, NULL, 32, "int");
383 tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int"); 258 tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int");
384@@ -72,8 +72,8 @@ initialize_tdesc_microblaze_with_stack_protect (void)
385 tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
386
387 feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze.stack-protect");
388- tdesc_create_reg (feature, "rslr", 57, 1, NULL, 32, "int");
389- tdesc_create_reg (feature, "rshr", 58, 1, NULL, 32, "int");
390+ tdesc_create_reg (feature, "slr", 57, 1, NULL, 32, "int");
391+ tdesc_create_reg (feature, "shr", 58, 1, NULL, 32, "int");
392
393 tdesc_microblaze_with_stack_protect = result;
394 }
395diff --git a/gdb/features/microblaze.c b/gdb/features/microblaze.c 259diff --git a/gdb/features/microblaze.c b/gdb/features/microblaze.c
396index 6c86fc0770..ceb98ca8b8 100644 260index 6c86fc07700..7919ac96e62 100644
397--- a/gdb/features/microblaze.c 261--- a/gdb/features/microblaze.c
398+++ b/gdb/features/microblaze.c 262+++ b/gdb/features/microblaze.c
399@@ -14,7 +14,7 @@ initialize_tdesc_microblaze (void) 263@@ -14,7 +14,7 @@ initialize_tdesc_microblaze (void)
@@ -418,14 +282,14 @@ index 6c86fc0770..ceb98ca8b8 100644
418 tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int"); 282 tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int");
419 tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int"); 283 tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int");
420 tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int"); 284 tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
421+ tdesc_create_reg (feature, "slr", 57, 1, NULL, 64, "uint64"); 285+ tdesc_create_reg (feature, "rslr", 57, 1, NULL, 64, "uint64");
422+ tdesc_create_reg (feature, "shr", 58, 1, NULL, 64, "uint64"); 286+ tdesc_create_reg (feature, "rshr", 58, 1, NULL, 64, "uint64");
423 287
424 tdesc_microblaze = result; 288 tdesc_microblaze = result;
425 } 289 }
426diff --git a/gdb/features/microblaze64-core.xml b/gdb/features/microblaze64-core.xml 290diff --git a/gdb/features/microblaze64-core.xml b/gdb/features/microblaze64-core.xml
427new file mode 100644 291new file mode 100644
428index 0000000000..96e99e2fb2 292index 00000000000..b9adadfade6
429--- /dev/null 293--- /dev/null
430+++ b/gdb/features/microblaze64-core.xml 294+++ b/gdb/features/microblaze64-core.xml
431@@ -0,0 +1,69 @@ 295@@ -0,0 +1,69 @@
@@ -495,12 +359,12 @@ index 0000000000..96e99e2fb2
495+ <reg name="rtlbsx" bitsize="32"/> 359+ <reg name="rtlbsx" bitsize="32"/>
496+ <reg name="rtlblo" bitsize="32"/> 360+ <reg name="rtlblo" bitsize="32"/>
497+ <reg name="rtlbhi" bitsize="32"/> 361+ <reg name="rtlbhi" bitsize="32"/>
498+ <reg name="slr" bitsize="64"/> 362+ <reg name="rslr" bitsize="64"/>
499+ <reg name="shr" bitsize="64"/> 363+ <reg name="rshr" bitsize="64"/>
500+</feature> 364+</feature>
501diff --git a/gdb/features/microblaze64-stack-protect.xml b/gdb/features/microblaze64-stack-protect.xml 365diff --git a/gdb/features/microblaze64-stack-protect.xml b/gdb/features/microblaze64-stack-protect.xml
502new file mode 100644 366new file mode 100644
503index 0000000000..1bbf5fc3ce 367index 00000000000..9d7ea8b9fd7
504--- /dev/null 368--- /dev/null
505+++ b/gdb/features/microblaze64-stack-protect.xml 369+++ b/gdb/features/microblaze64-stack-protect.xml
506@@ -0,0 +1,12 @@ 370@@ -0,0 +1,12 @@
@@ -513,12 +377,12 @@ index 0000000000..1bbf5fc3ce
513+ 377+
514+<!DOCTYPE feature SYSTEM "gdb-target.dtd"> 378+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
515+<feature name="org.gnu.gdb.microblaze64.stack-protect"> 379+<feature name="org.gnu.gdb.microblaze64.stack-protect">
516+ <reg name="slr" bitsize="64"/> 380+ <reg name="rslr" bitsize="64"/>
517+ <reg name="shr" bitsize="64"/> 381+ <reg name="rshr" bitsize="64"/>
518+</feature> 382+</feature>
519diff --git a/gdb/features/microblaze64-with-stack-protect.c b/gdb/features/microblaze64-with-stack-protect.c 383diff --git a/gdb/features/microblaze64-with-stack-protect.c b/gdb/features/microblaze64-with-stack-protect.c
520new file mode 100644 384new file mode 100644
521index 0000000000..f448c9a749 385index 00000000000..249cb534daa
522--- /dev/null 386--- /dev/null
523+++ b/gdb/features/microblaze64-with-stack-protect.c 387+++ b/gdb/features/microblaze64-with-stack-protect.c
524@@ -0,0 +1,79 @@ 388@@ -0,0 +1,79 @@
@@ -596,14 +460,14 @@ index 0000000000..f448c9a749
596+ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int"); 460+ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
597+ 461+
598+ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze64.stack-protect"); 462+ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze64.stack-protect");
599+ tdesc_create_reg (feature, "slr", 57, 1, NULL, 64, "uint64"); 463+ tdesc_create_reg (feature, "rslr", 57, 1, NULL, 64, "uint64");
600+ tdesc_create_reg (feature, "shr", 58, 1, NULL, 64, "uint64"); 464+ tdesc_create_reg (feature, "rshr", 58, 1, NULL, 64, "uint64");
601+ 465+
602+ tdesc_microblaze64_with_stack_protect = result; 466+ tdesc_microblaze64_with_stack_protect = result;
603+} 467+}
604diff --git a/gdb/features/microblaze64-with-stack-protect.xml b/gdb/features/microblaze64-with-stack-protect.xml 468diff --git a/gdb/features/microblaze64-with-stack-protect.xml b/gdb/features/microblaze64-with-stack-protect.xml
605new file mode 100644 469new file mode 100644
606index 0000000000..0e9f01611f 470index 00000000000..0e9f01611f3
607--- /dev/null 471--- /dev/null
608+++ b/gdb/features/microblaze64-with-stack-protect.xml 472+++ b/gdb/features/microblaze64-with-stack-protect.xml
609@@ -0,0 +1,12 @@ 473@@ -0,0 +1,12 @@
@@ -621,7 +485,7 @@ index 0000000000..0e9f01611f
621+</target> 485+</target>
622diff --git a/gdb/features/microblaze64.c b/gdb/features/microblaze64.c 486diff --git a/gdb/features/microblaze64.c b/gdb/features/microblaze64.c
623new file mode 100644 487new file mode 100644
624index 0000000000..1aa37c4512 488index 00000000000..5d3e2c8cd91
625--- /dev/null 489--- /dev/null
626+++ b/gdb/features/microblaze64.c 490+++ b/gdb/features/microblaze64.c
627@@ -0,0 +1,77 @@ 491@@ -0,0 +1,77 @@
@@ -697,14 +561,14 @@ index 0000000000..1aa37c4512
697+ tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int"); 561+ tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int");
698+ tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int"); 562+ tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int");
699+ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int"); 563+ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
700+ tdesc_create_reg (feature, "slr", 57, 1, NULL, 64, "uint64"); 564+ tdesc_create_reg (feature, "rslr", 57, 1, NULL, 64, "uint64");
701+ tdesc_create_reg (feature, "shr", 58, 1, NULL, 64, "uint64"); 565+ tdesc_create_reg (feature, "rshr", 58, 1, NULL, 64, "uint64");
702+ 566+
703+ tdesc_microblaze64 = result; 567+ tdesc_microblaze64 = result;
704+} 568+}
705diff --git a/gdb/features/microblaze64.xml b/gdb/features/microblaze64.xml 569diff --git a/gdb/features/microblaze64.xml b/gdb/features/microblaze64.xml
706new file mode 100644 570new file mode 100644
707index 0000000000..515d18e65c 571index 00000000000..515d18e65cf
708--- /dev/null 572--- /dev/null
709+++ b/gdb/features/microblaze64.xml 573+++ b/gdb/features/microblaze64.xml
710@@ -0,0 +1,11 @@ 574@@ -0,0 +1,11 @@
@@ -719,8 +583,55 @@ index 0000000000..515d18e65c
719+<target> 583+<target>
720+ <xi:include href="microblaze64-core.xml"/> 584+ <xi:include href="microblaze64-core.xml"/>
721+</target> 585+</target>
586diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
587index 0d5c08d24f6..a9a0eef3854 100644
588--- a/gdb/microblaze-linux-tdep.c
589+++ b/gdb/microblaze-linux-tdep.c
590@@ -159,9 +159,30 @@ microblaze_linux_init_abi (struct gdbarch_info info,
591
592 /* BFD target for core files. */
593 if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
594- set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze");
595+ {
596+ if (info.bfd_arch_info->mach == bfd_mach_microblaze64) {
597+ set_gdbarch_gcore_bfd_target (gdbarch, "elf64-microblaze");
598+ MICROBLAZE_REGISTER_SIZE=8;
599+ }
600+ else
601+ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze");
602+ }
603 else
604- set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel");
605+ {
606+ if (info.bfd_arch_info->mach == bfd_mach_microblaze64) {
607+ set_gdbarch_gcore_bfd_target (gdbarch, "elf64-microblazeel");
608+ MICROBLAZE_REGISTER_SIZE=8;
609+ }
610+ else
611+ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel");
612+ }
613+
614+ switch (info.bfd_arch_info->mach)
615+ {
616+ case bfd_mach_microblaze64:
617+ set_gdbarch_ptr_bit (gdbarch, 64);
618+ break;
619+ }
620
621
622 /* Shared library handling. */
623@@ -177,6 +198,8 @@ void _initialize_microblaze_linux_tdep ();
624 void
625 _initialize_microblaze_linux_tdep ()
626 {
627- gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX,
628+ gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze, GDB_OSABI_LINUX,
629+ microblaze_linux_init_abi);
630+ gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze64, GDB_OSABI_LINUX,
631 microblaze_linux_init_abi);
632 }
722diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 633diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
723index 49713ea9b1..0605283c9e 100644 634index 7462a1f7ce6..5dd0b3ea532 100644
724--- a/gdb/microblaze-tdep.c 635--- a/gdb/microblaze-tdep.c
725+++ b/gdb/microblaze-tdep.c 636+++ b/gdb/microblaze-tdep.c
726@@ -40,7 +40,9 @@ 637@@ -40,7 +40,9 @@
@@ -733,57 +644,34 @@ index 49713ea9b1..0605283c9e 100644
733 644
734 /* Instruction macros used for analyzing the prologue. */ 645 /* Instruction macros used for analyzing the prologue. */
735 /* This set of instruction macros need to be changed whenever the 646 /* This set of instruction macros need to be changed whenever the
736@@ -75,12 +77,13 @@ static const char *microblaze_register_names[] = 647@@ -79,8 +81,9 @@ static const char *microblaze_register_names[] =
737 "rpvr0", "rpvr1", "rpvr2", "rpvr3", "rpvr4", "rpvr5", "rpvr6",
738 "rpvr7", "rpvr8", "rpvr9", "rpvr10", "rpvr11",
739 "redr", "rpid", "rzpr", "rtlbx", "rtlbsx", "rtlblo", "rtlbhi",
740- "rslr", "rshr"
741+ "slr", "shr"
742 }; 648 };
743 649
744 #define MICROBLAZE_NUM_REGS ARRAY_SIZE (microblaze_register_names) 650 #define MICROBLAZE_NUM_REGS ARRAY_SIZE (microblaze_register_names)
745 651-
652+
746 static unsigned int microblaze_debug_flag = 0; 653 static unsigned int microblaze_debug_flag = 0;
747+int reg_size = 4; 654+int MICROBLAZE_REGISTER_SIZE = 4;
748 655
749 static void ATTRIBUTE_PRINTF (1, 2) 656 static void ATTRIBUTE_PRINTF (1, 2)
750 microblaze_debug (const char *fmt, ...) 657 microblaze_debug (const char *fmt, ...)
751@@ -145,6 +148,7 @@ microblaze_store_arguments (struct regcache *regcache, int nargs, 658@@ -137,6 +140,7 @@ microblaze_fetch_instruction (CORE_ADDR pc)
752 error (_("store_arguments not implemented")); 659 constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
753 return sp; 660
754 } 661 typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
755+#if 0 662+#if 0
756 static int 663 static int
757 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 664 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
758 struct bp_target_info *bp_tgt) 665 struct bp_target_info *bp_tgt)
759@@ -154,7 +158,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 666@@ -169,6 +173,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
760 int val;
761 int bplen;
762 gdb_byte old_contents[BREAKPOINT_MAX];
763- struct cleanup *cleanup;
764+ //struct cleanup *cleanup;
765 667
766 /* Determine appropriate breakpoint contents and size for this address. */
767 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
768@@ -162,7 +166,8 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
769 error (_("Software breakpoints not implemented for this target."));
770
771 /* Make sure we see the memory breakpoints. */
772- cleanup = make_show_memory_breakpoints_cleanup (1);
773+ scoped_restore
774+ cleanup = make_scoped_restore_show_memory_breakpoints (1);
775 val = target_read_memory (addr, old_contents, bplen);
776
777 /* If our breakpoint is no longer at the address, this means that the
778@@ -178,6 +183,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
779 return val; 668 return val;
780 } 669 }
781
782+#endif 670+#endif
671
783 /* Allocate and initialize a frame cache. */ 672 /* Allocate and initialize a frame cache. */
784 673
785 static struct microblaze_frame_cache * 674@@ -556,7 +561,6 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
786@@ -570,17 +576,16 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
787 gdb_byte *valbuf) 675 gdb_byte *valbuf)
788 { 676 {
789 gdb_byte buf[8]; 677 gdb_byte buf[8];
@@ -791,19 +679,7 @@ index 49713ea9b1..0605283c9e 100644
791 /* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */ 679 /* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */
792 switch (TYPE_LENGTH (type)) 680 switch (TYPE_LENGTH (type))
793 { 681 {
794 case 1: /* return last byte in the register. */ 682@@ -633,7 +637,113 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
795 regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
796- memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 1, 1);
797+ memcpy(valbuf, buf + reg_size - 1, 1);
798 return;
799 case 2: /* return last 2 bytes in register. */
800 regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
801- memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 2, 2);
802+ memcpy(valbuf, buf + reg_size - 2, 2);
803 return;
804 case 4: /* for sizes 4 or 8, copy the required length. */
805 case 8:
806@@ -647,7 +652,119 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
807 return (TYPE_LENGTH (type) == 16); 683 return (TYPE_LENGTH (type) == 16);
808 } 684 }
809 685
@@ -915,16 +791,14 @@ index 49713ea9b1..0605283c9e 100644
915+} 791+}
916+#endif 792+#endif
917+ 793+
918+static void
919+microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc)
920+{
921+ regcache_cooked_write_unsigned (regcache, MICROBLAZE_PC_REGNUM, pc);
922+}
923+
924 static int dwarf2_to_reg_map[78] = 794 static int dwarf2_to_reg_map[78] =
925 { 0 /* r0 */, 1 /* r1 */, 2 /* r2 */, 3 /* r3 */, /* 0- 3 */ 795 { 0 /* r0 */, 1 /* r1 */, 2 /* r2 */, 3 /* r3 */, /* 0- 3 */
926 4 /* r4 */, 5 /* r5 */, 6 /* r6 */, 7 /* r7 */, /* 4- 7 */ 796 4 /* r4 */, 5 /* r5 */, 6 /* r6 */, 7 /* r7 */, /* 4- 7 */
927@@ -682,13 +799,14 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg) 797@@ -665,24 +775,27 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
798 return -1;
799 }
800
801+#if 0
928 static void 802 static void
929 microblaze_register_g_packet_guesses (struct gdbarch *gdbarch) 803 microblaze_register_g_packet_guesses (struct gdbarch *gdbarch)
930 { 804 {
@@ -940,46 +814,27 @@ index 49713ea9b1..0605283c9e 100644
940- tdesc_microblaze_with_stack_protect); 814- tdesc_microblaze_with_stack_protect);
941+ tdesc_microblaze64_with_stack_protect); 815+ tdesc_microblaze64_with_stack_protect);
942 } 816 }
817+#endif
943 818
944 void 819 void
945@@ -696,15 +814,15 @@ microblaze_supply_gregset (const struct microblaze_gregset *gregset, 820 microblaze_supply_gregset (const struct regset *regset,
946 struct regcache *regcache, 821 struct regcache *regcache,
947 int regnum, const void *gregs) 822 int regnum, const void *gregs)
948 { 823 {
949- unsigned int *regs = gregs; 824- const unsigned int *regs = (const unsigned int *)gregs;
950+ const gdb_byte *regs = (const gdb_byte *) gregs; 825+ const gdb_byte *regs = (const gdb_byte *) gregs;
951 if (regnum >= 0) 826 if (regnum >= 0)
952- regcache_raw_supply (regcache, regnum, regs + regnum); 827 regcache->raw_supply (regnum, regs + regnum);
953+ regcache->raw_supply (regnum, regs + regnum);
954
955 if (regnum == -1) {
956 int i;
957 828
958 for (i = 0; i < 50; i++) { 829@@ -713,7 +826,6 @@ microblaze_iterate_over_regset_sections (struct gdbarch *gdbarch,
959- regcache_raw_supply (regcache, i, regs + i);
960+ regcache->raw_supply (regnum, regs + i);
961 }
962 }
963 } 830 }
964@@ -755,6 +873,17 @@ microblaze_regset_from_core_section (struct gdbarch *gdbarch,
965 }
966
967 831
968+static void
969+make_regs (struct gdbarch *arch)
970+{
971+ struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
972+ int mach = gdbarch_bfd_arch_info (arch)->mach;
973+
974+ if (mach == bfd_mach_microblaze64)
975+ {
976+ set_gdbarch_ptr_bit (arch, 64);
977+ }
978+}
979 832
833-
980 static struct gdbarch * 834 static struct gdbarch *
981 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 835 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
982@@ -769,8 +898,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 836 {
837@@ -727,8 +839,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
983 if (arches != NULL) 838 if (arches != NULL)
984 return arches->gdbarch; 839 return arches->gdbarch;
985 if (tdesc == NULL) 840 if (tdesc == NULL)
@@ -989,7 +844,7 @@ index 49713ea9b1..0605283c9e 100644
989+ if (info.bfd_arch_info->mach == bfd_mach_microblaze64) 844+ if (info.bfd_arch_info->mach == bfd_mach_microblaze64)
990+ { 845+ {
991+ tdesc = tdesc_microblaze64; 846+ tdesc = tdesc_microblaze64;
992+ reg_size = 8; 847+ MICROBLAZE_REGISTER_SIZE = 8;
993+ } 848+ }
994+ else 849+ else
995+ tdesc = tdesc_microblaze; 850+ tdesc = tdesc_microblaze;
@@ -997,7 +852,7 @@ index 49713ea9b1..0605283c9e 100644
997 /* Check any target description for validity. */ 852 /* Check any target description for validity. */
998 if (tdesc_has_registers (tdesc)) 853 if (tdesc_has_registers (tdesc))
999 { 854 {
1000@@ -778,27 +914,35 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 855@@ -736,27 +855,35 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1001 int valid_p; 856 int valid_p;
1002 int i; 857 int i;
1003 858
@@ -1038,7 +893,7 @@ index 49713ea9b1..0605283c9e 100644
1038 } 893 }
1039 894
1040 if (!valid_p) 895 if (!valid_p)
1041@@ -806,6 +950,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 896@@ -764,6 +891,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1042 tdesc_data_cleanup (tdesc_data); 897 tdesc_data_cleanup (tdesc_data);
1043 return NULL; 898 return NULL;
1044 } 899 }
@@ -1046,7 +901,7 @@ index 49713ea9b1..0605283c9e 100644
1046 } 901 }
1047 902
1048 /* Allocate space for the new architecture. */ 903 /* Allocate space for the new architecture. */
1049@@ -825,7 +970,17 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 904@@ -783,7 +911,17 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1050 /* Register numbers of various important registers. */ 905 /* Register numbers of various important registers. */
1051 set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM); 906 set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM);
1052 set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM); 907 set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM);
@@ -1064,7 +919,7 @@ index 49713ea9b1..0605283c9e 100644
1064 /* Map Dwarf2 registers to GDB registers. */ 919 /* Map Dwarf2 registers to GDB registers. */
1065 set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum); 920 set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum);
1066 921
1067@@ -845,13 +1000,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 922@@ -803,13 +941,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1068 microblaze_breakpoint::kind_from_pc); 923 microblaze_breakpoint::kind_from_pc);
1069 set_gdbarch_sw_breakpoint_from_kind (gdbarch, 924 set_gdbarch_sw_breakpoint_from_kind (gdbarch,
1070 microblaze_breakpoint::bp_from_kind); 925 microblaze_breakpoint::bp_from_kind);
@@ -1082,21 +937,7 @@ index 49713ea9b1..0605283c9e 100644
1082 937
1083 frame_base_set_default (gdbarch, &microblaze_frame_base); 938 frame_base_set_default (gdbarch, &microblaze_frame_base);
1084 939
1085@@ -866,11 +1023,11 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 940@@ -841,6 +981,8 @@ _initialize_microblaze_tdep ()
1086 tdesc_use_registers (gdbarch, tdesc, tdesc_data);
1087 //frame_base_append_sniffer (gdbarch, microblaze_frame_sniffer);
1088
1089- /* If we have register sets, enable the generic core file support. */
1090+ /* If we have register sets, enable the generic core file support.
1091 if (tdep->gregset) {
1092 set_gdbarch_regset_from_core_section (gdbarch,
1093 microblaze_regset_from_core_section);
1094- }
1095+ }*/
1096
1097 return gdbarch;
1098 }
1099@@ -882,6 +1039,8 @@ _initialize_microblaze_tdep (void)
1100 941
1101 initialize_tdesc_microblaze_with_stack_protect (); 942 initialize_tdesc_microblaze_with_stack_protect ();
1102 initialize_tdesc_microblaze (); 943 initialize_tdesc_microblaze ();
@@ -1106,7 +947,7 @@ index 49713ea9b1..0605283c9e 100644
1106 add_setshow_zuinteger_cmd ("microblaze", class_maintenance, 947 add_setshow_zuinteger_cmd ("microblaze", class_maintenance,
1107 &microblaze_debug_flag, _("\ 948 &microblaze_debug_flag, _("\
1108diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 949diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
1109index 3777cbb6a8..55f5dd1962 100644 950index d2112dc07e1..bd03e969b9b 100644
1110--- a/gdb/microblaze-tdep.h 951--- a/gdb/microblaze-tdep.h
1111+++ b/gdb/microblaze-tdep.h 952+++ b/gdb/microblaze-tdep.h
1112@@ -27,7 +27,7 @@ struct microblaze_gregset 953@@ -27,7 +27,7 @@ struct microblaze_gregset
@@ -1130,17 +971,18 @@ index 3777cbb6a8..55f5dd1962 100644
1130 }; 971 };
1131 972
1132 struct microblaze_frame_cache 973 struct microblaze_frame_cache
1133@@ -128,7 +128,7 @@ struct microblaze_frame_cache 974@@ -128,7 +128,8 @@ struct microblaze_frame_cache
1134 struct trad_frame_saved_reg *saved_regs; 975 struct trad_frame_saved_reg *saved_regs;
1135 }; 976 };
1136 /* All registers are 32 bits. */ 977 /* All registers are 32 bits. */
1137-#define MICROBLAZE_REGISTER_SIZE 4 978-#define MICROBLAZE_REGISTER_SIZE 4
1138+//#define MICROBLAZE_REGISTER_SIZE 8 979+extern int microblaze_reg_size;
980+#define MICROBLAZE_REGISTER_SIZE microblaze_reg_size
1139 981
1140 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used. 982 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
1141 Only used for native debugging. */ 983 Only used for native debugging. */
1142diff --git a/gdb/regformats/microblaze-with-stack-protect.dat b/gdb/regformats/microblaze-with-stack-protect.dat 984diff --git a/gdb/regformats/microblaze-with-stack-protect.dat b/gdb/regformats/microblaze-with-stack-protect.dat
1143index 8040a7b3fd..450e321d49 100644 985index 8040a7b3fd0..450e321d49e 100644
1144--- a/gdb/regformats/microblaze-with-stack-protect.dat 986--- a/gdb/regformats/microblaze-with-stack-protect.dat
1145+++ b/gdb/regformats/microblaze-with-stack-protect.dat 987+++ b/gdb/regformats/microblaze-with-stack-protect.dat
1146@@ -60,5 +60,5 @@ expedite:r1,rpc 988@@ -60,5 +60,5 @@ expedite:r1,rpc
@@ -1151,18 +993,6 @@ index 8040a7b3fd..450e321d49 100644
1151-32:rshr 993-32:rshr
1152+32:slr 994+32:slr
1153+32:shr 995+32:shr
1154diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
1155index bd9d91cd57..12d4456bc2 100644
1156--- a/opcodes/microblaze-opc.h
1157+++ b/opcodes/microblaze-opc.h
1158@@ -134,7 +134,6 @@
1159 #define ORLI_MASK 0xA0000000
1160 #define XORLI_MASK 0xA8000000
1161
1162-
1163 /* New Mask for msrset, msrclr insns. */
1164 #define OPCODE_MASK_H23N 0xFC1F8000 /* High 6 and bits 11 - 16. */
1165 /* Mask for mbar insn. */
1166-- 996--
11672.17.1 9972.17.1
1168 998