Changeset 489 for soft/giet_vm/giet_kernel
- Timestamp:
- Jan 8, 2015, 12:00:41 PM (10 years ago)
- Location:
- soft/giet_vm/giet_kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.c
r478 r489 386 386 387 387 //////////////////////////////////////// 388 int _sys_nic_start( unsigned int is_rx ) 388 int _sys_nic_start( unsigned int is_rx, 389 unsigned int channel ) 389 390 { 390 391 … … 416 417 #endif 417 418 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"); 421 422 return -1; 422 423 } 423 424 if ( cma_channel >= NB_CMA_CHANNELS ) 424 425 { 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"); 426 427 return -1; 427 428 } … … 474 475 unsigned int offset; 475 476 if ( is_rx ) offset = 0x4000; 476 else offset = 0x40 10;477 else offset = 0x4080; 477 478 nic_chbuf_pbase = (((unsigned long long)((X_IO << Y_WIDTH) + Y_IO))<<32) | 478 479 (SEG_NIC_BASE + (nic_channel<<15) + offset); … … 683 684 684 685 //////////////////////////////////////// 685 int _sys_nic_stop( unsigned int is_rx ) 686 int _sys_nic_stop( unsigned int is_rx, 687 unsigned int channel ) 686 688 { 687 689 unsigned int nic_channel; … … 700 702 } 701 703 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 ); 705 709 return -1; 706 710 } 707 711 if ( cma_channel >= NB_CMA_CHANNELS ) 708 712 { 709 _printf("\n[GIET_ERROR] in _sys_nic_st art(): CMA channel not allocated\n");713 _printf("\n[GIET_ERROR] in _sys_nic_stop(): illegal CMA channel\n"); 710 714 return -1; 711 715 } … … 721 725 722 726 //////////////////////////////////////// 723 int _sys_nic_clear( unsigned int is_rx ) 727 int _sys_nic_clear( unsigned int is_rx, 728 unsigned int channel ) 724 729 { 725 730 unsigned int nic_channel; … … 729 734 else nic_channel = _get_context_slot( CTX_NIC_TX_ID ); 730 735 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"); 734 739 return -1; 735 740 } … … 761 766 762 767 //////////////////////////////////////// 763 int _sys_nic_stats( unsigned int is_rx ) 768 int _sys_nic_stats( unsigned int is_rx, 769 unsigned int channel ) 764 770 { 765 771 unsigned int nic_channel; … … 769 775 else nic_channel = _get_context_slot( CTX_NIC_TX_ID ); 770 776 771 if ( nic_channel >= NB_NIC_CHANNELS)772 { 773 _printf("\n[GIET_ERROR] in _sys_nic_sta rt(): NIC channel not allocated\n");777 if ( nic_channel != channel ) 778 { 779 _printf("\n[GIET_ERROR] in _sys_nic_stats(): illegal NIC channel\n"); 774 780 return -1; 775 781 } -
soft/giet_vm/giet_kernel/sys_handler.h
r478 r489 106 106 int _sys_nic_alloc( unsigned int is_rx ); 107 107 108 int _sys_nic_start( unsigned int is_rx ); 108 int _sys_nic_start( unsigned int is_rx, 109 unsigned int channel ); 109 110 110 111 int _sys_nic_move( unsigned int is_rx, 111 unsigned int nic_channel,112 unsigned int channel, 112 113 void* buffer ); 113 114 114 int _sys_nic_stop( unsigned int is_rx ); 115 int _sys_nic_stop( unsigned int is_rx, 116 unsigned int channel ); 115 117 116 int _sys_nic_clear( unsigned int is_rx ); 118 int _sys_nic_clear( unsigned int is_rx, 119 unsigned int channel ); 117 120 118 int _sys_nic_stats( unsigned int is_rx ); 121 int _sys_nic_stats( unsigned int is_rx, 122 unsigned int channel ); 119 123 120 124 //////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.