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