;References:
;swi - vector_handler_forward
;swi_OS_Module - vector_handler_trap

;vector_handler_6F_71
;--------------------
;Hypervises SWI's issued though OS_CallASWI and OS_CallASWIR12
;
;Entry:
; R14 - SWI# << 12

.vector_handler_6F_71
 #if JIT_WIMP_support == 0 AND compile_RO > 311
   LDR     R12, jit_code		;is the JIT running?
   TEQ     R12, #0
   BEQ     vector_handler_forward	;NO, hand to OS

   LDR     R12, [R13, #4]		;get R14 from stack
   #if compile_RO == 400 AND JIT_WIMP_support == 0
     BIC     R12, R12, #&FC000003	;clear PC flags on 26bit OS
   #endif
   CMP     R12, #jit_code_start		;is it within App Space
   BHI     vector_handler_forward	;NO
 #endif

 #if JIT_WIMP_support == 1
   MOV     R12, R14			;preserve R14
   BL      check_task_ID		;is this a task we support?
   BNE     vector_handler_forward	;NO, hand to OS
   MOV     R14, R12			;preserve R14

;@@@ NEEDS TO CHECK AND EXIT IF CALLED FROM RMA

 #endif

 STR     R0, [R13, #-4]!		;preserve R0
 TEQ     R14, #&6F << 12		;OS_CallASWI
 MOVEQ   R0, R10			;SWI# is in R10
 TEQ     R14, #&71 << 12		;OS_CallASWIR12
 LDREQ   R0, [R13, #4]			;SWI# is in R12 on stack
 BL      hv_OS_CallASWI_check_SWI	;is SWI supported?
 MOV     R14, R0			;R14 = SWI#
 LDR     R0, [R13], #4			;preserve R0
 BEQ     hv_OS_CallASWI_codelet_required
 CMP     R14, #JIT_SWI_OS_Flag << 20	;does it need hypervising?
 BHI     hypervised_CallASWI		;YES
B       vector_handler_forward
