OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [libgloss/] [mcore/] [syscalls.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
.macro FUNC_START name
2
        .text
3
        .globl \name
4
        .globl _\name
5
\name:
6
_\name:
7
.endm
8
 
9
FUNC_START _sbrk
10
        mov     r4, r2                  // save increment
11
        lrw     r3, brkval
12
        ldw     r2, (r3)                // get next spot
13
 
14
        movi    r5, 7
15
        addi    r2, 7                   // round up to 8 bytes
16
        andn    r2, r5
17
 
18
        addu    r4, r2                  // save updated pointer
19
        stw     r4, (r3)
20
        jmp     r15
21
 
22
// brk() could go in here too...
23
 
24
        .data
25
        .import _end
26
brkval: .long   _end
27
 
28
 
29
FUNC_START _exit
30
        mov     r1, r1          // accomodate simulator glitch...
31
        .short  0x5000
32
        br      _exit           // hard loop here
33
 
34
// 0x5001 - printf
35
// 0x5002 - scanf
36
 
37
FUNC_START utime
38
        .short  0x5003
39
        jmp     r15
40
 
41
 
42
.macro stub name value
43
FUNC_START \name
44
        movi    r1, \value
45
        .short  0x50FF
46
        jmp     r15
47
.endm
48
 
49
stub _close   6
50
stub _lseek  19
51
stub _open    5
52
stub _read    3
53
stub _times  43
54
stub _unlink 10
55
stub _write   4
56
 
57
//stub access  33
58
//stub creat    8
59
//stub link     9
60
//stub time    13
61
 
62
//stub profil 98  // movi r6, 2
63
//stub lprofil 98 // movi r6, 4
64
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.