;vector_handler_6E
;------------------
;reset JIT space if applicable

.vector_handler_6E
 BL      check_JIT_and_taskID		;is the task supported?
 BNE     vector_handler_forward		;NO, hand to OS

 TST     R0, #%1			;all memory?
 #if ARMv4_JIT == 0
   #if ARMv4_JIT == 0 AND MMUControl2_support == 0
     BLNE    check_SWI_within_ADFFS	;is it us?
   #endif
   BEQ     vector_handler_forward	;YES, pass on

   STMFD   R13!, {R2, R4}
 #endif
 #if ARMv4_JIT == 1
   #if ARMv4_JIT == 1 AND MMUControl2_support == 0
     BEQ     _all_memory
     BL      check_SWI_within_ADFFS	;is it us?
     BEQ     vector_handler_forward	;YES, pass on
     TST     R0, #%1			;all memory?
     ._all_memory
   #endif
   LDREQB  R11, JIT_ARM4		;YES
   TEQEQ   R11, #0			;all memory and ARMv3?
   BEQ     vector_handler_forward	;YES, pass on

   STMFD   R13!, {R2, R4}
   TST     R0, #%1			;all memory?
   MOVEQ   R2, #page_zero_Scratch_Space	;YES,
   MOVEQ   R4, #jit_appspace_end	; |
   SUBEQ   R4, R4, R2			; |
   BEQ     _full_sync			; |+  flush all memory
 #endif

 CMP     R2, #jit_appspace_end
 BHI     vector_handler_6E_pass_on
 SUB     R4, R2, R1			;NO,  size - 4
 ADD     R4, R4, #4			;correct size
 MOV     R2, R1				;start address
 ADD     R11, R2, R4
 CMP     R11, #jit_appspace_end
 RSBHI   R4, R2, #jit_appspace_end	;cap end address

 CMP     R4, #0
 BLE     vector_handler_6E_pass_on	;ignore invalid addresses
 ._full_sync
 CMP     R2, #jit_appspace_end		;within App space?
 BLLO    hv_reset_memory_block		;YES, reset JIT space
EXITSWI "R2, R4"

.vector_handler_6E_pass_on
 LDMFD   R13!, {R2, R4}
B       vector_handler_forward
