Last change
on this file since 486 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
631 bytes
|
Rev | Line | |
---|
[444] | 1 | ;; |
---|
| 2 | ;; The errno will be in r5 if r11 is -1. |
---|
| 3 | ;; |
---|
| 4 | .text |
---|
| 5 | .global __trap0 |
---|
| 6 | __trap0: |
---|
| 7 | ;; non-leaf function so need to create stack frame to |
---|
| 8 | ;; store ra and fp |
---|
| 9 | subi sp, sp, #16 |
---|
| 10 | stw ra, sp, #12 |
---|
| 11 | or r0, r0, r0 ;; nop |
---|
| 12 | stw fp, sp, #8 |
---|
| 13 | or fp, sp, sp |
---|
| 14 | stw r5, sp, #4 |
---|
| 15 | or r0, r0, r0 ;; nop |
---|
| 16 | stw r6, sp, #0 |
---|
| 17 | addi r6, r0, #$-1 |
---|
| 18 | si r14 |
---|
| 19 | or r0, r0, r0 ;; nop |
---|
| 20 | brne r11, r6, .L0 |
---|
| 21 | ldui r6, #%hi16(errno) |
---|
| 22 | addui r6, r6, #%lo16(errno) |
---|
| 23 | stw r5, r6, #0 |
---|
| 24 | or r0, r0, r0 ;; nop |
---|
| 25 | .L0: |
---|
| 26 | ldw r6, sp, #0 |
---|
| 27 | or r0, r0, r0 ;; nop |
---|
| 28 | ldw r5, sp, #4 |
---|
| 29 | or r0, r0, r0 ;; nop |
---|
| 30 | ldw ra, sp, #12 |
---|
| 31 | or r0, r0, r0 ;; nop |
---|
| 32 | ldw fp, sp, #8 |
---|
| 33 | jal r0, r14 |
---|
| 34 | addi sp, sp, #16 |
---|
Note: See
TracBrowser
for help on using the repository browser.