POK(kernelpart)
syscalls.c
Go to the documentation of this file.
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #include <errno.h>
19 #include <core/debug.h>
20 #include <core/syscall.h>
21 #include <core/partition.h>
22 
23 #include <types.h>
24 #include <libc.h>
25 
27  uint32_t arg3, uint32_t arg4, uint32_t arg5)
28 {
29  uint8_t part_id;
30 
31  pok_syscall_info_t syscall_info;
32  pok_syscall_args_t syscall_args;
33  pok_syscall_id_t syscall_id;
34 
35  part_id = pok_current_partition;
36 
37  /* prepare syscall_info */
38  syscall_info.partition = part_id;
39  syscall_info.base_addr = pok_partitions[part_id].base_addr;
40  syscall_info.thread = POK_SCHED_CURRENT_THREAD;
41 
42  /* prepare syscall_args */
43  syscall_args.arg1 = arg1;
44  syscall_args.arg2 = arg2;
45  syscall_args.arg3 = arg3;
46  syscall_args.arg4 = arg4;
47  syscall_args.arg5 = arg5;
48 
49  syscall_args.nargs = 5;
50 
51  /* prepare syscall_id */
52  syscall_id = (pok_syscall_id_t) num;
53 
54  if (POK_CHECK_PTR_IN_PARTITION(syscall_info.partition, &syscall_args) != 0)
55  {
56  /*
57  * Perform the syscall baby !
58  */
59  pok_core_syscall (syscall_id, &syscall_args, &syscall_info);
60  }
61 }