Changeset 715 for soft/giet_vm
- Timestamp:
- Oct 7, 2015, 12:05:03 PM (9 years ago)
- Location:
- soft/giet_vm/giet_drivers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r709 r715 33 33 /////////////////////////////////////////////////////////////////////////////// 34 34 35 // lock protecting single channel BDV peripheral35 // lock protecting exclusive access 36 36 __attribute__((section(".kdata"))) 37 spin_lock_t _bdv_lock __attribute__((aligned(64)));38 39 // global index of the waitingthread (only used in descheduling mode)37 spin_lock_t _bdv_lock __attribute__((aligned(64))); 38 39 // owner thread (only used in descheduling mode) 40 40 __attribute__((section(".kdata"))) 41 unsigned int _bdv_trdid;42 43 // BDV peripheralstatus (only used in descheduling mode)41 unsigned int _bdv_trdid; 42 43 // transfer status (only used in descheduling mode) 44 44 __attribute__((section(".kdata"))) 45 unsigned int _bdv_status;46 47 /////////////////////////////////////////////////////////////////////////////// 48 // This low_level function returns the value contained in register 45 unsigned int _bdv_status; 46 47 /////////////////////////////////////////////////////////////////////////////// 48 // This low_level function returns the value contained in register(index). 49 49 /////////////////////////////////////////////////////////////////////////////// 50 50 unsigned int _bdv_get_register( unsigned int index ) … … 55 55 56 56 /////////////////////////////////////////////////////////////////////////////// 57 // This low-level function set a new value in register 57 // This low-level function set a new value in register(index). 58 58 /////////////////////////////////////////////////////////////////////////////// 59 59 void _bdv_set_register( unsigned int index, -
soft/giet_vm/giet_drivers/hba_driver.c
r709 r715 28 28 29 29 // allocated in the boot.c or kernel_init.c files 30 extern static_scheduler_t* _schedulers[X_SIZE][Y_SIZE][NB_PROCS_MAX]; 30 extern static_scheduler_t* _schedulers[X_SIZE][Y_SIZE][NB_PROCS_MAX]; 31 extern unsigned int _hba_boot_mode; 31 32 32 33 ////////////////////////////////////////////////////////////////////////////////// … … 36 37 // and must be defined in both kernel_init.c and boot.c files. 37 38 // - during the boot phase, only one processor access the HBA in synchronous 38 // mode. There is no need for the allocatorto use a lock.39 // - after the boot phase, the HBA device can be used by several processors. The40 // allocator is protected by a sqt_lock.39 // mode. There is no need to use a lock. 40 // - during the execution phase, the HBA device can be used by several processors. 41 // The slot allocator is protected by a sqt_lock. 41 42 ////////////////////////////////////////////////////////////////////////////////// 42 43 43 extern unsigned int _hba_boot_mode; 44 45 __attribute__((section(".kdata"))) 46 sqt_lock_t _hba_allocator_lock __attribute__((aligned(64))); 44 __attribute__((section(".kdata"))) 45 sqt_lock_t _hba_lock __attribute__((aligned(64))); 47 46 48 47 // state of each slot (allocated to a thread or not) … … 98 97 /////////////////////////////////////////////////////////////////////////////// 99 98 // This blocking fonction allocates a free command index to the thread. 100 // The hba_ allocator_lock is not used in boot mode.99 // The hba_lock is not used in boot mode. 101 100 // It returns the allocated command index (between 0 and 31) 102 101 /////////////////////////////////////////////////////////////////////////////// … … 109 108 while ( found == 0) 110 109 { 111 if ( !_hba_boot_mode ) 112 _sqt_lock_acquire(&_hba_allocator_lock); 110 if ( !_hba_boot_mode ) _sqt_lock_acquire(&_hba_lock); 113 111 114 112 for ( c = 0; c < 32 ; c++ ) … … 123 121 } 124 122 125 if ( !_hba_boot_mode ) 126 _sqt_lock_release(&_hba_allocator_lock); 123 if ( !_hba_boot_mode ) _sqt_lock_release(&_hba_lock); 127 124 } 128 125 … … 379 376 // initialise allocator lock if not in boot mode 380 377 if ( !_hba_boot_mode ) 381 _sqt_lock_init(&_hba_ allocator_lock);378 _sqt_lock_init(&_hba_lock); 382 379 383 380 // initialise Command Descriptors in Command List, allocated command table … … 390 387 _hba_cmd_list[c].ctba = (unsigned int)(paddr); 391 388 _hba_cmd_list[c].ctbau = (unsigned int)(paddr>>32); 392 _hba_allocated_cmd[c] = 0;393 _hba_active_cmd[c] = 0;389 _hba_allocated_cmd[c] = 0; 390 _hba_active_cmd[c] = 0; 394 391 } 395 392
Note: See TracChangeset
for help on using the changeset viewer.