summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/microblaze
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/microblaze')
-rw-r--r--cpukit/score/cpu/microblaze/cpu.c26
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpu.h9
2 files changed, 35 insertions, 0 deletions
diff --git a/cpukit/score/cpu/microblaze/cpu.c b/cpukit/score/cpu/microblaze/cpu.c
index 7ff8ca3071..fe55ef5546 100644
--- a/cpukit/score/cpu/microblaze/cpu.c
+++ b/cpukit/score/cpu/microblaze/cpu.c
@@ -203,3 +203,29 @@ void _MicroBlaze_Exception_handle( CPU_Exception_frame *ef )
rtems_fatal( RTEMS_FATAL_SOURCE_EXCEPTION, (rtems_fatal_code) ef );
}
+
+MicroBlaze_Exception_handler installed_debug_handler = NULL;
+
+void _MicroBlaze_Debug_install_handler(
+ MicroBlaze_Exception_handler new_handler,
+ MicroBlaze_Exception_handler *old_handler
+)
+{
+ if ( old_handler != NULL ) {
+ *old_handler = installed_debug_handler;
+ }
+
+ installed_debug_handler = new_handler;
+}
+
+void _MicroBlaze_Debug_handle( CPU_Exception_frame *ef )
+{
+ /* BiP is not set for software debug events, set it here */
+ ef->msr |= MICROBLAZE_MSR_BIP;
+
+ if ( installed_debug_handler != NULL ) {
+ installed_debug_handler( ef );
+ }
+
+ rtems_fatal( RTEMS_FATAL_SOURCE_EXCEPTION, (rtems_fatal_code) ef );
+}
diff --git a/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h b/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h
index a9c5066399..fe0d9a8996 100644
--- a/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h
@@ -344,6 +344,15 @@ void _MicroBlaze_Exception_handle(
CPU_Exception_frame *ef
);
+void _MicroBlaze_Debug_install_handler(
+ MicroBlaze_Exception_handler new_handler,
+ MicroBlaze_Exception_handler *old_handler
+);
+
+void _MicroBlaze_Debug_handle(
+ CPU_Exception_frame *ef
+);
+
void _CPU_Context_switch(
Context_Control *run,
Context_Control *heir