newlib/libgloss/ms1/trap.S
Aldy Hernandez 3f4df6211e * configure.in: Add ms1 case.
* configure: Regenerate.
	* ms1/16-002.ld: New.
	* ms1/16-003.ld: New.
	* ms1/64-001.ld: New.
	* ms1/access.c: New.
	* ms1/chmod.c: New.
	* ms1/close.c: New.
	* ms1/configure: New.
	* ms1/configure.in: New.
	* ms1/crt0-16-002.S: New.
	* ms1/crt0-16-003.S: New.
	* ms1/crt0-64-001.S: New.
	* ms1/crt0.S: New.
	* ms1/exit-16-002.c: New.
	* ms1/exit-16-003.c: New.
	* ms1/exit-64-001.c: New.
	* ms1/exit.c: New.
	* ms1/fstat.c: New.
	* ms1/getpid.c: New.
	* ms1/gettime.c: New.
	* ms1/isatty.c: New.
	* ms1/kill.c: New.
	* ms1/lseek.c: New.
	* ms1/Makefile.in: New.
	* ms1/open.c: New.
	* ms1/read.c: New.
	* ms1/sbrk.c: New.
	* ms1/startup-16-002.S: New.
	* ms1/startup-16-003.S: New.
	* ms1/startup-64-001.S: New.
	* ms1/stat.c: New.
	* ms1/time.c: New.
	* ms1/times.c: New.
	* ms1/trap.h: New.
	* ms1/trap.S: New.
	* ms1/unlink.c: New.
	* ms1/utime.c: New.
	* ms1/write.c: New.
2005-07-06 12:58:12 +00:00

35 lines
631 B
ArmAsm

;;
;; The errno will be in r5 if r11 is -1.
;;
.text
.global __trap0
__trap0:
;; non-leaf function so need to create stack frame to
;; store ra and fp
subi sp, sp, #16
stw ra, sp, #12
or r0, r0, r0 ;; nop
stw fp, sp, #8
or fp, sp, sp
stw r5, sp, #4
or r0, r0, r0 ;; nop
stw r6, sp, #0
addi r6, r0, #$-1
si r14
or r0, r0, r0 ;; nop
brne r11, r6, .L0
ldui r6, #%hi16(errno)
addui r6, r6, #%lo16(errno)
stw r5, r6, #0
or r0, r0, r0 ;; nop
.L0:
ldw r6, sp, #0
or r0, r0, r0 ;; nop
ldw r5, sp, #4
or r0, r0, r0 ;; nop
ldw ra, sp, #12
or r0, r0, r0 ;; nop
ldw fp, sp, #8
jal r0, r14
addi sp, sp, #16