Move the ehb instruction in the PIC32/MPLAB port layer.
diff --git a/Source/portable/MPLAB/PIC32MX/ISR_Support.h b/Source/portable/MPLAB/PIC32MX/ISR_Support.h
index 9a9caa3..56b44e2 100644
--- a/Source/portable/MPLAB/PIC32MX/ISR_Support.h
+++ b/Source/portable/MPLAB/PIC32MX/ISR_Support.h
@@ -208,8 +208,8 @@
 	addiu		sp,	sp,	portCONTEXT_SIZE

 

 	mtc0		k0, _CP0_STATUS

-	ehb

 	mtc0 		k1, _CP0_EPC

+	ehb

 	eret 

 	nop

 

diff --git a/Source/portable/MPLAB/PIC32MX/port_asm.S b/Source/portable/MPLAB/PIC32MX/port_asm.S
index 7c6d4ae..ad1a7b2 100644
--- a/Source/portable/MPLAB/PIC32MX/port_asm.S
+++ b/Source/portable/MPLAB/PIC32MX/port_asm.S
@@ -284,9 +284,9 @@
 	/* Remove stack frame. */

 	addiu		sp,	sp,	portCONTEXT_SIZE

 

-	mtc0		k1, _CP0_STATUS

-	ehb	

+	mtc0		k1, _CP0_STATUS	

 	mtc0 		k0, _CP0_EPC

+	ehb

 	eret 

 	nop