Changeset 625 for trunk/kernel/kern/printk.c
- Timestamp:
- Apr 10, 2019, 10:09:39 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.c
r623 r625 253 253 break; 254 254 } 255 case ('b'): / / excactly 2 digits hexadecimal255 case ('b'): /* exactly 2 digits hexadecimal */ 256 256 { 257 257 int val = va_arg( *args, int ); … … 426 426 427 427 // print generic infos 428 nolock_printk("\n [PANIC] in %s: line %d | cycle %d\n"428 nolock_printk("\n\n[PANIC] in %s: line %d | cycle %d\n" 429 429 "core[%x,%d] | thread %x (%x) | process %x (%x)\n", 430 430 function_name, line, (uint32_t)cycle, … … 502 502 remote_busylock_acquire( lock_xp ); 503 503 504 // display stringon TTY0504 // display buf on TTY0 505 505 dev_txt_sync_write( buf , 10 ); 506 507 // release TXT0 lock 508 remote_busylock_release( lock_xp ); 509 } 510 511 //////////////////////// 512 void putd( int32_t val ) 513 { 514 static const char HexaTab[] = "0123456789ABCDEF"; 515 516 char buf[10]; 517 uint32_t i; 518 519 // get pointers on TXT0 chdev 520 xptr_t txt0_xp = chdev_dir.txt_tx[0]; 521 cxy_t txt0_cxy = GET_CXY( txt0_xp ); 522 chdev_t * txt0_ptr = GET_PTR( txt0_xp ); 523 524 // get extended pointer on remote TXT0 chdev lock 525 xptr_t lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock ); 526 527 // get TXT0 lock 528 remote_busylock_acquire( lock_xp ); 529 530 if (val < 0) 531 { 532 val = -val; 533 dev_txt_sync_write( "-" , 1 ); 534 } 535 536 for(i = 0; i < 10 ; i++) 537 { 538 buf[9 - i] = HexaTab[val % 10]; 539 if (!(val /= 10)) break; 540 } 541 542 // display buf on TTY0 543 dev_txt_sync_write( &buf[9-i] , i+1 ); 506 544 507 545 // release TXT0 lock
Note: See TracChangeset
for help on using the changeset viewer.