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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [m68k/] [__open.c] - Blame information for rev 1770

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#include <fcntl.h>
2
#include <errno.h>
3
#include <sys/syscall.h>
4
#include <stdarg.h>
5
 
6
int
7
__open(const char * filename, int flag, ...)
8
{
9
        int res;
10
        register int d0 asm ("%d0");
11
        va_list arg;
12
 
13
        va_start(arg,flag);
14
        __asm__("movel %2,%/d1\n\t"
15
                "movel %3,%/d2\n\t"
16
                "movel %4,%/d3\n\t"
17
                "trap #0\n\t"
18
                :"=g" (d0)
19
                :"0" (SYS_open),"g" (filename),"g" (flag),
20
                 "g" (va_arg(arg,int))
21
                : "%d0", "%d1", "%d2", "%d3");
22
        res = d0;
23
        if (res>=0)
24
                return res;
25
        errno = -res;
26
        va_end(arg);
27
        return -1;
28
}

powered by: WebSVN 2.1.0

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