Ignore:
Timestamp:
Mar 28, 2018, 2:40:29 PM (7 years ago)
Author:
alain
Message:

Fix various bugs

File:
1 edited

Legend:

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

    r410 r437  
    33 *
    44 * Authors       Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *               Alain Greiner (2016,2017)
     5 *               Alain Greiner (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    4040    error_t       error;
    4141
    42         uint32_t      tm_start;
    43         uint32_t      tm_end;
    44 
    45         tm_start = hal_get_cycles();
    46 
    4742        thread_t    * this    = CURRENT_THREAD;
    4843        process_t   * process = this->process;
     44
     45#if CONFIG_DEBUG_SYS_MUNMAP
     46uint64_t tm_start;
     47uint64_t tm_end;
     48tm_start = hal_get_cycles();
     49if( CONFIG_DEBUG_SYS_MUNMAP < tm_start )
     50printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n"
     51__FUNCTION__ , this, process->pid, (uint32_t)tm_start );
     52#endif
    4953
    5054    // call relevant kernel function
     
    5357    if ( error )
    5458    {
    55         printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ );
     59
     60#if CONFIG_DEBUG_SYSCALLS_ERROR
     61printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ );
     62#endif
    5663                this->errno = EINVAL;
    5764                return -1;
    5865    }
    5966
    60     tm_end = hal_get_cycles();
     67#if CONFIG_DEBUG_SYS_MUNMAP
     68tm_end = hal_get_cycles();
     69if( CONFIG_DEBUG_SYS_MUNMAP < tm_start )
     70printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
     71__FUNCTION__ , this, process->pid, (uint32_t)tm_end );
     72#endif
    6173
    62 syscall_dmsg("\n[DBG] %s : core[%x,%d] removed vseg in process %x / cycle %d\n"
    63 "      base = %x / size = %x / cost = %d\n",
    64 __FUNCTION__, local_cxy , this->core->lid , process->pid , tm_start ,
    65 vaddr , size , tm_end - tm_start );
     74    return 0;
    6675
    67         return 0;
     76}  // end sys_munmap()
    6877
    69 }  // end sys_mmap()
    70 
Note: See TracChangeset for help on using the changeset viewer.