diff options
author | Ranjith Kumaran <ranjith@cygnus.com> | 2000-03-18 01:48:54 +0300 |
---|---|---|
committer | Ranjith Kumaran <ranjith@cygnus.com> | 2000-03-18 01:48:54 +0300 |
commit | 03261851a10dd2d6900a0a00a7515a0a46fb5d76 (patch) | |
tree | 7c22ac6cbbc99fd5cd1b5426853be8d4fd7bfcf1 /libgloss/mcore/syscalls.S | |
parent | fae4c299f14fc23e2829c8656992eba21f79242a (diff) |
20000317 sourceware import
Diffstat (limited to 'libgloss/mcore/syscalls.S')
-rw-r--r-- | libgloss/mcore/syscalls.S | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/libgloss/mcore/syscalls.S b/libgloss/mcore/syscalls.S new file mode 100644 index 000000000..61a2847aa --- /dev/null +++ b/libgloss/mcore/syscalls.S @@ -0,0 +1,64 @@ +.macro FUNC_START name + .text + .globl \name + .globl _\name +\name: +_\name: +.endm + +FUNC_START _sbrk + mov r4, r2 // save increment + lrw r3, brkval + ldw r2, (r3) // get next spot + + movi r5, 7 + addi r2, 7 // round up to 8 bytes + andn r2, r5 + + addu r4, r2 // save updated pointer + stw r4, (r3) + jmp r15 + +// brk() could go in here too... + + .data + .import _end +brkval: .long _end + + +FUNC_START _exit + mov r1, r1 // accomodate simulator glitch... + .short 0x5000 + br _exit // hard loop here + +// 0x5001 - printf +// 0x5002 - scanf + +FUNC_START utime + .short 0x5003 + jmp r15 + + +.macro stub name value +FUNC_START \name + movi r1, \value + .short 0x50FF + jmp r15 +.endm + +stub _close 6 +stub _lseek 19 +stub _open 5 +stub _read 3 +stub _times 43 +stub _unlink 10 +stub _write 4 + +//stub access 33 +//stub creat 8 +//stub link 9 +//stub time 13 + +//stub profil 98 // movi r6, 2 +//stub lprofil 98 // movi r6, 4 + |