Changeset 754 for soft/giet_vm


Ignore:
Timestamp:
Jan 7, 2016, 4:12:54 PM (9 years ago)
Author:
cfuguet
Message:
  • Support to have a single terminal (NB_TTY_CHANNEL = 1). In this case, the terminal is shared by the system and the applications.
  • Support platforms without NIC and CMA.
  • In the MMC driver, do not initialize the distributed driver structure in clusters without memory cache (IO clusters in the LETI platform).
Location:
soft/giet_vm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_common/kernel_malloc.h

    r594 r754  
    5353extern void _heap_init();
    5454
     55extern unsigned int _get_heap_info( unsigned int* heap_base,
     56                             unsigned int* heap_size,
     57                             unsigned int  x,
     58                             unsigned int  y );
     59
    5560
    5661#endif
  • soft/giet_vm/giet_drivers/mmc_driver.c

    r630 r754  
    1010#include <tty0.h>
    1111#include <kernel_locks.h>
     12#include <kernel_malloc.h>
    1213#include <utils.h>
    1314
     
    8081            else
    8182            {
     83                // get heap_base & heap size
     84                unsigned int heap_base;
     85                unsigned int heap_size;
     86                if ( _get_heap_info( &heap_base, &heap_size, x, y ) ) continue;
     87
    8288                _mmc_distributed_lock[x][y] = _remote_malloc( sizeof(spin_lock_t), x, y );
    8389                _spin_lock_init( _mmc_distributed_lock[x][y] );
  • soft/giet_vm/giet_drivers/rdk_driver.c

    r529 r754  
    2626#if USE_IOC_RDK
    2727
    28 #if GIET_DEBUG_IOC_DRIVER
     28#if GIET_DEBUG_IOC
    2929unsigned int procid  = _get_procid();
    3030unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     
    3737
    3838    char* rdk = (char*)SEG_RDK_BASE + (512*lba);
    39     char* buf = (char*)buf_paddr;
     39    char* buf = (char*)buf_vaddr;
    4040
    4141    if ( to_mem ) memcpy( buf, rdk, count*512 );
  • soft/giet_vm/giet_kernel/sys_handler.c

    r753 r754  
    194194    &_sys_fbf_size,                  /* 0x08 */
    195195    &_sys_fbf_alloc,                 /* 0x09 */
     196
     197#if NB_CMA_CHANNELS
    196198    &_sys_fbf_cma_alloc,             /* 0x0A */
    197199    &_sys_fbf_cma_init_buf,          /* 0x0B */
     
    200202    &_sys_fbf_cma_stop,              /* 0x0E */
    201203    &_sys_fbf_cma_check,             /* 0x0F */
     204#else
     205    &_sys_ukn,                       /* 0x0A */
     206    &_sys_ukn,                       /* 0x0B */
     207    &_sys_ukn,                       /* 0x0C */
     208    &_sys_ukn,                       /* 0x0D */
     209    &_sys_ukn,                       /* 0x0E */
     210    &_sys_ukn,                       /* 0x0F */
     211#endif
    202212
    203213    &_sys_applications_status,       /* 0x10 */
     
    235245    &_sys_ukn,                       /* 0x2F */
    236246
     247#if NB_NIC_CHANNELS
    237248    &_sys_nic_alloc,                 /* 0x30 */
    238249    &_sys_nic_start,                 /* 0x31 */
     
    241252    &_sys_nic_stats,                 /* 0x34 */
    242253    &_sys_nic_clear,                 /* 0x35 */
     254#else
     255    &_sys_ukn,                       /* 0x30 */
     256    &_sys_ukn,                       /* 0x31 */
     257    &_sys_ukn,                       /* 0x32 */
     258    &_sys_ukn,                       /* 0x33 */
     259    &_sys_ukn,                       /* 0x34 */
     260    &_sys_ukn,                       /* 0x35 */
     261#endif
     262
    243263    &_sys_tty_write,                 /* 0x36 */
    244264    &_sys_tty_read,                  /* 0x37 */
     
    15401560int _sys_tty_alloc( unsigned int shared )
    15411561{
    1542     unsigned int channel;    // allocated TTY channel
    1543 
    1544     // get trdid and vsid for the calling thread
     1562    unsigned int channel = 0;    // allocated TTY channel
     1563
     1564    // get vsid for the calling thread
    15451565    unsigned int vsid  = _get_context_slot( CTX_VSID_ID );
    1546     unsigned int trdid = _get_thread_trdid();
    15471566
    15481567    mapping_header_t  *header   = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
     
    15551574    else           users = 1;
    15561575
     1576#if NB_TTY_CHANNELS > 1
     1577    // get trdid for the calling thread
     1578    unsigned int trdid = _get_thread_trdid();
     1579
    15571580    // get a TTY channel
    15581581    for ( channel = 0 ; channel < NB_TTY_CHANNELS ; channel++ )
     
    15621585        if ( _atomic_test_and_set( palloc , users ) == 0 ) break;
    15631586    }
    1564     if ( channel >= NB_TTY_CHANNELS )
     1587    if ( ( channel >= NB_TTY_CHANNELS ) )
    15651588    {
    15661589        _printf("\n[GIET_ERROR] in _sys_tty_alloc() : "
     
    15821605    unsigned int p      = procid & ((1<<P_WIDTH)-1);
    15831606    _tty_channel_wti[channel] = x<<24 | y<<16 | p<<8 | wti_id;
     1607
     1608#else
     1609
     1610    unsigned int* palloc  = &_tty_channel_alloc[0];
     1611    _atomic_increment( palloc, users );
     1612
     1613#endif
    15841614   
    15851615    // update CTX_TTY_ID
     
    19051935#define NIC_CONTAINER_SIZE 4096
    19061936
    1907 #if NB_NIC_CHANNELS
     1937#if NB_NIC_CHANNELS && NB_CMA_CHANNELS
    19081938
    19091939////////////////////////////////////////
     
    26842714}  // end _sys_nic_stats()
    26852715
    2686 #endif
     2716#endif // if NB_NIC_CHANNELS && NB_CMA_CHANNELS
    26872717
    26882718/////////////////////////////////////////////////////////////////////////////////////////
     
    28172847}
    28182848
     2849#if NB_CMA_CHANNELS
     2850
    28192851////////////////////////////////////////////
    28202852int _sys_fbf_cma_alloc( unsigned int nbufs )
     
    32943326
    32953327} // end _sys_fbf_cma_stop()
     3328
     3329#endif // if NB_CMA_CHANNELS
    32963330
    32973331
Note: See TracChangeset for help on using the changeset viewer.