Changeset 447


Ignore:
Timestamp:
Jun 19, 2018, 10:05:52 PM (3 years ago)
Author:
alain
Message:

Introduce the chdev_queue_display() function.

Location:
trunk/kernel
Files:
3 edited

Legend:

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

    r446 r447  
    2525#include <hal_types.h>
    2626#include <hal_special.h>
     27#include <hal_remote.h>
    2728#include <hal_irqmask.h>
    2829#include <printk.h>
     
    471472}  // end chdev_dir_display()
    472473
     474///////////////////////////////////////////
     475void chdev_queue_display( xptr_t chdev_xp )
     476{
     477    cxy_t       chdev_cxy;          // chdev cluster
     478    chdev_t   * chdev_ptr;          // chdev local pointer
     479    xptr_t      root_xp;            // extended pointer on waiting queuue root
     480    char        name[16];           // local copie of chdev name
     481    xptr_t      iter_xp;            // extended pointer on xlist_t field in waiting thread
     482    xptr_t      thread_xp;          // extended pointer on thread registered in queue
     483    cxy_t       thread_cxy;         // cluster identifier for waiting thread
     484    thread_t  * thread_ptr;         // local pointer on waiting thread
     485    trdid_t     trdid;              // waiting thread identifier
     486    process_t * process;            // waiting thread process descriptor
     487    pid_t       pid;                // waiting thread process identifier
     488
     489    // get cluster and local pointer on chdev
     490    chdev_cxy = GET_CXY( chdev_xp );
     491    chdev_ptr = GET_PTR( chdev_xp );
     492
     493    // get extended pointer on root of requests queue
     494    root_xp = hal_remote_lwd( XPTR( chdev_cxy , &chdev_ptr->wait_root ) );
     495
     496    // get chdev name
     497    hal_remote_strcpy( XPTR( local_cxy , name ), XPTR( chdev_cxy , chdev_ptr->name ) );
     498
     499    // check queue empty
     500    if( xlist_is_empty( root_xp ) )
     501    {
     502        printk("\n***** Waiting queue empty for chdev %s\n", name );
     503    }
     504    else
     505    {
     506        printk("\n***** Waiting queue for chdev %s\n", name );
     507
     508        // scan the waiting queue
     509        XLIST_FOREACH( root_xp , iter_xp )
     510        {
     511            thread_xp  = XLIST_ELEMENT( iter_xp , thread_t , wait_list );
     512            thread_cxy = GET_CXY( thread_xp );
     513            thread_ptr = GET_PTR( thread_xp );
     514            trdid      = hal_remote_lw ( XPTR( thread_cxy , &thread_ptr->trdid   ) );
     515            process    = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
     516                        pid        = hal_remote_lw ( XPTR( thread_cxy , &process->pid        ) );
     517
     518            printk("- trdid %X / pid %X\n", trdid, pid );
     519        }
     520    }
     521}  // end chdev_queue_display()
     522
  • trunk/kernel/kern/chdev.h

    r440 r447  
    254254void chdev_dir_display();
    255255
     256/******************************************************************************************
     257 * This function displays the list of threads registered in the queue associated
     258 * to the chdev identified by the <chdev_xp>.
     259 ******************************************************************************************
     260 * # root_xp  : extended pointer
     261 *****************************************************************************************/
     262void chdev_queue_display( xptr_t chdev_xp );
     263
    256264#endif  /* _CHDEV_H_ */
  • trunk/kernel/kernel_config.h

    r446 r447  
    128128#define DEBUG_SYS_GET_CONFIG           0
    129129#define DEBUG_SYS_ISATTY               0
    130 #define DEBUG_SYS_KILL                 1
     130#define DEBUG_SYS_KILL                 0
    131131#define DEBUG_SYS_MMAP                 0
    132132#define DEBUG_SYS_READ                 2
     
    154154#define DEBUG_THREAD_USER_CREATE       0
    155155#define DEBUG_THREAD_USER_FORK         0
    156 #define DEBUG_THREAD_BLOCK             15000001
     156#define DEBUG_THREAD_BLOCK             0
    157157
    158158#define DEBUG_VFS_INODE_CREATE         0
Note: See TracChangeset for help on using the changeset viewer.