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.

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.