source: trunk/kernel/syscalls/sys_place_fork.c @ 608

Last change on this file since 608 was 584, checked in by alain, 6 years ago

Introduce sys_place_fork() function.

File size: 1.6 KB
Line 
1/*
2 * sys_get_core.c - get calling core cluster and local index.
3 *
4 * Author    Alain Greiner (2016,2017)
5 * 
6 * Copyright (c) UPMC Sorbonne Universites
7 *
8 * This file is part of ALMOS-MKH.
9 *
10 * ALMOS-MKH is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2.0 of the License.
13 *
14 * ALMOS-MKH is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ALMOS-MKH; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include <hal_kernel_types.h>
25#include <hal_uspace.h>
26#include <hal_special.h>
27#include <errno.h>
28#include <core.h>
29#include <thread.h>
30#include <process.h>
31#include <vmm.h>
32#include <printk.h>
33
34#include <syscalls.h>
35
36///////////////////////////////////
37int sys_place_fork( uint32_t  cxy )
38{
39    thread_t  * this    = CURRENT_THREAD;
40    process_t * process = this->process;
41
42    // check cxy argument
43    if( cluster_is_undefined( cxy ) )
44    {
45       
46#if DEBUG_SYSCALLS_ERROR
47printk("\n[ERROR] in %s : thread[%x,‰x] / illegal cxy argument %x\n",
48__FUNCTION__ , process->pid , this->trdid , cxy );
49#endif
50        this->errno = EFAULT;
51                return -1;
52        }
53
54    // set relevant arguments in calling thread descriptor
55    this->fork_user = true;
56    this->fork_cxy  = cxy;
57
58        return 0; 
59
60}  // end sys_place_fork()
Note: See TracBrowser for help on using the repository browser.