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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [api/] [syscall.c] - Blame information for rev 6

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

Line No. Rev Author Line
1 2 drasko
/*
2
 * System Calls
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
#include <l4/lib/mutex.h>
7
#include <l4/lib/printk.h>
8
#include <l4/generic/scheduler.h>
9
#include <l4/generic/tcb.h>
10
#include <l4/generic/resource.h>
11
#include <l4/generic/tcb.h>
12
#include <l4/generic/space.h>
13
#include <l4/generic/capability.h>
14
#include <l4/generic/container.h>
15
#include <l4/api/space.h>
16
#include <l4/api/ipc.h>
17
#include <l4/api/kip.h>
18
#include <l4/api/errno.h>
19
#include <l4/api/exregs.h>
20
#include INC_API(syscall.h)
21
#include INC_ARCH(exception.h)
22
 
23
void print_syscall_context(struct ktcb *t)
24
{
25
        syscall_context_t *r = t->syscall_regs;
26
 
27
        printk("Thread id: %d registers: 0x%x, 0x%x, 0x%x, 0x%x, "
28
               "0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n",
29
               t->tid, r->spsr, r->r0, r->r1, r->r2, r->r3, r->r4,
30
               r->r5, r->r6, r->r7, r->r8, r->sp_usr, r->lr_usr);
31
}
32
 
33
int sys_schedule(void)
34
{
35
        printk("(SVC) %s called. Tid (%d)\n", __FUNCTION__, current->tid);
36
        return 0;
37
}
38
 
39
int sys_getid(struct task_ids *ids)
40
{
41
        struct ktcb *this = current;
42
        int err;
43
 
44
        if ((err = check_access((unsigned long)ids,
45
                                sizeof(struct task_ids),
46
                                MAP_USR_RW, 1)) < 0)
47
                return err;
48
 
49
        ids->tid = this->tid;
50
        ids->spid = this->space->spid;
51
        ids->tgid = this->tgid;
52
 
53
        return 0;
54
}
55
 
56
int sys_container_control(unsigned int req, unsigned int flags, void *userbuf)
57
{
58
        return 0;
59
}
60
 
61
 

powered by: WebSVN 2.1.0

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