Changeset 658 for trunk/hal/tsar_mips32/core
- Timestamp:
- Oct 10, 2020, 3:48:50 PM (4 years ago)
- Location:
- trunk/hal/tsar_mips32/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_gpt.c
r647 r658 1187 1187 1188 1188 1189 1190 1191 -
trunk/hal/tsar_mips32/core/hal_special.c
r625 r658 292 292 } 293 293 294 -
trunk/hal/tsar_mips32/core/hal_uspace.c
r657 r658 31 31 32 32 /////////////////////////////////////////////////////////////////////////////////////// 33 // This function moves <size> bytes from a source buffer in user virtual space, 34 // defined by the <u_src_ptr> argument, to a destination kernel buffer, defined by the 35 // <k_dst_xp> argument. 33 // Implementation note 36 34 // It works in a critical section, as it modifies two CP2 registers: 37 35 // It activates briefly the DATA_MMU by writing into the CP2_MODE register to access the … … 41 39 // If the buffers are not aligned, it moves all data byte per byte. 42 40 /////////////////////////////////////////////////////////////////////////////////////// 43 // @ k_dst_xp : extended pointer on destination kernel buffer44 // @ u_src_ptr : pointer on source user buffer45 // @ size : number of bytes to move46 ///////////////////////////////////////////////////////////////////////////////////////47 41 void hal_copy_from_uspace( xptr_t k_dst_xp, 48 42 void * u_src_ptr, … … 55 49 uint32_t cxy = (uint32_t)GET_CXY( k_dst_xp ); 56 50 51 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 52 57 53 #if DEBUG_HAL_USPACE 58 54 thread_t * this = CURRENT_THREAD; … … 133 129 134 130 /////////////////////////////////////////////////////////////////////////////////////// 135 // This function moves <size> bytes from a source kernel buffer, defined by the 136 // <k_src_xp> argument, to a destination buffer in user virtual space, defined by 137 // the <u_dst_ptr> argument. 131 // Implementation note 138 132 // It works in a critical section, as it modifies two CP2 registers: 139 133 // It activates briefly the DATA_MMU by writing into the CP2_MODE register to access the … … 143 137 // If the buffers are not word aligned, it moves all data byte per byte. 144 138 /////////////////////////////////////////////////////////////////////////////////////// 145 // @ u_dst_ptr : pointer on destination user buffer146 // @ k_src_xp : extended pointer on source kernel buffer147 // @ size : number of bytes to move148 ///////////////////////////////////////////////////////////////////////////////////////149 139 void hal_copy_to_uspace( void * u_dst_ptr, 150 140 xptr_t k_src_xp, … … 156 146 uint32_t src = (uint32_t)GET_PTR( k_src_xp ); 157 147 uint32_t cxy = (uint32_t)GET_CXY( k_src_xp ); 148 149 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 158 150 159 151 #if DEBUG_HAL_USPACE … … 244 236 uint32_t cxy = (uint32_t)GET_CXY( k_dst_xp ); 245 237 238 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 239 246 240 hal_disable_irq( &save_sr ); 247 241 … … 297 291 uint32_t cxy = (uint32_t)GET_CXY( k_src_xp ); 298 292 293 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 294 299 295 hal_disable_irq( &save_sr ); 300 296 … … 346 342 uint32_t count = 0; 347 343 uint32_t str = (uint32_t)u_str; 344 345 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 348 346 349 347 hal_disable_irq( &save_sr );
Note: See TracChangeset
for help on using the changeset viewer.