source: trunk/kernel/kern/chdev.c @ 545

Last change on this file since 545 was 545, checked in by nicolas.van.phan@…, 3 years ago

Fix memory access at 0x10 and 0x14

chdev_dir() tried to read chdev_dir.iob to display information
about the IOB, but on TSAR LETI there's no IOB and this pointer
is NULL.

File size: 19.1 KB
Line 
1/*
2 * chdev.c - channel device descriptor operations implementation.
3 *
4 * Authors  Alain Greiner   (2016)
5 *
6 * Copyright (c) UPMC Sorbonne Universites
7 *
8 * This file is part of ALMOS-MKH.
9 *
10 * ALMOS-MKH.is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2.0 of the License.
13 *
14 * ALMOS-MKH.is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include <kernel_config.h>
25#include <hal_kernel_types.h>
26#include <hal_special.h>
27#include <hal_remote.h>
28#include <hal_irqmask.h>
29#include <printk.h>
30#include <boot_info.h>
31#include <xlist.h>
32#include <kmem.h>
33#include <scheduler.h>
34#include <thread.h>
35#include <rpc.h>
36#include <chdev.h>
37#include <devfs.h>
38
39
40extern chdev_directory_t    chdev_dir;   // allocated in kernel_init.c
41
42#if (DEBUG_SYS_READ & 1)
43extern uint32_t enter_chdev_cmd_read;
44extern uint32_t exit_chdev_cmd_read;
45extern uint32_t enter_chdev_server_read;
46extern uint32_t exit_chdev_server_read;
47#endif
48
49#if (DEBUG_SYS_WRITE & 1)
50extern uint32_t enter_chdev_cmd_write;
51extern uint32_t exit_chdev_cmd_write;
52extern uint32_t enter_chdev_server_write;
53extern uint32_t exit_chdev_server_write;
54#endif
55
56////////////////////////////////////////////
57char * chdev_func_str( uint32_t func_type ) 
58{
59  switch ( func_type ) {
60    case DEV_FUNC_RAM: return "RAM";
61    case DEV_FUNC_ROM: return "ROM";
62    case DEV_FUNC_FBF: return "FBF";
63    case DEV_FUNC_IOB: return "IOB";
64    case DEV_FUNC_IOC: return "IOC";
65    case DEV_FUNC_MMC: return "MMC";
66    case DEV_FUNC_DMA: return "DMA";
67    case DEV_FUNC_NIC: return "NIC";
68    case DEV_FUNC_TIM: return "TIM";
69    case DEV_FUNC_TXT: return "TXT";
70    case DEV_FUNC_ICU: return "ICU";
71    case DEV_FUNC_PIC: return "PIC";
72    default:           return "undefined";
73    }
74}
75
76/////////////////////////////////////////
77chdev_t * chdev_create( uint32_t    func,
78                        uint32_t    impl,
79                        uint32_t    channel,
80                        uint32_t    is_rx,
81                        xptr_t      base )
82{
83    chdev_t    * chdev;
84    kmem_req_t   req;
85
86    // allocate memory for chdev
87    req.type   = KMEM_DEVICE;
88    req.flags  = AF_ZERO;
89    chdev      = (chdev_t *)kmem_alloc( &req );
90
91    if( chdev == NULL ) return NULL;
92
93    // initialize waiting threads queue and associated lock
94    remote_spinlock_init( XPTR( local_cxy , &chdev->wait_lock ) );
95    xlist_root_init( XPTR( local_cxy , &chdev->wait_root ) );
96
97    // initialize attributes
98    chdev->func    =  func;
99    chdev->impl    =  impl;
100    chdev->channel =  channel;
101    chdev->is_rx   =  is_rx;
102    chdev->base    =  base; 
103
104    return chdev;
105
106}  // end chdev_create()
107
108///////////////////////////////////
109void chdev_print( chdev_t * chdev )
110{
111    printk("\n - func      = %s"
112           "\n - channel   = %d"
113           "\n - base      = %l"
114           "\n - cmd       = %x"
115           "\n - isr       = %x"
116           "\n - chdev     = %x\n",
117           chdev_func_str(chdev->func),
118           chdev->channel,
119           chdev->base,
120           chdev->cmd,
121           chdev->isr,
122           chdev );
123}
124
125//////////////////////////////////////////////////
126void chdev_register_command( xptr_t     chdev_xp )
127{
128    thread_t * server_ptr;    // local pointer on server thread associated to chdev
129    xptr_t     server_xp;     // extended pointer on server thread
130    core_t   * core_ptr;      // local pointer on core running the server thread
131    uint32_t   server_lid;    // core running the server thread local index
132    xptr_t     lock_xp;       // extended pointer on lock protecting the chdev queue
133    uint32_t   save_sr;       // for critical section
134
135#if (DEBUG_SYS_READ & 1)
136enter_chdev_cmd_read = (uint32_t)hal_get_cycles();
137#endif
138
139#if (DEBUG_SYS_WRITE & 1)
140enter_chdev_cmd_write = (uint32_t)hal_get_cycles();
141#endif
142
143    thread_t * this = CURRENT_THREAD;
144
145    // get chdev cluster and local pointer
146    cxy_t     chdev_cxy = GET_CXY( chdev_xp );
147    chdev_t * chdev_ptr = GET_PTR( chdev_xp );
148
149    // get local and extended pointers on server thread
150    server_ptr = (thread_t *)hal_remote_lpt( XPTR( chdev_cxy , &chdev_ptr->server) );
151    server_xp  = XPTR( chdev_cxy , server_ptr );
152
153    // get local pointer on core running the server thread
154    core_ptr   = (core_t *)hal_remote_lpt( XPTR( chdev_cxy , &server_ptr->core ) );
155
156    // get server core local index
157    server_lid = hal_remote_lw( XPTR( chdev_cxy , &core_ptr->lid ) );
158
159#if (DEBUG_CHDEV_CMD_RX || DEBUG_CHDEV_CMD_TX)
160bool_t is_rx = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->is_rx ) );
161#endif
162   
163#if DEBUG_CHDEV_CMD_RX
164uint32_t rx_cycle = (uint32_t)hal_get_cycles();
165if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
166printk("\n[DBG] %s : client_thread %x (%s) enter for RX / server = %x / cycle %d\n",
167__FUNCTION__, this, thread_type_str(this->type) , server_ptr, rx_cycle );
168#endif
169
170#if DEBUG_CHDEV_CMD_TX
171uint32_t tx_cycle = (uint32_t)hal_get_cycles();
172if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
173printk("\n[DBG] %s : client_thread %x (%s) enter for TX / server = %x / cycle %d\n",
174__FUNCTION__, this, thread_type_str(this->type) , server_ptr, tx_cycle );
175#endif
176
177    // build extended pointer on client thread xlist
178    xptr_t  list_xp    = XPTR( local_cxy , &this->wait_list );
179
180    // build extended pointer on chdev waiting queue root
181    xptr_t  root_xp    = XPTR( chdev_cxy , &chdev_ptr->wait_root );
182
183    // build extended pointer on server thread blocked state
184    xptr_t  blocked_xp = XPTR( chdev_cxy , &server_ptr->blocked );
185
186    // build extended pointer on lock protecting chdev waiting queue
187    lock_xp = XPTR( chdev_cxy , &chdev_ptr->wait_lock );
188
189    // critical section for the following sequence:
190    // (1) take the lock protecting waiting queue
191    // (2) block the client thread
192    // (3) unblock the server thread if required
193    // (4) register client thread in server queue
194    // (5) send IPI to force server scheduling
195    // (6) release the lock protecting waiting queue
196    // (7) deschedule
197    // ... in this order
198
199    // enter critical section
200    hal_disable_irq( &save_sr );
201
202    // take the lock protecting chdev waiting queue
203    remote_spinlock_lock( lock_xp );
204
205    // block current thread
206    thread_block( XPTR( local_cxy , CURRENT_THREAD ) , THREAD_BLOCKED_IO );
207
208#if (DEBUG_CHDEV_CMD_TX & 1)
209if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
210printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this );
211#endif
212
213#if (DEBUG_CHDEV_CMD_RX & 1)
214if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
215printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this );
216#endif
217
218    // unblock server thread if required
219    if( hal_remote_lw( blocked_xp ) & THREAD_BLOCKED_IDLE )
220    thread_unblock( server_xp , THREAD_BLOCKED_IDLE );
221
222#if (DEBUG_CHDEV_CMD_TX & 1)
223if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
224printk("\n[DBG] in %s : TX server thread %x unblocked\n", __FUNCTION__, server_ptr );
225#endif
226
227#if (DEBUG_CHDEV_CMD_RX & 1)
228if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
229printk("\n[DBG] in %s : RX server thread %x unblocked\n", __FUNCTION__, server_ptr );
230#endif
231
232    // register client thread in waiting queue
233    xlist_add_last( root_xp , list_xp );
234
235#if (DEBUG_CHDEV_CMD_TX & 1)
236if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
237printk("\n[DBG] in %s : thread %x registered write request in chdev\n", __FUNCTION__, this );
238#endif
239 
240#if (DEBUG_CHDEV_CMD_RX & 1)
241if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
242printk("\n[DBG] in %s : thread %x registered read request in chdev\n", __FUNCTION__, this );
243#endif
244 
245    // send IPI to core running the server thread when server != client
246    if( (server_lid != this->core->lid) || (local_cxy != chdev_cxy) )
247    {
248        dev_pic_send_ipi( chdev_cxy , server_lid ); 
249
250#if (DEBUG_CHDEV_CMD_TX & 1)
251if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
252printk("\n[DBG] in %s : client thread %x sent IPI to TX server thread %x\n",
253__FUNCTION__, this, server_ptr );
254#endif
255
256#if (DEBUG_CHDEV_CMD_RX & 1)
257if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
258printk("\n[DBG] in %s : client thread %x sent IPI to RX server thread %x\n",
259__FUNCTION__, this, server_ptr );
260#endif
261
262    }
263 
264    // release lock
265    remote_spinlock_unlock( lock_xp );
266
267    // deschedule
268    assert( thread_can_yield() , "illegal sched_yield\n" );
269    sched_yield("blocked on I/O");
270
271    // exit critical section
272    hal_restore_irq( save_sr );
273
274#if DEBUG_CHDEV_CMD_RX
275rx_cycle = (uint32_t)hal_get_cycles();
276if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
277printk("\n[DBG] %s : client_thread %x (%s) exit for RX / cycle %d\n",
278__FUNCTION__, this, thread_type_str(this->type) , rx_cycle );
279#endif
280
281#if DEBUG_CHDEV_CMD_TX
282tx_cycle = (uint32_t)hal_get_cycles();
283if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
284printk("\n[DBG] %s : client_thread %x (%s) exit for TX / cycle %d\n",
285__FUNCTION__, this, thread_type_str(this->type) , tx_cycle );
286#endif
287
288#if (DEBUG_SYS_READ & 1)
289exit_chdev_cmd_read = (uint32_t)hal_get_cycles();
290#endif
291
292#if (DEBUG_SYS_WRITE & 1)
293exit_chdev_cmd_write = (uint32_t)hal_get_cycles();
294#endif
295
296}  // end chdev_register_command()
297
298///////////////////////////////////////////////
299void chdev_sequencial_server( chdev_t * chdev )
300{
301    xptr_t          client_xp;    // extended pointer on waiting thread
302    cxy_t           client_cxy;   // cluster of client thread
303    thread_t      * client_ptr;   // local pointer on client thread
304    thread_t      * server;       // local pointer on server thread
305    xptr_t          root_xp;      // extended pointer on device waiting queue root
306    xptr_t          lock_xp;      // extended pointer on lock ptotecting chdev queue
307
308    server = CURRENT_THREAD;
309
310    // get root and lock on command queue
311    root_xp = XPTR( local_cxy , &chdev->wait_root );
312    lock_xp = XPTR( local_cxy , &chdev->wait_lock );
313
314        // This infinite loop is executed by the DEV thread
315    // to handle commands registered in the chdev queue.
316    while( 1 )
317    {
318        // get the lock protecting the waiting queue
319        remote_spinlock_lock( lock_xp );
320
321        // check waiting queue state
322        if( xlist_is_empty( root_xp ) ) // waiting queue empty
323        {
324            // release lock
325            remote_spinlock_unlock( lock_xp );
326
327            // block
328            thread_block( XPTR( local_cxy , server ) , THREAD_BLOCKED_IDLE ); 
329
330            // deschedule
331            assert( thread_can_yield() , "illegal sched_yield\n" );
332            sched_yield("I/O queue empty");
333        } 
334        else                            // waiting queue not empty
335        {
336            // get extended pointer on first client thread
337            client_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list );
338
339            // get client thread cluster and local pointer
340            client_cxy = GET_CXY( client_xp );
341            client_ptr = GET_PTR( client_xp );
342
343            // remove this first client thread from waiting queue
344            xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
345
346            // release lock
347            remote_spinlock_unlock( lock_xp );
348
349#if DEBUG_CHDEV_SERVER_RX
350uint32_t rx_cycle = (uint32_t)hal_get_cycles();
351if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
352printk("\n[DBG] %s : server_thread %x start RX / client %x / cycle %d\n",
353__FUNCTION__ , server , client_ptr , rx_cycle );
354#endif
355
356#if DEBUG_CHDEV_SERVER_TX
357uint32_t tx_cycle = (uint32_t)hal_get_cycles();
358if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
359printk("\n[DBG] %s : server_thread %x start TX / client %x / cycle %d\n",
360__FUNCTION__ , server , client_ptr , tx_cycle );
361#endif
362
363#if (DEBUG_SYS_READ & 1)
364enter_chdev_server_read = (uint32_t)hal_get_cycles();
365#endif
366
367#if (DEBUG_SYS_WRITE & 1)
368enter_chdev_server_write = (uint32_t)hal_get_cycles();
369#endif
370
371            // call driver command function to execute I/O operation
372            chdev->cmd( client_xp );
373       
374            // unblock client thread
375            thread_unblock( client_xp , THREAD_BLOCKED_IO );
376
377#if DEBUG_CHDEV_SERVER_RX
378rx_cycle = (uint32_t)hal_get_cycles();
379if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
380printk("\n[DBG] %s : server_thread %x completes RX / client %x / cycle %d\n",
381__FUNCTION__ , server , client_ptr , rx_cycle );
382#endif
383
384#if DEBUG_CHDEV_SERVER_TX
385tx_cycle = (uint32_t)hal_get_cycles();
386if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
387printk("\n[DBG] %s : server_thread %x completes TX / client %x / cycle %d\n",
388__FUNCTION__ , server , client_ptr , tx_cycle );
389#endif
390
391#if (DEBUG_SYS_READ & 1)
392exit_chdev_server_read = (uint32_t)hal_get_cycles();
393#endif
394
395#if (DEBUG_SYS_WRITE & 1)
396exit_chdev_server_write = (uint32_t)hal_get_cycles();
397#endif
398
399        }
400    }  // end while
401}  // end chdev_sequencial_server()
402
403////////////////////////////////////////
404xptr_t chdev_from_file( xptr_t file_xp )
405{
406    cxy_t         file_cxy;
407    vfs_file_t  * file_ptr;
408    uint32_t      inode_type;
409    vfs_inode_t * inode_ptr;
410    chdev_t     * chdev_ptr;
411
412    assert( (file_xp != XPTR_NULL) ,
413    "file_xp == XPTR_NULL\n" );
414
415    // get cluster and local pointer on remote file descriptor
416    // associated inode and chdev are stored in same cluster as the file desc.
417    file_cxy  = GET_CXY( file_xp );
418    file_ptr  = (vfs_file_t *)GET_PTR( file_xp );
419
420    // get inode type from file descriptor
421    inode_type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) );
422    inode_ptr  = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
423
424    assert( (inode_type == INODE_TYPE_DEV) ,
425    "inode type %d is not INODE_TYPE_DEV\n", inode_type );
426
427    // get chdev local pointer from inode extension
428    chdev_ptr = (chdev_t *)hal_remote_lpt( XPTR( file_cxy , &inode_ptr->extend ) );
429
430    return XPTR( file_cxy , chdev_ptr );
431
432}  // end chdev_from_file()
433
434////////////////////////
435void chdev_dir_display( void )
436{
437    uint32_t  i;
438    cxy_t     cxy;
439    chdev_t * ptr;
440    uint32_t  base;
441    reg_t     save_sr;
442
443    // get pointers on TXT0 chdev
444    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
445    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
446    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
447
448    // get extended pointer on remote TXT0 chdev lock
449    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
450
451    // get TXT0 lock in busy waiting mode
452    remote_spinlock_lock_busy( lock_xp , &save_sr );
453
454    // header
455    nolock_printk("\n***** external chdevs directory *****\n");
456
457    // IOB
458    if (chdev_dir.iob != NULL )
459    {
460        cxy  = GET_CXY( chdev_dir.iob );
461        ptr  = GET_PTR( chdev_dir.iob );
462        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
463        nolock_printk("  - iob       : cxy = %X / ptr = %X / base = %X\n", cxy, ptr, base);
464    }
465
466    // PIC
467    cxy  = GET_CXY( chdev_dir.pic );
468    ptr  = GET_PTR( chdev_dir.pic );
469    base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
470    nolock_printk("  - pic       : cxy = %X / ptr = %X / base = %X\n", cxy, ptr, base);
471
472    // TXT
473    for( i = 0 ; i < LOCAL_CLUSTER->nb_txt_channels ; i++ )
474    {
475        cxy = GET_CXY( chdev_dir.txt_rx[i] );
476        ptr = GET_PTR( chdev_dir.txt_rx[i] );
477        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
478        nolock_printk("  - txt_rx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
479
480        cxy = GET_CXY( chdev_dir.txt_tx[i] );
481        ptr = GET_PTR( chdev_dir.txt_tx[i] );
482        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
483        nolock_printk("  - txt_tx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
484    }
485
486    // IOC
487    for( i = 0 ; i < LOCAL_CLUSTER->nb_ioc_channels ; i++ )
488    {
489        cxy = GET_CXY( chdev_dir.ioc[i] );
490        ptr = GET_PTR( chdev_dir.ioc[i] );
491        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
492        nolock_printk("  - ioc[%d]    : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
493    }
494
495    // FBF
496    for( i = 0 ; i < LOCAL_CLUSTER->nb_fbf_channels ; i++ )
497    {
498        cxy  = GET_CXY( chdev_dir.fbf[i] );
499        ptr  = GET_PTR( chdev_dir.fbf[i] );
500        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
501        nolock_printk("  - fbf[%d]    : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
502    }
503
504    // NIC
505    for( i = 0 ; i < LOCAL_CLUSTER->nb_nic_channels ; i++ )
506    {
507        cxy = GET_CXY( chdev_dir.nic_rx[i] );
508        ptr = GET_PTR( chdev_dir.nic_rx[i] );
509        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
510        nolock_printk("  - nic_rx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
511
512        cxy = GET_CXY( chdev_dir.nic_tx[i] );
513        ptr = GET_PTR( chdev_dir.nic_tx[i] );
514        base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) );
515        nolock_printk("  - nic_tx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
516    }
517
518    // release lock
519    remote_spinlock_unlock_busy( lock_xp , save_sr );
520
521}  // end chdev_dir_display()
522
523///////////////////////////////////////////
524void chdev_queue_display( xptr_t chdev_xp )
525{
526    cxy_t       chdev_cxy;          // chdev cluster
527    chdev_t   * chdev_ptr;          // chdev local pointer
528    xptr_t      root_xp;            // extended pointer on waiting queuue root
529    char        name[16];           // local copie of chdev name
530    xptr_t      iter_xp;            // extended pointer on xlist_t field in waiting thread
531    xptr_t      thread_xp;          // extended pointer on thread registered in queue
532    cxy_t       thread_cxy;         // cluster identifier for waiting thread
533    thread_t  * thread_ptr;         // local pointer on waiting thread
534    trdid_t     trdid;              // waiting thread identifier
535    process_t * process;            // waiting thread process descriptor
536    pid_t       pid;                // waiting thread process identifier
537
538    // get cluster and local pointer on chdev
539    chdev_cxy = GET_CXY( chdev_xp );
540    chdev_ptr = GET_PTR( chdev_xp );
541
542    // get extended pointer on root of requests queue
543    root_xp = XPTR( chdev_cxy , &chdev_ptr->wait_root );
544
545    // get chdev name
546    hal_remote_strcpy( XPTR( local_cxy , name ), XPTR( chdev_cxy , chdev_ptr->name ) );
547
548    // check queue empty
549    if( xlist_is_empty( root_xp ) )
550    {
551        printk("\n***** Waiting queue empty for chdev %s\n", name ); 
552    }
553    else
554    {
555        printk("\n***** Waiting queue for chdev %s\n", name ); 
556
557        // scan the waiting queue
558        XLIST_FOREACH( root_xp , iter_xp )
559        {
560            thread_xp  = XLIST_ELEMENT( iter_xp , thread_t , wait_list );
561            thread_cxy = GET_CXY( thread_xp );
562            thread_ptr = GET_PTR( thread_xp );
563            trdid      = hal_remote_lw ( XPTR( thread_cxy , &thread_ptr->trdid   ) );
564            process    = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
565                        pid        = hal_remote_lw ( XPTR( thread_cxy , &process->pid        ) );
566
567            printk("- thread %X / cluster %X / trdid %X / pid %X\n",
568            thread_ptr, thread_cxy, trdid, pid );
569        }
570    }
571}  // end chdev_queue_display()
572
Note: See TracBrowser for help on using the repository browser.