POK(kernelpart)
/home/jaouen/pok_official/pok/trunk/kernel/arch/ppc/syscalls.c
Go to the documentation of this file.
00001 /*
00002  *                               POK header
00003  * 
00004  * The following file is a part of the POK project. Any modification should
00005  * made according to the POK licence. You CANNOT use this file or a part of
00006  * this file is this part of a file for your own project
00007  *
00008  * For more information on the POK licence, please see our LICENCE FILE
00009  *
00010  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
00011  *
00012  *                                      Copyright (c) 2007-2009 POK team 
00013  *
00014  * Created by julien on Thu Jan 15 23:34:13 2009 
00015  */
00016 
00017 
00018 #include <errno.h>
00019 #include <core/debug.h>
00020 #include <core/syscall.h>
00021 #include <core/partition.h>
00022 
00023 #include <types.h>
00024 #include <libc.h>
00025 
00026 void pok_arch_sc_int(uint32_t num, uint32_t arg1, uint32_t arg2,
00027                      uint32_t arg3, uint32_t arg4, uint32_t arg5)
00028 {
00029    uint8_t              part_id;
00030 
00031    pok_syscall_info_t   syscall_info;
00032    pok_syscall_args_t   syscall_args;
00033    pok_syscall_id_t     syscall_id;
00034 
00035    part_id  = pok_current_partition;
00036 
00037    /* prepare syscall_info */
00038    syscall_info.partition = part_id;
00039    syscall_info.base_addr = pok_partitions[part_id].base_addr;
00040    syscall_info.thread    = POK_SCHED_CURRENT_THREAD;
00041 
00042    /* prepare syscall_args */
00043    syscall_args.arg1 = arg1;
00044    syscall_args.arg2 = arg2;
00045    syscall_args.arg3 = arg3;
00046    syscall_args.arg4 = arg4;
00047    syscall_args.arg5 = arg5;
00048 
00049    syscall_args.nargs = 5;
00050 
00051    /* prepare syscall_id */
00052    syscall_id = (pok_syscall_id_t) num;
00053 
00054    if (POK_CHECK_PTR_IN_PARTITION(syscall_info.partition, &syscall_args) != 0)
00055    {
00056       /*
00057        * Perform the syscall baby !
00058        */
00059      pok_core_syscall (syscall_id, &syscall_args, &syscall_info);
00060    }
00061 }