;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

; MOVEQ   R2, #&8000			;YES,
; MOVEQ   R4, #jit_allocate_memory	; |
; SUBEQ   R4, R4, R2			; |+  flush all memory
 STMFD   R13!, {R2, R4}
 SUB     R4, R2, R1			;NO,  size - 4
 ADD     R4, R4, #4			; |   correct size
 MOV     R2, R1				; |+  start address

 CMP     R2, #jit_code_start		;within JIT space?
 BLLO    hv_reset_memory_block		;reset JIT space
EXITSWI "R2, R4"
