Changeset 237 for soft/giet_vm/sys


Ignore:
Timestamp:
May 2, 2013, 6:38:04 PM (12 years ago)
Author:
meunier
Message:

Adding a syscall to allow a user to know the block size with which the block device has been configured.

Location:
soft/giet_vm/sys
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/drivers.c

    r232 r237  
    220220//unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id) {
    221221//    // parameters checking
    222 //    if ( cluster_id >= NB_CLUSTERS)    return 1;
    223 //    if ( local_id >= NB_TIMERS_MAX ) return 2;
     222//    if (cluster_id >= NB_CLUSTERS) {
     223//        return 1;
     224//    }
     225//    if (local_id >= NB_TIMERS_MAX) {
     226//        return 2;
     227//    }
    224228//
    225229//#if USE_XICU
     
    227231//#else
    228232//    unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base + (cluster_id * CLUSTER_SIZE));
    229 //
    230 //    timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 1;
     233//    unsigned int timer_period = timer_address[local_id * TIMER_SPAN + TIMER_PERIOD];
     234//
     235//    timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = timer_period;
    231236//#endif
    232237//
     
    770775    *status = ioc_address[BLOCK_DEVICE_STATUS]; // read status & reset IRQ
    771776    return 0;
     777}
     778
     779
     780///////////////////////////////////////////////////////////////////////////////
     781//     _ioc_get_block_size()
     782// This function returns the block_size with which the IOC has been configured.
     783///////////////////////////////////////////////////////////////////////////////
     784unsigned int _ioc_get_block_size() {
     785    // get IOC base address
     786    unsigned int * ioc_address = (unsigned int *) &seg_ioc_base;
     787   
     788    return  ioc_address[BLOCK_DEVICE_BLOCK_SIZE];
    772789}
    773790
     
    905922
    906923    // get page table address
    907     unsigned int user_ptab = _get_context_slot( task_id, CTX_PTAB_ID);
     924    unsigned int user_ptab = _get_context_slot(task_id, CTX_PTAB_ID);
    908925
    909926    // get peripheral buffer virtual address
    910     if ( dev_type) {
     927    if (dev_type) {
    911928        device_vaddr = (unsigned int) &seg_nic_base + offset;
    912929    }
     
    926943
    927944    // Compute user buffer physical address
    928     ko = _v2p_translate( (page_table_t*)user_ptab, (user_vaddr >> 12), &ppn, &flags);
     945    ko = _v2p_translate((page_table_t*) user_ptab, (user_vaddr >> 12), &ppn, &flags);
    929946    if (ko) {
    930947        _get_lock(&_tty_put_lock);
  • soft/giet_vm/sys/drivers.h

    r232 r237  
    1919unsigned int _timer_stop(unsigned int cluster_id, unsigned int local_id);
    2020unsigned int _timer_reset_irq(unsigned int cluster_id, unsigned int local_id);
    21 unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id);
     21//unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id);
    2222
    2323
     
    6060unsigned int _ioc_completed();
    6161unsigned int _ioc_get_status(unsigned int * status);
     62unsigned int _ioc_get_block_size();
    6263
    6364///////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/sys/irq_handler.c

    r231 r237  
    127127
    128128    // release DMA channel
    129     _dma_done[dma_global_id] = 1; 
     129    _dma_done[dma_global_id] = 1;
    130130#else
    131131    _puts("[GIET ERROR] NB_DMAS_MAX is set to zero\n");
  • soft/giet_vm/sys/sys_handler.c

    r232 r237  
    4646    &_ioc_read,            /* 0x16 */
    4747    &_ioc_completed,       /* 0x17 */
    48     &_sys_ukn,             /* 0x18 */
     48    &_ioc_get_block_size,  /* 0x18 */
    4949    &_sys_ukn,             /* 0x19 */
    5050    &_vobj_get_vbase,      /* 0x1A */
Note: See TracChangeset for help on using the changeset viewer.