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

Subversion Repositories or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#include <errno.h>
2
#include <sys/resource.h>
3
#include <sys/syscall.h>
4
 
5
#define PZERO   15
6
 
7
int
8
getpriority(int which, int who)
9
{
10
        register long res asm ("%d0") = SYS_getpriority;
11
 
12
        __asm__ volatile ("movel %2,%/d1\n\t"
13
                          "movel %3,%/d2\n\t"
14
                          "trap  #0\n\t"
15
                :"=g" (res)
16
                :"0" (SYS_getpriority), "g" (which), "g" (who)
17
                : "%d0", "%d1", "%d2");
18
        if (res >= 0) {
19
                errno = 0;
20
                return (int) PZERO - res;
21
        }
22
        errno = -res;
23
        return -1;
24
}

powered by: WebSVN 2.1.0

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