Ignore:
Timestamp:
Apr 5, 2015, 12:09:09 AM (10 years ago)
Author:
alain
Message:

Move the peripheral initialisation from the boot.c to the kernel_init.c

File:
1 edited

Legend:

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

    r536 r547  
    2222#include <giet_config.h>
    2323#include <mapping_info.h>
     24#include <irq_handler.h>
    2425#include <io.h>
    2526
     
    517518    else
    518519    {
    519         _set_context_slot( CTX_TTY_ID, channel );
    520         return 0;
    521     }
     520    }
     521
     522    // allocate a WTI mailbox to the calling proc if external IRQ
     523    unsigned int unused;
     524    if ( USE_PIC ) _ext_irq_alloc( ISR_TTY_RX , channel , &unused );
     525   
     526    // update calling task index
     527    _set_context_slot( CTX_TTY_ID, channel );
     528
     529    return 0;
    522530}
    523531
     
    700708unsigned int thread  = _get_context_slot( CTX_TRDID_ID );
    701709_printf("\n[GIET DEBUG NIC] Task %d enters sys_nic_alloc() at cycle %d\n"
    702         " nic_channel = %d / cma_channel = %d\n"
     710        "  nic_channel = %d / cma_channel = %d\n",
    703711        thread , _get_proctime() , nic_channel , cma_channel );
    704712#endif
     
    754762
    755763#if GIET_DEBUG_NIC
    756 _printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_start()"
    757         " allocates container in cluster[%d,%d] : vaddr = %x / paddr = %l\n",
     764_printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_alloc()"
     765        " allocates container in cluster[%d,%d]\n"
     766        "  vaddr = %x / paddr = %l\n",
    758767        thread , cx , cy , vaddr , cont_paddr );
    759768#endif
     
    781790
    782791#if GIET_DEBUG_NIC
    783 _printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_start()"
    784         " get NIC chbuf : paddr = %l\n",
     792_printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_alloc() get NIC chbuf : paddr = %l\n",
    785793        thread , nic_chbuf_pbase );
    786794#endif
     
    793801
    794802#if GIET_DEBUG_NIC
    795 _printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_start()"
    796         " get kernel chbuf : vaddr = %x / paddr = %l\n",
     803_printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_alloc() get kernel chbuf\n"
     804        " vaddr = %x / paddr = %l\n",
    797805        thread , vaddr , ker_chbuf_pbase );
    798806#endif
     
    851859#if GIET_DEBUG_NIC
    852860unsigned int thread  = _get_context_slot( CTX_TRDID_ID );
    853 _printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_start() at cycle %d"
    854         " get NIC channel = %d / CMA channel = %d\n",
     861_printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_start() at cycle %d\n"
     862        "  get NIC channel = %d / CMA channel = %d\n",
    855863        thread, _get_proctime(), nic_channel, cma_channel );
    856864#endif
     
    969977
    970978#if GIET_DEBUG_NIC
    971 _printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_move() read buffer descriptor %d\n"
    972         " at cycle = %d / paddr = %l / buffer descriptor = %l\n",
     979_printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_move() read buf_desc %d at cycle %d\n"
     980        " paddr = %l / buffer descriptor = %l\n",
    973981        thread, index, _get_proctime(), buffer_desc_paddr, buffer_descriptor );
    974982#endif
     
    9931001                          NIC_CONTAINER_SIZE );
    9941002#if GIET_DEBUG_NIC
    995 _printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_move() transfer "
    996         "kernel buffer %l to user buffer %l at cycle %d\n",
     1003_printf("\n[GIET DEBUG NIC] Task %d in _sys_nic_move() transfer kernel buffer %l\n"
     1004        " to user buffer %l at cycle %d\n",
    9971005        thread , kernel_buffer_paddr , user_buffer_paddr , _get_proctime() );
    9981006#endif
Note: See TracChangeset for help on using the changeset viewer.