Changeset 437 for trunk/kernel/devices/dev_fbf.c
- Timestamp:
- Mar 28, 2018, 2:40:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_fbf.c
r422 r437 2 2 * dev_fbf.c - FBF (Block Device Controler) generic device API implementation. 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 137 137 error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buffer , &buf_paddr ); 138 138 139 if( error ) 140 { 141 printk("\n[ERROR] in %s : cannot translate vaddr = %p in process %x\n", 142 __FUNCTION__ , buffer , this->process->pid ); 143 return EINVAL; 144 } 145 146 fbf_dmsg("\n[DBG] %s : thread %x in process %x / vaddr = %p / paddr = %l\n", 147 __FUNCTION__ , this->trdid , this->process->pid , buffer , buf_paddr ); 139 // check buffer is mapped 140 assert( (error == 0) , __FUNCTION__ , 141 "cannot translate vaddr = %p in process %x\n", buffer, this->process->pid ); 148 142 149 143 // get extended pointer on FBF chdev descriptor … … 162 156 163 157 // check offset and length versus FBF size 164 if( (offset + length) > (width * height) ) 165 { 166 printk("\n[ERROR] in %s : offset = %d / length = %d / width = %d / height = %d\n", 167 __FUNCTION__ , offset , length , width , height ); 168 return EINVAL; 169 } 158 assert( ((offset + length) <= (width * height)) , __FUNCTION__ , 159 "offset %d / length %d / width %d / height %d\n", offset, length, width, height ); 170 160 171 161 // compute extended pointers on frame buffer and memory buffer … … 186 176 uint32_t offset ) 187 177 { 178 179 #if CONFIG_DEBUG_DEV_FBF_RX 180 uint32_t cycle = (uint32_t)hal_get_cycle(); 181 if( CONFIG_DEBUG_DEV_FBF_RX < cycle ) 182 printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / size %x\n", 183 __FUNCTION__ , this, this->process->pid , buffer , buf_paddr ); 184 #endif 185 188 186 return dev_fbf_access( false , buffer , length , offset ); 187 188 #if CONFIG_DEBUG_DEV_FBF_RX 189 cycle = (uint32_t)hal_get_cycle(); 190 if( CONFIG_DEBUG_DEV_FBF_RX < cycle ) 191 printk("\n[DBG] %s : thread %x exit / process %x / vaddr %x / size %x\n", 192 __FUNCTION__ , this, this->process->pid , buffer , buf_paddr ); 193 #endif 194 189 195 } 190 196 … … 194 200 uint32_t offset ) 195 201 { 202 203 #if CONFIG_DEBUG_DEV_FBF_TX 204 uint32_t cycle = (uint32_t)hal_get_cycle(); 205 if( CONFIG_DEBUG_DEV_FBF_TX < cycle ) 206 printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / size %x\n", 207 __FUNCTION__ , this, this->process->pid , buffer , buf_paddr ); 208 #endif 209 196 210 return dev_fbf_access( true , buffer , length , offset ); 211 212 #if CONFIG_DEBUG_DEV_FBF_RX 213 cycle = (uint32_t)hal_get_cycle(); 214 if( CONFIG_DEBUG_DEV_FBF_RX < cycle ) 215 printk("\n[DBG] %s : thread %x exit / process %x / vaddr %x / size %x\n", 216 __FUNCTION__ , this, this->process->pid , buffer , buf_paddr ); 217 #endif 218 197 219 }
Note: See TracChangeset
for help on using the changeset viewer.