Ignore:
Timestamp:
Dec 5, 2017, 4:20:07 PM (6 years ago)
Author:
alain
Message:

Fix several bugs in the fork() syscall.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_nic.c

    r407 r408  
    7979    nic->server = new_thread;
    8080   
    81     // start server thread
    82     thread_block( new_thread , THREAD_BLOCKED_DEV_QUEUE );
     81    // set "chdev" field in thread descriptor
     82    new_thread->chdev = nic;
     83
     84    // unblock server thread
    8385    thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
    8486
     
    101103
    102104    // get pointer on NIC-RX chdev descriptor
    103     uint32_t   channel = thread_ptr->dev_channel;
     105    uint32_t   channel = thread_ptr->chdev->channel;
    104106    xptr_t     dev_xp  = chdev_dir.nic_rx[channel];
    105107    cxy_t      dev_cxy = GET_CXY( dev_xp );
     
    129131        // block on THREAD_BLOCKED_IO condition and deschedule
    130132        thread_block( thread_ptr , THREAD_BLOCKED_IO );
    131         sched_yield();
     133        sched_yield("client blocked on I/O");
    132134
    133135        // disable NIC-RX IRQ
     
    171173
    172174    // get pointer on NIC-TX chdev descriptor
    173     uint32_t   channel = thread_ptr->dev_channel;
     175    uint32_t   channel = thread_ptr->chdev->channel;
    174176    xptr_t     dev_xp  = chdev_dir.nic_tx[channel];
    175177    cxy_t      dev_cxy = GET_CXY( dev_xp );
     
    199201        // block on THREAD_BLOCKED I/O condition and deschedule
    200202        thread_block( thread_ptr , THREAD_BLOCKED_IO );
    201         sched_yield();
     203        sched_yield("client blocked on I/O");
    202204
    203205        // disable NIC-TX IRQ
Note: See TracChangeset for help on using the changeset viewer.