Ignore:
Timestamp:
Jul 12, 2017, 8:12:41 PM (7 years ago)
Author:
alain
Message:

Redefine the PIC device API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/printk.c

    r103 r188  
    3535///////////////////////////////////////////////////////////////////////////////////
    3636
    37 extern chdev_t            txt0_chdev;        // allocated in kernel_init.c
     37extern chdev_directory_t  chdev_dir;  // defined in chdev.h / allocated in kernel_init.c
    3838
    3939/////////////////////////////////////
     
    369369    uint32_t      save_sr;
    370370
     371    // get pointers on TXT0 chdev
     372    xptr_t    txt0_xp  = chdev_dir.txt[0];
     373    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
     374    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
     375
    371376    // get extended pointer on remote TXT0 chdev lock
    372     xptr_t  txt0_lock_xp = XPTR( LOCAL_CLUSTER->io_cxy , &txt0_chdev.wait_lock );
     377    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
    373378
    374379    // get TXT0 lock in busy waiting mode
    375     remote_spinlock_lock_busy( txt0_lock_xp , &save_sr );
     380    remote_spinlock_lock_busy( lock_xp , &save_sr );
    376381
    377382    // call kernel_printf on TXT0, in busy waiting mode
     
    381386
    382387    // release lock
    383     remote_spinlock_unlock_busy( txt0_lock_xp , save_sr );
     388    remote_spinlock_unlock_busy( lock_xp , save_sr );
    384389}
    385390
     
    406411    }
    407412}
     413
     414//////////////////////////////////////////////////
     415inline void nolock_assert( bool_t       condition,
     416                           const char * function_name,
     417                           char       * string )
     418{
     419    if( condition == false )
     420    {
     421        nolock_printk("\n[PANIC] in %s : %s\n" , function_name , string );
     422        hal_core_sleep();
     423    }
     424}
     425
    408426
    409427
Note: See TracChangeset for help on using the changeset viewer.