;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 MMUControl2_support == 0
   BLNE    check_SWI_within_ADFFS	;is it us?
 #endif
 BEQ     vector_handler_forward		;YES, pass on

 STMFD   R13!, {R2, R4}
; MOVEQ   R2, #&4000			;YES,
; MOVEQ   R4, #jit_appspace_end		; |
; SUBEQ   R4, R4, R2			; |
; BEQ     _full_sync			; |+  flush all memory
 SUB     R4, R2, R1			;NO,  size - 4
 ADD     R4, R4, #4			;correct size
 CMP     R2, #jit_appspace_end
 BHI     vector_handler_6E_pass_on
 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
