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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [mcore/] [syscalls.S] - Diff between revs 158 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 158 Rev 816
.macro FUNC_START name
.macro FUNC_START name
        .text
        .text
        .globl \name
        .globl \name
        .globl _\name
        .globl _\name
\name:
\name:
_\name:
_\name:
.endm
.endm
FUNC_START _sbrk
FUNC_START _sbrk
        mov     r4, r2                  // save increment
        mov     r4, r2                  // save increment
        lrw     r3, brkval
        lrw     r3, brkval
        ldw     r2, (r3)                // get next spot
        ldw     r2, (r3)                // get next spot
        movi    r5, 7
        movi    r5, 7
        addi    r2, 7                   // round up to 8 bytes
        addi    r2, 7                   // round up to 8 bytes
        andn    r2, r5
        andn    r2, r5
        addu    r4, r2                  // save updated pointer
        addu    r4, r2                  // save updated pointer
        stw     r4, (r3)
        stw     r4, (r3)
        jmp     r15
        jmp     r15
// brk() could go in here too...
// brk() could go in here too...
        .data
        .data
        .import _end
        .import _end
brkval: .long   _end
brkval: .long   _end
FUNC_START _exit
FUNC_START _exit
        mov     r1, r1          // accomodate simulator glitch...
        mov     r1, r1          // accomodate simulator glitch...
        .short  0x5000
        .short  0x5000
        br      _exit           // hard loop here
        br      _exit           // hard loop here
// 0x5001 - printf
// 0x5001 - printf
// 0x5002 - scanf
// 0x5002 - scanf
FUNC_START utime
FUNC_START utime
        .short  0x5003
        .short  0x5003
        jmp     r15
        jmp     r15
.macro stub name value
.macro stub name value
FUNC_START \name
FUNC_START \name
        movi    r1, \value
        movi    r1, \value
        .short  0x50FF
        .short  0x50FF
        jmp     r15
        jmp     r15
.endm
.endm
stub _close   6
stub _close   6
stub _lseek  19
stub _lseek  19
stub _open    5
stub _open    5
stub _read    3
stub _read    3
stub _times  43
stub _times  43
stub _unlink 10
stub _unlink 10
stub _write   4
stub _write   4
//stub access  33
//stub access  33
//stub creat    8
//stub creat    8
//stub link     9
//stub link     9
//stub time    13
//stub time    13
//stub profil 98  // movi r6, 2
//stub profil 98  // movi r6, 2
//stub lprofil 98 // movi r6, 4
//stub lprofil 98 // movi r6, 4
 
 

powered by: WebSVN 2.1.0

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