Ignore:
Timestamp:
Jan 8, 2015, 12:00:41 PM (10 years ago)
Author:
alain
Message:

Introducing an explicit (channel) argument in all kernel access functions to NIC.

Location:
soft/giet_vm/giet_kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/sys_handler.c

    r478 r489  
    386386
    387387////////////////////////////////////////
    388 int _sys_nic_start( unsigned int is_rx )
     388int _sys_nic_start( unsigned int is_rx,
     389                    unsigned int channel )
    389390{
    390391
     
    416417#endif
    417418
    418     if ( nic_channel >= NB_NIC_CHANNELS )
    419     {
    420         _printf("\n[GIET_ERROR] in _sys_nic_start(): NIC channel not allocated\n");
     419    if ( nic_channel != channel )
     420    {
     421        _printf("\n[GIET_ERROR] in _sys_nic_start(): illegal NIC channel\n");
    421422        return -1;
    422423    }
    423424    if ( cma_channel >= NB_CMA_CHANNELS )
    424425    {
    425         _printf("\n[GIET_ERROR] in _sys_nic_start(): CMA channel not allocated\n");
     426        _printf("\n[GIET_ERROR] in _sys_nic_start(): illegal CMA channel\n");
    426427        return -1;
    427428    }
     
    474475    unsigned int offset;
    475476    if ( is_rx ) offset = 0x4000;
    476     else         offset = 0x4010;
     477    else         offset = 0x4080;
    477478    nic_chbuf_pbase = (((unsigned long long)((X_IO << Y_WIDTH) + Y_IO))<<32) |
    478479                      (SEG_NIC_BASE + (nic_channel<<15) + offset);
     
    683684
    684685////////////////////////////////////////
    685 int _sys_nic_stop( unsigned int is_rx )
     686int _sys_nic_stop( unsigned int is_rx,
     687                   unsigned int channel )
    686688{
    687689    unsigned int nic_channel;
     
    700702    }
    701703
    702     if ( nic_channel >= NB_NIC_CHANNELS )
    703     {
    704         _printf("\n[GIET_ERROR] in _sys_nic_start(): NIC channel not allocated\n");
     704    if ( nic_channel != channel )
     705    {
     706        _printf("\n[GIET_ERROR] in _sys_nic_stop(): illegal NIC channel\n"
     707                "  allocated channel = %d / requested channel = %d\n",
     708                   nic_channel , channel );
    705709        return -1;
    706710    }
    707711    if ( cma_channel >= NB_CMA_CHANNELS )
    708712    {
    709         _printf("\n[GIET_ERROR] in _sys_nic_start(): CMA channel not allocated\n");
     713        _printf("\n[GIET_ERROR] in _sys_nic_stop(): illegal CMA channel\n");
    710714        return -1;
    711715    }
     
    721725
    722726////////////////////////////////////////
    723 int _sys_nic_clear( unsigned int is_rx )
     727int _sys_nic_clear( unsigned int is_rx,
     728                    unsigned int channel )
    724729{
    725730    unsigned int nic_channel;
     
    729734    else          nic_channel = _get_context_slot( CTX_NIC_TX_ID );
    730735
    731     if ( nic_channel >= NB_NIC_CHANNELS )
    732     {
    733         _printf("\n[GIET_ERROR] in _sys_nic_start(): NIC channel not allocated\n");
     736    if ( nic_channel != channel )
     737    {
     738        _printf("\n[GIET_ERROR] in _sys_nic_clear(): illegal NIC channel\n");
    734739        return -1;
    735740    }
     
    761766
    762767////////////////////////////////////////
    763 int _sys_nic_stats( unsigned int is_rx )
     768int _sys_nic_stats( unsigned int is_rx,
     769                    unsigned int channel )
    764770{
    765771    unsigned int nic_channel;
     
    769775    else          nic_channel = _get_context_slot( CTX_NIC_TX_ID );
    770776
    771     if ( nic_channel >= NB_NIC_CHANNELS )
    772     {
    773         _printf("\n[GIET_ERROR] in _sys_nic_start(): NIC channel not allocated\n");
     777    if ( nic_channel != channel )
     778    {
     779        _printf("\n[GIET_ERROR] in _sys_nic_stats(): illegal NIC channel\n");
    774780        return -1;
    775781    }
  • soft/giet_vm/giet_kernel/sys_handler.h

    r478 r489  
    106106int _sys_nic_alloc( unsigned int is_rx );
    107107
    108 int _sys_nic_start( unsigned int is_rx );
     108int _sys_nic_start( unsigned int is_rx,
     109                    unsigned int channel );
    109110
    110111int _sys_nic_move( unsigned int is_rx,
    111                    unsigned int nic_channel,
     112                   unsigned int channel,
    112113                   void*        buffer );
    113114
    114 int _sys_nic_stop( unsigned int is_rx );
     115int _sys_nic_stop( unsigned int is_rx,
     116                   unsigned int channel );
    115117
    116 int _sys_nic_clear( unsigned int is_rx );
     118int _sys_nic_clear( unsigned int is_rx,
     119                    unsigned int channel );
    117120
    118 int _sys_nic_stats( unsigned int is_rx );
     121int _sys_nic_stats( unsigned int is_rx,
     122                    unsigned int channel );
    119123
    120124//////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.