Ignore:
Timestamp:
Aug 2, 2018, 11:47:13 AM (6 years ago)
Author:
alain
Message:

This version modifies the exec syscall and fixes a large number of small bugs.
The version number has been updated (0.1)

File:
1 edited

Legend:

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

    r450 r457  
    2323
    2424#include <kernel_config.h>
    25 #include <hal_types.h>
     25#include <hal_kernel_types.h>
    2626#include <hal_special.h>
    2727#include <hal_remote.h>
     
    127127    xptr_t     server_xp;     // extended pointer on server thread
    128128    core_t   * core_ptr;      // local pointer on core running the server thread
    129     uint32_t   lid;           // core running the server thread local index
     129    uint32_t   server_lid;    // core running the server thread local index
    130130    xptr_t     lock_xp;       // extended pointer on lock protecting the chdev queue
    131     uint32_t   different;     // non zero if server thread core != client thread core
    132131    uint32_t   save_sr;       // for critical section
    133132
     
    154153
    155154    // get server core local index
    156     lid = hal_remote_lw( XPTR( chdev_cxy , &core_ptr->lid ) );
     155    server_lid = hal_remote_lw( XPTR( chdev_cxy , &core_ptr->lid ) );
    157156
    158157#if (DEBUG_CHDEV_CMD_RX || DEBUG_CHDEV_CMD_TX)
     
    210209#endif
    211210
     211#if (DEBUG_CHDEV_CMD_RX & 1)
     212if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
     213printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this );
     214#endif
     215
    212216    // unblock server thread if required
    213217    if( hal_remote_lw( blocked_xp ) & THREAD_BLOCKED_IDLE )
     
    216220#if (DEBUG_CHDEV_CMD_TX & 1)
    217221if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    218 {
    219 printk("\n[DBG] in %s : server thread %x unblocked\n", __FUNCTION__, server_ptr );
    220 chdev_queue_display( chdev_xp );
    221 }
     222printk("\n[DBG] in %s : TX server thread %x unblocked\n", __FUNCTION__, server_ptr );
     223#endif
     224
     225#if (DEBUG_CHDEV_CMD_RX & 1)
     226if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
     227printk("\n[DBG] in %s : RX server thread %x unblocked\n", __FUNCTION__, server_ptr );
    222228#endif
    223229
     
    227233#if (DEBUG_CHDEV_CMD_TX & 1)
    228234if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    229 {
    230235printk("\n[DBG] in %s : thread %x registered write request in chdev\n", __FUNCTION__, this );
    231 chdev_queue_display( chdev_xp );
    232 }
     236#endif
     237 
     238#if (DEBUG_CHDEV_CMD_RX & 1)
     239if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
     240printk("\n[DBG] in %s : thread %x registered read request in chdev\n", __FUNCTION__, this );
    233241#endif
    234242 
    235243    // send IPI to core running the server thread when server != client
    236     different = (lid != this->core->lid) || (local_cxy != chdev_cxy);
    237     if( different )
    238     {
    239         dev_pic_send_ipi( chdev_cxy , lid );
    240    
     244    if( (server_lid != this->core->lid) || (local_cxy != chdev_cxy) )
     245    {
     246        dev_pic_send_ipi( chdev_cxy , server_lid );
     247
    241248#if (DEBUG_CHDEV_CMD_TX & 1)
    242249if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    243 printk("\n[DBG] in %s : client thread %x sent IPI to server thread %x\n",
     250printk("\n[DBG] in %s : client thread %x sent IPI to TX server thread %x\n",
     251__FUNCTION__, this, server_ptr );
     252#endif
     253
     254#if (DEBUG_CHDEV_CMD_RX & 1)
     255if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
     256printk("\n[DBG] in %s : client thread %x sent IPI to RX server thread %x\n",
    244257__FUNCTION__, this, server_ptr );
    245258#endif
Note: See TracChangeset for help on using the changeset viewer.