summaryrefslogtreecommitdiffstats
path: root/cpukit/libdebugger/rtems-debugger-aarch64.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libdebugger/rtems-debugger-aarch64.c')
-rw-r--r--cpukit/libdebugger/rtems-debugger-aarch64.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/cpukit/libdebugger/rtems-debugger-aarch64.c b/cpukit/libdebugger/rtems-debugger-aarch64.c
index 279c2d61ef..9a53da0de9 100644
--- a/cpukit/libdebugger/rtems-debugger-aarch64.c
+++ b/cpukit/libdebugger/rtems-debugger-aarch64.c
@@ -34,7 +34,9 @@
#include <inttypes.h>
#include <stdlib.h>
-/* Defined by linkcmds.base */
+/* Defined by linkcmds.base. This should be taken from <bsp/linker-symbols.h> */
+extern char bsp_section_start_begin[];
+extern char bsp_section_start_end[];
extern char bsp_section_text_begin[];
extern char bsp_section_text_end[];
extern char bsp_section_fast_text_begin[];
@@ -1231,6 +1233,8 @@ static rtems_status_code rtems_debugger_target_set_text_writable(
bool writable
)
{
+ uintptr_t start_begin = (uintptr_t) bsp_section_start_begin;
+ uintptr_t start_end = (uintptr_t) bsp_section_start_end;
uintptr_t text_begin = (uintptr_t) bsp_section_text_begin;
uintptr_t text_end = (uintptr_t) bsp_section_text_end;
uintptr_t fast_text_begin = (uintptr_t) bsp_section_fast_text_begin;
@@ -1243,6 +1247,23 @@ static rtems_status_code rtems_debugger_target_set_text_writable(
}
target_printk(
+ "[} MMU edit: start_begin: 0x%016" PRIxPTR
+ " start_end: 0x%016" PRIxPTR "\n",
+ start_begin,
+ start_end
+ );
+ sc = aarch64_mmu_map(
+ start_begin,
+ start_end - start_begin,
+ mmu_flags
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ target_printk( "[} MMU edit failed\n" );
+ return sc;
+ }
+
+ target_printk(
"[} MMU edit: text_begin: 0x%016" PRIxPTR
" text_end: 0x%016" PRIxPTR "\n",
text_begin,