Changeset 440 for trunk/kernel/syscalls/sys_mmap.c
- Timestamp:
- May 3, 2018, 5:51:22 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_mmap.c
r438 r440 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016,2017 )5 * Alain Greiner (2016,2017,2018) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites … … 44 44 xptr_t mapper_xp; 45 45 error_t error; 46 paddr_t paddr; // unused, but required for user space checking47 46 reg_t save_sr; // required to enable IRQs 48 47 … … 60 59 61 60 // check arguments in user space 62 error = vmm_ v2p_translate( false , attr , &paddr);61 error = vmm_get_vseg( process , (intptr_t)attr , &vseg ); 63 62 64 63 if ( error ) … … 66 65 67 66 #if DEBUG_SYSCALLS_ERROR 68 printk("\n[ERROR] in %s : arguments not in used space = %x\n", __FUNCTION__ , (intptr_t)attr ); 67 printk("\n[ERROR] in %s : user buffer unmapped %x / thread %x / process %x\n", 68 __FUNCTION__ , (intptr_t)attr , this->trdid , process->pid ); 69 vmm_display( process , false ); 69 70 #endif 70 71 this->errno = EINVAL; … … 92 93 93 94 #if DEBUG_SYSCALLS_ERROR 94 printk("\n[ERROR] in %s : MAP_FIXED not supported\n", __FUNCTION__ ); 95 printk("\n[ERROR] in %s : MAP_FIXED not supported / thread %x / process %x\n", 96 __FUNCTION__ , this->trdid , process->pid ); 95 97 #endif 96 98 this->errno = EINVAL; … … 102 104 103 105 #if DEBUG_SYSCALLS_ERROR 104 printk("\n[ERROR] in %s : MAP_SHARED xor MAP_PRIVATE\n", __FUNCTION__ ); 106 printk("\n[ERROR] in %s : MAP_SHARED == MAP_PRIVATE / thread %x / process %x\n", 107 __FUNCTION__ , this->trdid , process->pid ); 105 108 #endif 106 109 this->errno = EINVAL; … … 124 127 125 128 #if DEBUG_SYSCALLS_ERROR 126 printk("\n[ERROR] in %s: bad file descriptor = %d\n", __FUNCTION__ , fdid ); 129 printk("\n[ERROR] in %s: bad file descriptor %d / thread %x / process %x\n", 130 __FUNCTION__ , fdid , this->trdid , process->pid ); 127 131 #endif 128 132 this->errno = EBADFD; … … 137 141 138 142 #if DEBUG_SYSCALLS_ERROR 139 printk("\n[ERROR] in %s: file %d not found\n", __FUNCTION__ , fdid ); 143 printk("\n[ERROR] in %s: file %d not found / thread %x / process %x\n", 144 __FUNCTION__ , fdid , this->trdid , process->pid ); 140 145 #endif 141 146 this->errno = EBADFD; … … 160 165 161 166 #if DEBUG_SYSCALLS_ERROR 162 printk("\n[ERROR] in %s: offset (%d) + len (%d) >= file's size (%d)\n",163 __FUNCTION__, k_attr.offset, k_attr.length, size );167 printk("\n[ERROR] in %s: offset(%d) + len(%d) >= file's size(%d) / thread %x / process %x\n", 168 __FUNCTION__, k_attr.offset, k_attr.length, size, this->trdid, process->pid ); 164 169 #endif 165 170 this->errno = ERANGE; … … 173 178 174 179 #if DEBUG_SYSCALLS_ERROR 175 printk("\n[ERROR] in %s: prot = %x / file_attr = %x )\n",176 __FUNCTION__ , k_attr.prot , file_attr );180 printk("\n[ERROR] in %s: prot = %x / file_attr = %x / thread %x , process %x\n", 181 __FUNCTION__ , k_attr.prot , file_attr , this->trdid , process->pid ); 177 182 #endif 178 183 this->errno = EACCES; … … 206 211 207 212 #if DEBUG_SYSCALLS_ERROR 208 printk("\n[ERROR] in %s : illegal cxy for MAP_REMOTE\n", __FUNCTION__ ); 213 printk("\n[ERROR] in %s : illegal cxy for MAP_REMOTE / thread %x / process %x\n", 214 __FUNCTION__, this->trdid , process->pid ); 209 215 #endif 210 216 this->errno = EINVAL; … … 255 261 256 262 #if DEBUG_SYSCALLS_ERROR 257 printk("\n[ERROR] in %s : cannot create vseg\n", __FUNCTION__ ); 263 printk("\n[ERROR] in %s : cannot create vseg / thread %x / process %x\n", 264 __FUNCTION__, this->trdid , process->pid ); 258 265 #endif 259 266 this->errno = ENOMEM;
Note: See TracChangeset
for help on using the changeset viewer.