summaryrefslogtreecommitdiff
path: root/meta-xilinx/meta-microblaze/recipes-devtools/gdb/gdb/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx/meta-microblaze/recipes-devtools/gdb/gdb/0040-Patch-microblaze-Adding-64-bit-MB-support.patch')
-rw-r--r--meta-xilinx/meta-microblaze/recipes-devtools/gdb/gdb/0040-Patch-microblaze-Adding-64-bit-MB-support.patch949
1 files changed, 949 insertions, 0 deletions
diff --git a/meta-xilinx/meta-microblaze/recipes-devtools/gdb/gdb/0040-Patch-microblaze-Adding-64-bit-MB-support.patch b/meta-xilinx/meta-microblaze/recipes-devtools/gdb/gdb/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
new file mode 100644
index 000000000..7ac8f07f9
--- /dev/null
+++ b/meta-xilinx/meta-microblaze/recipes-devtools/gdb/gdb/0040-Patch-microblaze-Adding-64-bit-MB-support.patch
@@ -0,0 +1,949 @@
+From 4e5a4e94cb1dd61646230100f883bd27a39cd896 Mon Sep 17 00:00:00 2001
+From: Nagaraju Mekala <nmekala@xilix.com>
+Date: Thu, 31 Jan 2019 14:36:00 +0530
+Subject: [PATCH 40/40] [Patch, microblaze]: Adding 64 bit MB support
+
+Added new architecture to Microblaze 64-bit support to GDB
+
+Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
+---
+ bfd/archures.c | 2 +
+ bfd/bfd-in2.h | 2 +
+ bfd/cpu-microblaze.c | 16 +-
+ bfd/elf32-microblaze.c | 9 +
+ gdb/features/Makefile | 3 +
+ gdb/features/microblaze-core.xml | 6 +-
+ gdb/features/microblaze-with-stack-protect.c | 4 +-
+ gdb/features/microblaze.c | 6 +-
+ gdb/features/microblaze64-core.xml | 69 +++++++
+ gdb/features/microblaze64-stack-protect.xml | 12 ++
+ .../microblaze64-with-stack-protect.c | 79 ++++++++
+ .../microblaze64-with-stack-protect.xml | 12 ++
+ gdb/features/microblaze64.c | 77 ++++++++
+ gdb/features/microblaze64.xml | 11 ++
+ gdb/microblaze-linux-tdep.c | 29 ++-
+ gdb/microblaze-tdep.c | 176 ++++++++++++++++--
+ gdb/microblaze-tdep.h | 9 +-
+ .../microblaze-with-stack-protect.dat | 4 +-
+ 20 files changed, 504 insertions(+), 40 deletions(-)
+ create mode 100644 gdb/features/microblaze64-core.xml
+ create mode 100644 gdb/features/microblaze64-stack-protect.xml
+ create mode 100644 gdb/features/microblaze64-with-stack-protect.c
+ create mode 100644 gdb/features/microblaze64-with-stack-protect.xml
+ create mode 100644 gdb/features/microblaze64.c
+ create mode 100644 gdb/features/microblaze64.xml
+
+diff --git a/bfd/archures.c b/bfd/archures.c
+index 7866c6095b5..abc1541afe6 100644
+--- a/bfd/archures.c
++++ b/bfd/archures.c
+@@ -513,6 +513,8 @@ DESCRIPTION
+ . bfd_arch_lm32, {* Lattice Mico32. *}
+ .#define bfd_mach_lm32 1
+ . bfd_arch_microblaze,{* Xilinx MicroBlaze. *}
++.#define bfd_mach_microblaze 1
++.#define bfd_mach_microblaze64 2
+ . bfd_arch_tilepro, {* Tilera TILEPro. *}
+ . bfd_arch_tilegx, {* Tilera TILE-Gx. *}
+ .#define bfd_mach_tilepro 1
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index 91761bf6964..cc34ce0d8c3 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -1896,6 +1896,8 @@ enum bfd_architecture
+ bfd_arch_lm32, /* Lattice Mico32. */
+ #define bfd_mach_lm32 1
+ bfd_arch_microblaze,/* Xilinx MicroBlaze. */
++#define bfd_mach_microblaze 1
++#define bfd_mach_microblaze64 2
+ bfd_arch_tilepro, /* Tilera TILEPro. */
+ bfd_arch_tilegx, /* Tilera TILE-Gx. */
+ #define bfd_mach_tilepro 1
+diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c
+index 4b48b310c6a..a32c4a33d75 100644
+--- a/bfd/cpu-microblaze.c
++++ b/bfd/cpu-microblaze.c
+@@ -30,8 +30,8 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
+ 64, /* 32 bits in a word. */
+ 64, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+- bfd_arch_microblaze, /* Architecture. */
+- 0, /* Machine number - 0 for now. */
++ bfd_arch_microblaze, /* Architecture. */
++ bfd_mach_microblaze64, /* 64 bit Machine */
+ "microblaze", /* Architecture name. */
+ "MicroBlaze", /* Printable name. */
+ 3, /* Section align power. */
+@@ -43,11 +43,11 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
+ 0 /* Maximum offset of a reloc from the start of an insn. */
+ },
+ {
+- 32, /* Bits in a word. */
+- 32, /* Bits in an address. */
+- 8, /* Bits in a byte. */
++ 32, /* 32 bits in a word. */
++ 32, /* 32 bits in an address. */
++ 8, /* 8 bits in a byte. */
+ bfd_arch_microblaze, /* Architecture number. */
+- 0, /* Machine number - 0 for now. */
++ bfd_mach_microblaze, /* 32 bit Machine */
+ "microblaze", /* Architecture name. */
+ "MicroBlaze", /* Printable name. */
+ 3, /* Section align power. */
+@@ -64,7 +64,7 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_microblaze, /* Architecture. */
+- 0, /* Machine number - 0 for now. */
++ bfd_mach_microblaze, /* 32 bit Machine */
+ "microblaze", /* Architecture name. */
+ "MicroBlaze", /* Printable name. */
+ 3, /* Section align power. */
+@@ -80,7 +80,7 @@ const bfd_arch_info_type bfd_microblaze_arch[] =
+ 64, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_microblaze, /* Architecture. */
+- 0, /* Machine number - 0 for now. */
++ bfd_mach_microblaze64, /* 64 bit Machine */
+ "microblaze", /* Architecture name. */
+ "MicroBlaze", /* Printable name. */
+ 3, /* Section align power. */
+diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
+index cb7a98d307e..e4a70150190 100644
+--- a/bfd/elf32-microblaze.c
++++ b/bfd/elf32-microblaze.c
+@@ -3684,6 +3684,14 @@ microblaze_elf_finish_dynamic_sections (bfd *output_bfd,
+ return TRUE;
+ }
+
++
++static bfd_boolean
++elf_microblaze_object_p (bfd *abfd)
++{
++ /* Set the right machine number for an s390 elf32 file. */
++ return bfd_default_set_arch_mach (abfd, bfd_arch_microblaze, bfd_mach_microblaze);
++}
++
+ /* Hook called by the linker routine which adds symbols from an object
+ file. We use it to put .comm items in .sbss, and not .bss. */
+
+@@ -3756,5 +3764,6 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
+
+ #define elf_backend_grok_prstatus microblaze_elf_grok_prstatus
+ #define elf_backend_grok_psinfo microblaze_elf_grok_psinfo
++#define elf_backend_object_p elf_microblaze_object_p
+
+ #include "elf32-target.h"
+diff --git a/gdb/features/Makefile b/gdb/features/Makefile
+index 9a98b0542c4..438e0c5a3fe 100644
+--- a/gdb/features/Makefile
++++ b/gdb/features/Makefile
+@@ -48,6 +48,7 @@ WHICH = arm/arm-with-iwmmxt arm/arm-with-vfpv2 arm/arm-with-vfpv3 \
+ arm/arm-with-neon \
+ mips-linux mips-dsp-linux \
+ microblaze-with-stack-protect \
++ microblaze64-with-stack-protect \
+ mips64-linux mips64-dsp-linux \
+ nios2-linux \
+ rs6000/powerpc-32 \
+@@ -111,7 +112,9 @@ XMLTOC = \
+ arc-v2.xml \
+ arc-arcompact.xml \
+ microblaze-with-stack-protect.xml \
++ microblaze64-with-stack-protect.xml \
+ microblaze.xml \
++ microblaze64.xml \
+ mips-dsp-linux.xml \
+ mips-linux.xml \
+ mips64-dsp-linux.xml \
+diff --git a/gdb/features/microblaze-core.xml b/gdb/features/microblaze-core.xml
+index f272650a41b..d1f2282fd1e 100644
+--- a/gdb/features/microblaze-core.xml
++++ b/gdb/features/microblaze-core.xml
+@@ -8,7 +8,7 @@
+ <!DOCTYPE feature SYSTEM "gdb-target.dtd">
+ <feature name="org.gnu.gdb.microblaze.core">
+ <reg name="r0" bitsize="32" regnum="0"/>
+- <reg name="r1" bitsize="32" type="data_ptr"/>
++ <reg name="r1" bitsize="32"/>
+ <reg name="r2" bitsize="32"/>
+ <reg name="r3" bitsize="32"/>
+ <reg name="r4" bitsize="32"/>
+@@ -39,7 +39,7 @@
+ <reg name="r29" bitsize="32"/>
+ <reg name="r30" bitsize="32"/>
+ <reg name="r31" bitsize="32"/>
+- <reg name="rpc" bitsize="32" type="code_ptr"/>
++ <reg name="rpc" bitsize="32"/>
+ <reg name="rmsr" bitsize="32"/>
+ <reg name="rear" bitsize="32"/>
+ <reg name="resr" bitsize="32"/>
+@@ -64,4 +64,6 @@
+ <reg name="rtlbsx" bitsize="32"/>
+ <reg name="rtlblo" bitsize="32"/>
+ <reg name="rtlbhi" bitsize="32"/>
++ <reg name="rslr" bitsize="32"/>
++ <reg name="rshr" bitsize="32"/>
+ </feature>
+diff --git a/gdb/features/microblaze-with-stack-protect.c b/gdb/features/microblaze-with-stack-protect.c
+index b39aa198874..ab162fd2588 100644
+--- a/gdb/features/microblaze-with-stack-protect.c
++++ b/gdb/features/microblaze-with-stack-protect.c
+@@ -14,7 +14,7 @@ initialize_tdesc_microblaze_with_stack_protect (void)
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
+- tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "data_ptr");
++ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
+@@ -45,7 +45,7 @@ initialize_tdesc_microblaze_with_stack_protect (void)
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "int");
+- tdesc_create_reg (feature, "rpc", 32, 1, NULL, 32, "code_ptr");
++ tdesc_create_reg (feature, "rpc", 32, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "rear", 34, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int");
+diff --git a/gdb/features/microblaze.c b/gdb/features/microblaze.c
+index 6c86fc07700..7919ac96e62 100644
+--- a/gdb/features/microblaze.c
++++ b/gdb/features/microblaze.c
+@@ -14,7 +14,7 @@ initialize_tdesc_microblaze (void)
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
+- tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "data_ptr");
++ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
+@@ -45,7 +45,7 @@ initialize_tdesc_microblaze (void)
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "int");
+- tdesc_create_reg (feature, "rpc", 32, 1, NULL, 32, "code_ptr");
++ tdesc_create_reg (feature, "rpc", 32, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "rear", 34, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int");
+@@ -70,6 +70,8 @@ initialize_tdesc_microblaze (void)
+ tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rslr", 57, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rshr", 58, 1, NULL, 64, "uint64");
+
+ tdesc_microblaze = result;
+ }
+diff --git a/gdb/features/microblaze64-core.xml b/gdb/features/microblaze64-core.xml
+new file mode 100644
+index 00000000000..b9adadfade6
+--- /dev/null
++++ b/gdb/features/microblaze64-core.xml
+@@ -0,0 +1,69 @@
++<?xml version="1.0"?>
++<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
++
++ Copying and distribution of this file, with or without modification,
++ are permitted in any medium without royalty provided the copyright
++ notice and this notice are preserved. -->
++
++<!DOCTYPE feature SYSTEM "gdb-target.dtd">
++<feature name="org.gnu.gdb.microblaze64.core">
++ <reg name="r0" bitsize="64" regnum="0"/>
++ <reg name="r1" bitsize="64"/>
++ <reg name="r2" bitsize="64"/>
++ <reg name="r3" bitsize="64"/>
++ <reg name="r4" bitsize="64"/>
++ <reg name="r5" bitsize="64"/>
++ <reg name="r6" bitsize="64"/>
++ <reg name="r7" bitsize="64"/>
++ <reg name="r8" bitsize="64"/>
++ <reg name="r9" bitsize="64"/>
++ <reg name="r10" bitsize="64"/>
++ <reg name="r11" bitsize="64"/>
++ <reg name="r12" bitsize="64"/>
++ <reg name="r13" bitsize="64"/>
++ <reg name="r14" bitsize="64"/>
++ <reg name="r15" bitsize="64"/>
++ <reg name="r16" bitsize="64"/>
++ <reg name="r17" bitsize="64"/>
++ <reg name="r18" bitsize="64"/>
++ <reg name="r19" bitsize="64"/>
++ <reg name="r20" bitsize="64"/>
++ <reg name="r21" bitsize="64"/>
++ <reg name="r22" bitsize="64"/>
++ <reg name="r23" bitsize="64"/>
++ <reg name="r24" bitsize="64"/>
++ <reg name="r25" bitsize="64"/>
++ <reg name="r26" bitsize="64"/>
++ <reg name="r27" bitsize="64"/>
++ <reg name="r28" bitsize="64"/>
++ <reg name="r29" bitsize="64"/>
++ <reg name="r30" bitsize="64"/>
++ <reg name="r31" bitsize="64"/>
++ <reg name="rpc" bitsize="64"/>
++ <reg name="rmsr" bitsize="32"/>
++ <reg name="rear" bitsize="64"/>
++ <reg name="resr" bitsize="32"/>
++ <reg name="rfsr" bitsize="32"/>
++ <reg name="rbtr" bitsize="64"/>
++ <reg name="rpvr0" bitsize="32"/>
++ <reg name="rpvr1" bitsize="32"/>
++ <reg name="rpvr2" bitsize="32"/>
++ <reg name="rpvr3" bitsize="32"/>
++ <reg name="rpvr4" bitsize="32"/>
++ <reg name="rpvr5" bitsize="32"/>
++ <reg name="rpvr6" bitsize="32"/>
++ <reg name="rpvr7" bitsize="32"/>
++ <reg name="rpvr8" bitsize="64"/>
++ <reg name="rpvr9" bitsize="64"/>
++ <reg name="rpvr10" bitsize="32"/>
++ <reg name="rpvr11" bitsize="32"/>
++ <reg name="redr" bitsize="32"/>
++ <reg name="rpid" bitsize="32"/>
++ <reg name="rzpr" bitsize="32"/>
++ <reg name="rtlbx" bitsize="32"/>
++ <reg name="rtlbsx" bitsize="32"/>
++ <reg name="rtlblo" bitsize="32"/>
++ <reg name="rtlbhi" bitsize="32"/>
++ <reg name="rslr" bitsize="64"/>
++ <reg name="rshr" bitsize="64"/>
++</feature>
+diff --git a/gdb/features/microblaze64-stack-protect.xml b/gdb/features/microblaze64-stack-protect.xml
+new file mode 100644
+index 00000000000..9d7ea8b9fd7
+--- /dev/null
++++ b/gdb/features/microblaze64-stack-protect.xml
+@@ -0,0 +1,12 @@
++<?xml version="1.0"?>
++<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
++
++ Copying and distribution of this file, with or without modification,
++ are permitted in any medium without royalty provided the copyright
++ notice and this notice are preserved. -->
++
++<!DOCTYPE feature SYSTEM "gdb-target.dtd">
++<feature name="org.gnu.gdb.microblaze64.stack-protect">
++ <reg name="rslr" bitsize="64"/>
++ <reg name="rshr" bitsize="64"/>
++</feature>
+diff --git a/gdb/features/microblaze64-with-stack-protect.c b/gdb/features/microblaze64-with-stack-protect.c
+new file mode 100644
+index 00000000000..249cb534daa
+--- /dev/null
++++ b/gdb/features/microblaze64-with-stack-protect.c
+@@ -0,0 +1,79 @@
++/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
++ Original: microblaze-with-stack-protect.xml */
++
++#include "defs.h"
++#include "osabi.h"
++#include "target-descriptions.h"
++
++struct target_desc *tdesc_microblaze64_with_stack_protect;
++static void
++initialize_tdesc_microblaze64_with_stack_protect (void)
++{
++ struct target_desc *result = allocate_target_description ();
++ struct tdesc_feature *feature;
++
++ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze64.core");
++ tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpc", 32, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rear", 34, 1, NULL, 64, "int");
++ tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rfsr", 36, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rbtr", 37, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpvr0", 38, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr1", 39, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr2", 40, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr3", 41, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr4", 42, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr5", 43, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr6", 44, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr7", 45, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr8", 46, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpvr9", 47, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpvr10", 48, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr11", 49, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "redr", 50, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpid", 51, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rzpr", 52, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlbx", 53, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
++
++ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze64.stack-protect");
++ tdesc_create_reg (feature, "rslr", 57, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rshr", 58, 1, NULL, 64, "uint64");
++
++ tdesc_microblaze64_with_stack_protect = result;
++}
+diff --git a/gdb/features/microblaze64-with-stack-protect.xml b/gdb/features/microblaze64-with-stack-protect.xml
+new file mode 100644
+index 00000000000..0e9f01611f3
+--- /dev/null
++++ b/gdb/features/microblaze64-with-stack-protect.xml
+@@ -0,0 +1,12 @@
++<?xml version="1.0"?>
++<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
++
++ Copying and distribution of this file, with or without modification,
++ are permitted in any medium without royalty provided the copyright
++ notice and this notice are preserved. -->
++
++<!DOCTYPE target SYSTEM "gdb-target.dtd">
++<target>
++ <xi:include href="microblaze64-core.xml"/>
++ <xi:include href="microblaze64-stack-protect.xml"/>
++</target>
+diff --git a/gdb/features/microblaze64.c b/gdb/features/microblaze64.c
+new file mode 100644
+index 00000000000..5d3e2c8cd91
+--- /dev/null
++++ b/gdb/features/microblaze64.c
+@@ -0,0 +1,77 @@
++/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
++ Original: microblaze.xml */
++
++#include "defs.h"
++#include "osabi.h"
++#include "target-descriptions.h"
++
++struct target_desc *tdesc_microblaze64;
++static void
++initialize_tdesc_microblaze64 (void)
++{
++ struct target_desc *result = allocate_target_description ();
++ struct tdesc_feature *feature;
++
++ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze64.core");
++ tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpc", 32, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rear", 34, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rfsr", 36, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rbtr", 37, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpvr0", 38, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr1", 39, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr2", 40, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr3", 41, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr4", 42, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr5", 43, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr6", 44, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr7", 45, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr8", 46, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpvr9", 47, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rpvr10", 48, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpvr11", 49, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "redr", 50, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rpid", 51, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rzpr", 52, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlbx", 53, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int");
++ tdesc_create_reg (feature, "rslr", 57, 1, NULL, 64, "uint64");
++ tdesc_create_reg (feature, "rshr", 58, 1, NULL, 64, "uint64");
++
++ tdesc_microblaze64 = result;
++}
+diff --git a/gdb/features/microblaze64.xml b/gdb/features/microblaze64.xml
+new file mode 100644
+index 00000000000..515d18e65cf
+--- /dev/null
++++ b/gdb/features/microblaze64.xml
+@@ -0,0 +1,11 @@
++<?xml version="1.0"?>
++<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc.
++
++ Copying and distribution of this file, with or without modification,
++ are permitted in any medium without royalty provided the copyright
++ notice and this notice are preserved. -->
++
++<!DOCTYPE target SYSTEM "gdb-target.dtd">
++<target>
++ <xi:include href="microblaze64-core.xml"/>
++</target>
+diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
+index 0afb6efeba3..48459a76991 100644
+--- a/gdb/microblaze-linux-tdep.c
++++ b/gdb/microblaze-linux-tdep.c
+@@ -159,9 +159,30 @@ microblaze_linux_init_abi (struct gdbarch_info info,
+
+ /* BFD target for core files. */
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+- set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze");
++ {
++ if (info.bfd_arch_info->mach == bfd_mach_microblaze64) {
++ set_gdbarch_gcore_bfd_target (gdbarch, "elf64-microblaze");
++ MICROBLAZE_REGISTER_SIZE=8;
++ }
++ else
++ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze");
++ }
+ else
+- set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel");
++ {
++ if (info.bfd_arch_info->mach == bfd_mach_microblaze64) {
++ set_gdbarch_gcore_bfd_target (gdbarch, "elf64-microblazeel");
++ MICROBLAZE_REGISTER_SIZE=8;
++ }
++ else
++ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel");
++ }
++
++ switch (info.bfd_arch_info->mach)
++ {
++ case bfd_mach_microblaze64:
++ set_gdbarch_ptr_bit (gdbarch, 64);
++ break;
++ }
+
+
+ /* Shared library handling. */
+@@ -176,6 +197,8 @@ microblaze_linux_init_abi (struct gdbarch_info info,
+ void
+ _initialize_microblaze_linux_tdep (void)
+ {
+- gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX,
++ gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze, GDB_OSABI_LINUX,
++ microblaze_linux_init_abi);
++ gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze64, GDB_OSABI_LINUX,
+ microblaze_linux_init_abi);
+ }
+diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
+index 98944f38d2a..5c0d6dd48ae 100644
+--- a/gdb/microblaze-tdep.c
++++ b/gdb/microblaze-tdep.c
+@@ -40,7 +40,9 @@
+ #include "remote.h"
+
+ #include "features/microblaze-with-stack-protect.c"
++#include "features/microblaze64-with-stack-protect.c"
+ #include "features/microblaze.c"
++#include "features/microblaze64.c"
+
+ /* Instruction macros used for analyzing the prologue. */
+ /* This set of instruction macros need to be changed whenever the
+@@ -79,8 +81,9 @@ static const char *microblaze_register_names[] =
+ };
+
+ #define MICROBLAZE_NUM_REGS ARRAY_SIZE (microblaze_register_names)
+-
++
+ static unsigned int microblaze_debug_flag = 0;
++int MICROBLAZE_REGISTER_SIZE = 4;
+
+ static void ATTRIBUTE_PRINTF (1, 2)
+ microblaze_debug (const char *fmt, ...)
+@@ -137,6 +140,7 @@ microblaze_fetch_instruction (CORE_ADDR pc)
+ constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
+
+ typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
++#if 0
+ static int
+ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
+ struct bp_target_info *bp_tgt)
+@@ -169,6 +173,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
+
+ return val;
+ }
++#endif
+
+ /* Allocate and initialize a frame cache. */
+
+@@ -556,7 +561,6 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
+ gdb_byte *valbuf)
+ {
+ gdb_byte buf[8];
+-
+ /* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */
+ switch (TYPE_LENGTH (type))
+ {
+@@ -633,7 +637,113 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
+ return (TYPE_LENGTH (type) == 16);
+ }
+
+-
++#if 0
++static std::vector<CORE_ADDR>
++microblaze_software_single_step (struct regcache *regcache)
++{
++// struct gdbarch *arch = get_frame_arch(frame);
++ struct gdbarch *arch = get_regcache_arch (regcache);
++ struct address_space *aspace = get_regcache_aspace (regcache);
++// struct address_space *aspace = get_frame_address_space (frame);
++ struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
++ static char le_breakp[] = MICROBLAZE_BREAKPOINT_LE;
++ static char be_breakp[] = MICROBLAZE_BREAKPOINT;
++ enum bfd_endian byte_order = gdbarch_byte_order (arch);
++ char *breakp = byte_order == BFD_ENDIAN_BIG ? be_breakp : le_breakp;
++ std::vector<CORE_ADDR> ret = 0;
++
++ /* Save the address and the values of the next_pc and the target */
++ static struct sstep_breaks
++ {
++ CORE_ADDR address;
++ bfd_boolean valid;
++ /* Shadow contents. */
++ char data[INST_WORD_SIZE];
++ } stepbreaks[2];
++ int ii;
++
++ if (1)
++ {
++ CORE_ADDR pc;
++ std::vector<CORE_ADDR> *next_pcs = NULL;
++ long insn;
++ enum microblaze_instr minstr;
++ bfd_boolean isunsignednum;
++ enum microblaze_instr_type insn_type;
++ short delay_slots;
++ int imm;
++ bfd_boolean immfound = FALSE;
++
++ /* Set a breakpoint at the next instruction */
++ /* If the current instruction is an imm, set it at the inst after */
++ /* If the instruction has a delay slot, skip the delay slot */
++ pc = regcache_read_pc (regcache);
++ insn = microblaze_fetch_instruction (pc);
++ minstr = get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots);
++ if (insn_type == immediate_inst)
++ {
++ int rd, ra, rb;
++ immfound = TRUE;
++ minstr = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm);
++ pc = pc + INST_WORD_SIZE;
++ insn = microblaze_fetch_instruction (pc);
++ minstr = get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots);
++ }
++ stepbreaks[0].address = pc + (delay_slots * INST_WORD_SIZE) + INST_WORD_SIZE;
++ if (insn_type != return_inst) {
++ stepbreaks[0].valid = TRUE;
++ } else {
++ stepbreaks[0].valid = FALSE;
++ }
++
++ microblaze_debug ("single-step insn_type=%x insn=%x\n", insn_type, insn);
++ /* Now check for branch or return instructions */
++ if (insn_type == branch_inst || insn_type == return_inst) {
++ int limm;
++ int lrd, lra, lrb;
++ int ra, rb;
++ bfd_boolean targetvalid;
++ bfd_boolean unconditionalbranch;
++ microblaze_decode_insn(insn, &lrd, &lra, &lrb, &limm);
++ if (lra >= 0 && lra < MICROBLAZE_NUM_REGS)
++ ra = regcache_raw_get_unsigned(regcache, lra);
++ else
++ ra = 0;
++ if (lrb >= 0 && lrb < MICROBLAZE_NUM_REGS)
++ rb = regcache_raw_get_unsigned(regcache, lrb);
++ else
++ rb = 0;
++ stepbreaks[1].address = microblaze_get_target_address (insn, immfound, imm, pc, ra, rb, &targetvalid, &unconditionalbranch);
++ microblaze_debug ("single-step uncondbr=%d targetvalid=%d target=%x\n", unconditionalbranch, targetvalid, stepbreaks[1].address);
++ if (unconditionalbranch)
++ stepbreaks[0].valid = FALSE; /* This is a unconditional branch: will not come to the next address */
++ if (targetvalid && (stepbreaks[0].valid == FALSE ||
++ (stepbreaks[0].address != stepbreaks[1].address))
++ && (stepbreaks[1].address != pc)) {
++ stepbreaks[1].valid = TRUE;
++ } else {
++ stepbreaks[1].valid = FALSE;
++ }
++ } else {
++ stepbreaks[1].valid = FALSE;
++ }
++
++ /* Insert the breakpoints */
++ for (ii = 0; ii < 2; ++ii)
++ {
++
++ /* ignore invalid breakpoint. */
++ if (stepbreaks[ii].valid) {
++ VEC_safe_push (CORE_ADDR, next_pcs, stepbreaks[ii].address);;
++// insert_single_step_breakpoint (arch, aspace, stepbreaks[ii].address);
++ ret = next_pcs;
++ }
++ }
++ }
++ return ret;
++}
++#endif
++
+ static int dwarf2_to_reg_map[78] =
+ { 0 /* r0 */, 1 /* r1 */, 2 /* r2 */, 3 /* r3 */, /* 0- 3 */
+ 4 /* r4 */, 5 /* r5 */, 6 /* r6 */, 7 /* r7 */, /* 4- 7 */
+@@ -665,24 +775,27 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
+ return -1;
+ }
+
++#if 0
+ static void
+ microblaze_register_g_packet_guesses (struct gdbarch *gdbarch)
+ {
++
+ register_remote_g_packet_guess (gdbarch,
+- 4 * MICROBLAZE_NUM_CORE_REGS,
+- tdesc_microblaze);
++ 4 * MICROBLAZE_NUM_REGS,
++ tdesc_microblaze64);
+
+ register_remote_g_packet_guess (gdbarch,
+ 4 * MICROBLAZE_NUM_REGS,
+- tdesc_microblaze_with_stack_protect);
++ tdesc_microblaze64_with_stack_protect);
+ }
++#endif
+
+ void
+ microblaze_supply_gregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *gregs)
+ {
+- const unsigned int *regs = (const unsigned int *)gregs;
++ const gdb_byte *regs = (const gdb_byte *) gregs;
+ if (regnum >= 0)
+ regcache->raw_supply (regnum, regs + regnum);
+
+@@ -713,7 +826,6 @@ microblaze_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ }
+
+
+-
+ static struct gdbarch *
+ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ {
+@@ -727,8 +839,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ if (arches != NULL)
+ return arches->gdbarch;
+ if (tdesc == NULL)
+- tdesc = tdesc_microblaze;
+-
++ {
++ if (info.bfd_arch_info->mach == bfd_mach_microblaze64)
++ {
++ tdesc = tdesc_microblaze64;
++ MICROBLAZE_REGISTER_SIZE = 8;
++ }
++ else
++ tdesc = tdesc_microblaze;
++ }
+ /* Check any target description for validity. */
+ if (tdesc_has_registers (tdesc))
+ {
+@@ -736,27 +855,35 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ int valid_p;
+ int i;
+
+- feature = tdesc_find_feature (tdesc,
++ if (info.bfd_arch_info->mach == bfd_mach_microblaze64)
++ feature = tdesc_find_feature (tdesc,
++ "org.gnu.gdb.microblaze64.core");
++ else
++ feature = tdesc_find_feature (tdesc,
+ "org.gnu.gdb.microblaze.core");
+ if (feature == NULL)
+ return NULL;
+ tdesc_data = tdesc_data_alloc ();
+
+ valid_p = 1;
+- for (i = 0; i < MICROBLAZE_NUM_CORE_REGS; i++)
++ for (i = 0; i < MICROBLAZE_NUM_REGS; i++)
+ valid_p &= tdesc_numbered_register (feature, tdesc_data, i,
+ microblaze_register_names[i]);
+- feature = tdesc_find_feature (tdesc,
++ if (info.bfd_arch_info->mach == bfd_mach_microblaze64)
++ feature = tdesc_find_feature (tdesc,
++ "org.gnu.gdb.microblaze64.stack-protect");
++ else
++ feature = tdesc_find_feature (tdesc,
+ "org.gnu.gdb.microblaze.stack-protect");
+ if (feature != NULL)
+ {
+ valid_p = 1;
+ valid_p &= tdesc_numbered_register (feature, tdesc_data,
+ MICROBLAZE_SLR_REGNUM,
+- "rslr");
++ "slr");
+ valid_p &= tdesc_numbered_register (feature, tdesc_data,
+ MICROBLAZE_SHR_REGNUM,
+- "rshr");
++ "shr");
+ }
+
+ if (!valid_p)
+@@ -764,6 +891,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ tdesc_data_cleanup (tdesc_data);
+ return NULL;
+ }
++
+ }
+
+ /* Allocate space for the new architecture. */
+@@ -783,7 +911,17 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ /* Register numbers of various important registers. */
+ set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM);
++
++ /* Register set.
++ make_regs (gdbarch); */
++ switch (info.bfd_arch_info->mach)
++ {
++ case bfd_mach_microblaze64:
++ set_gdbarch_ptr_bit (gdbarch, 64);
++ break;
++ }
+
++
+ /* Map Dwarf2 registers to GDB registers. */
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum);
+
+@@ -803,13 +941,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ microblaze_breakpoint::kind_from_pc);
+ set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+ microblaze_breakpoint::bp_from_kind);
+- set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint);
++// set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint);
++
++// set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step);
+
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+
+ set_gdbarch_unwind_pc (gdbarch, microblaze_unwind_pc);
+
+- microblaze_register_g_packet_guesses (gdbarch);
++ //microblaze_register_g_packet_guesses (gdbarch);
+
+ frame_base_set_default (gdbarch, &microblaze_frame_base);
+
+@@ -840,6 +980,8 @@ _initialize_microblaze_tdep (void)
+
+ initialize_tdesc_microblaze_with_stack_protect ();
+ initialize_tdesc_microblaze ();
++ initialize_tdesc_microblaze64_with_stack_protect ();
++ initialize_tdesc_microblaze64 ();
+ /* Debug this files internals. */
+ add_setshow_zuinteger_cmd ("microblaze", class_maintenance,
+ &microblaze_debug_flag, _("\
+diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
+index d2112dc07e1..bd03e969b9b 100644
+--- a/gdb/microblaze-tdep.h
++++ b/gdb/microblaze-tdep.h
+@@ -27,7 +27,7 @@ struct microblaze_gregset
+ microblaze_gregset() {}
+ unsigned int gregs[32];
+ unsigned int fpregs[32];
+- unsigned int pregs[16];
++ unsigned int pregs[18];
+ };
+
+ struct gdbarch_tdep
+@@ -101,9 +101,9 @@ enum microblaze_regnum
+ MICROBLAZE_RTLBSX_REGNUM,
+ MICROBLAZE_RTLBLO_REGNUM,
+ MICROBLAZE_RTLBHI_REGNUM,
+- MICROBLAZE_SLR_REGNUM, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_SLR_REGNUM,
++ MICROBLAZE_SLR_REGNUM,
+ MICROBLAZE_SHR_REGNUM,
+- MICROBLAZE_NUM_REGS
++ MICROBLAZE_NUM_REGS, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_NUM_REGS
+ };
+
+ struct microblaze_frame_cache
+@@ -128,7 +128,8 @@ struct microblaze_frame_cache
+ struct trad_frame_saved_reg *saved_regs;
+ };
+ /* All registers are 32 bits. */
+-#define MICROBLAZE_REGISTER_SIZE 4
++extern int microblaze_reg_size;
++#define MICROBLAZE_REGISTER_SIZE microblaze_reg_size
+
+ /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
+ Only used for native debugging. */
+diff --git a/gdb/regformats/microblaze-with-stack-protect.dat b/gdb/regformats/microblaze-with-stack-protect.dat
+index 8040a7b3fd0..450e321d49e 100644
+--- a/gdb/regformats/microblaze-with-stack-protect.dat
++++ b/gdb/regformats/microblaze-with-stack-protect.dat
+@@ -60,5 +60,5 @@ expedite:r1,rpc
+ 32:rtlbsx
+ 32:rtlblo
+ 32:rtlbhi
+-32:rslr
+-32:rshr
++32:slr
++32:shr
+--
+2.17.1
+