Changeset 14 for trunk/kernel/kern/printk.c
- Timestamp:
- May 3, 2017, 1:23:24 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.c
r5 r14 28 28 #include <remote_spinlock.h> 29 29 #include <cluster.h> 30 #include <chdev.h> 30 31 #include <printk.h> 32 33 /////////////////////////////////////////////////////////////////////////////////// 34 // Extern variables 35 /////////////////////////////////////////////////////////////////////////////////// 36 37 extern chdev_t txt0_chdev; // allocated in kernel_init.c 31 38 32 39 /////////////////////////////////////////////////////////////////////////////////// … … 213 220 } // end kernel_printf() 214 221 215 //////////////////////////////// 216 void printk( char * format , ...)222 ///////////////////////////////// 223 void printk( char * format , ...) 217 224 { 218 225 va_list args; 219 220 // call kernel_printf 226 uint32_t save_sr; 227 228 // get extended pointer on remote TXT0 chdev lock 229 xptr_t txt0_lock_xp = XPTR( LOCAL_CLUSTER->io_cxy , &txt0_chdev.wait_lock ); 230 231 // get TXT0 lock in busy waiting mode 232 remote_spinlock_lock_busy( txt0_lock_xp , &save_sr ); 233 234 // call kernel_printf in busy waiting mode 221 235 va_start( args , format ); 222 236 kernel_printf( 0 , 1 , format , &args ); 223 237 va_end( args ); 238 239 // release lock 240 remote_spinlock_unlock_busy( txt0_lock_xp , save_sr ); 224 241 } 225 242 226 ///////////////////////////////////// 227 void user_printk( char * format, ...)243 ////////////////////////////////////// 244 void user_printk( char * format , ...) 228 245 { 229 246 va_list args; … … 232 249 uint32_t channel = 0; 233 250 234 // call kernel_printf251 // call kernel_printf in descheduling mode 235 252 va_start( args , format ); 236 253 kernel_printf( channel, 0 , format , &args );
Note: See TracChangeset
for help on using the changeset viewer.