home *** CD-ROM | disk | FTP | other *** search
- ;----------------------------------------------------------------------------
- ;
- ; $Source: /unixb/home/unixlib/source/unixlib37/src/sys/s/RCS/_kernel,v $
- ; $Date: 1996/11/06 22:01:42 $
- ; $Revision: 1.3 $
- ; $State: Rel $
- ; $Author: unixlib $
- ;
- ; $Log: _kernel,v $
- ; Revision 1.3 1996/11/06 22:01:42 unixlib
- ; Yet more changes by NB, PB and SC.
- ;
- ; Revision 1.2 1996/10/30 21:59:00 unixlib
- ; Massive changes made by Nick Burret and Peter Burwood.
- ;
- ; Revision 1.1 1996/04/19 21:34:32 simon
- ; Initial revision
- ;
- ;----------------------------------------------------------------------------
-
- GET Unix37:unixlib.s.asm_dec
-
- AREA |C$$wrcode|,CODE
-
- ; _kernel_swi for UnixLib
- ; This version provides the same programming contract as the version in
- ; the Shared C Library and hence follows the definition of the function
- ; in C:kernel.h.
- ;
- ; This version differs by working not placing the generated code onto
- ; the stack, but using self-modifying code inlined in the function.
- ; This version will work on all current ARM chips including the ARM 8
- ; and StrongARM. The self-modifying code works because the only
- ; instruction modified is a SWI and the instruction cache only uses
- ; the condition code field and the SWI instruction field (the top
- ; byte) which is preset. The SWI decoding code will load the SWI `comment'
- ; field of the SWI from the data cache.
- ;
- ; Unfortunately, DDT doesn't seem to like even that bit of self-modifying
- ; code on a StrongARM, so we use OS_CallASWIR12 (as all good boys and
- ; girls should).
-
-
- IMPORT |__seterr|
- EXPORT |_kernel_swi|
-
- |_kernel_swi|
- STMFD sp!,{a3,v1-v6,lr}
- BICS ip,a1,#&80000000
- ORRPL ip,ip,#&20000 ; X bit
- LDMIA a2,{a1-v6}
- SWI XOS_CallASWIR12
- LDR ip,[sp,#0]
- STMIA ip,{a1-v6}
- MOVVS v1,a1
- BLVS |__seterr|
- MOVVS a1,v1
- MOVVC a1,#0
- LDMIA sp!,{a3,v1-v6,pc}^
-
- ; add kernel_last_oserror to pick up the saved error in __seterr ?
-
- END
-