Changeset 237
- Timestamp:
- May 2, 2013, 6:38:04 PM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/stdio.c
r232 r237 35 35 #define SYSCALL_IOC_READ 0x16 36 36 #define SYSCALL_IOC_COMPLETED 0x17 37 #define SYSCALL_IOC_BLOCK_SIZE 0x18 37 38 #define SYSCALL_VOBJ_GET_VBASE 0x1A 38 39 #define SYSCALL_NIC_WRITE 0x1B … … 548 549 549 550 551 ////////////////////////////////////////////////////////////////////////////////// 552 // giet_ioc_block_size() 553 ////////////////////////////////////////////////////////////////////////////////// 554 // This blocking function returns the block_size (in bytes) of the block device 555 ////////////////////////////////////////////////////////////////////////////////// 556 unsigned int giet_ioc_block_size() { 557 return sys_call(SYSCALL_IOC_BLOCK_SIZE, 0, 0, 0, 0); 558 } 559 560 550 561 ///// Frame buffer device related system calls ///// 551 562 -
soft/giet_vm/libs/stdio.h
r232 r237 34 34 unsigned int giet_ioc_write(unsigned int lba, void * buffer, unsigned int count); 35 35 unsigned int giet_ioc_completed(); 36 unsigned int giet_ioc_block_size(); 36 37 37 38 /* Frame buffer device related functions */ -
soft/giet_vm/sys/drivers.c
r232 r237 220 220 //unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id) { 221 221 // // 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 // } 224 228 // 225 229 //#if USE_XICU … … 227 231 //#else 228 232 // 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; 231 236 //#endif 232 237 // … … 770 775 *status = ioc_address[BLOCK_DEVICE_STATUS]; // read status & reset IRQ 771 776 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 /////////////////////////////////////////////////////////////////////////////// 784 unsigned 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]; 772 789 } 773 790 … … 905 922 906 923 // get page table address 907 unsigned int user_ptab = _get_context_slot( 924 unsigned int user_ptab = _get_context_slot(task_id, CTX_PTAB_ID); 908 925 909 926 // get peripheral buffer virtual address 910 if ( 927 if (dev_type) { 911 928 device_vaddr = (unsigned int) &seg_nic_base + offset; 912 929 } … … 926 943 927 944 // 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); 929 946 if (ko) { 930 947 _get_lock(&_tty_put_lock); -
soft/giet_vm/sys/drivers.h
r232 r237 19 19 unsigned int _timer_stop(unsigned int cluster_id, unsigned int local_id); 20 20 unsigned 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); 22 22 23 23 … … 60 60 unsigned int _ioc_completed(); 61 61 unsigned int _ioc_get_status(unsigned int * status); 62 unsigned int _ioc_get_block_size(); 62 63 63 64 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/sys/irq_handler.c
r231 r237 127 127 128 128 // release DMA channel 129 _dma_done[dma_global_id] = 1; 129 _dma_done[dma_global_id] = 1; 130 130 #else 131 131 _puts("[GIET ERROR] NB_DMAS_MAX is set to zero\n"); -
soft/giet_vm/sys/sys_handler.c
r232 r237 46 46 &_ioc_read, /* 0x16 */ 47 47 &_ioc_completed, /* 0x17 */ 48 &_ sys_ukn,/* 0x18 */48 &_ioc_get_block_size, /* 0x18 */ 49 49 &_sys_ukn, /* 0x19 */ 50 50 &_vobj_get_vbase, /* 0x1A */
Note: See TracChangeset
for help on using the changeset viewer.