Ignore:
Timestamp:
Jun 18, 2017, 10:06:41 PM (7 years ago)
Author:
alain
Message:

Introduce syscalls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_mmap.c

    r1 r23  
    11/*
    2  * kern/sys_mmap.c - map files, memory or devices into process's
    3  *                   virtual address space
     2 * sys_mmap.c - map files, memory or devices into process virtual address space
    43 *
    5  * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
    6  * Copyright (c) 2011,2012 UPMC Sorbonne Universites
     4 * Authors       Ghassan Almaless (2008,2009,2010,2011,2012)
     5 *               Alain Greiner (2016,2017)
    76 *
    8  * This file is part of ALMOS-kernel.
     7 * Copyright (c) UPMC Sorbonne Universites
    98 *
    10  * ALMOS-kernel is free software; you can redistribute it and/or modify it
     9 * This file is part of ALMOS-MKH.
     10 *
     11 * ALMOS-MKH is free software; you can redistribute it and/or modify it
    1112 * under the terms of the GNU General Public License as published by
    1213 * the Free Software Foundation; version 2.0 of the License.
    1314 *
    14  * ALMOS-kernel is distributed in the hope that it will be useful, but
     15 * ALMOS-MKH is distributed in the hope that it will be useful, but
    1516 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1617 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     
    1819 *
    1920 * You should have received a copy of the GNU General Public License
    20  * along with ALMOS-kernel; if not, write to the Free Software Foundation,
     21 * along with ALMOS-MKH; if not, write to the Free Software Foundation,
    2122 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    2223 */
    2324
     25#include <hal_types.h>
    2426#include <errno.h>
    2527#include <thread.h>
     28#include <printk.h>
    2629#include <vfs.h>
    27 #include <sys-vfs.h>
    2830#include <process.h>
    2931#include <vmm.h>
    3032
    3133///////////////////////////////////
    32 int sys_mmap( mmap_attr_t * mattr )
     34int sys_mmap( mmap_attr_t * attr )
    3335{
     36    printk("\n[WARNING] function %s not implemented\n", __FUNCTION__ );
     37    return 0;
     38/*   
    3439        error_t err;
    3540        uint_t count;
     
    4651        file = NULL;
    4752
    48         if((err = cpu_copy_from_uspace(&attr, mattr, sizeof(mmap_attr_t))))
     53        if((err = cpu_copy_from_uspace(&attr, attr, sizeof(mmap_attr_t))))
    4954        {
    5055                printk(INFO, "%s: failed, copying from uspace @%x\n",
    5156                       __FUNCTION__,
    52                        mattr);
     57                       attr);
    5358
    5459                this->info.errno = EFAULT;
     
    8287        else
    8388        {     
    84                 /* FIXEME: possible concurent delete of file from another bugy thread closing it */
     89                // FIXME: possible concurent delete of file from another bugy thread closing it
    8590                if((attr.fd >= CONFIG_TASK_FILE_MAX_NR) || (process_fd_lookup(process, attr.fd, &file)))
    8691                {
     
    145150
    146151        return (int)VM_FAILED;
    147 }
     152*/
     153}  // end sys_mmap()
Note: See TracChangeset for help on using the changeset viewer.