Changeset 218 for soft/giet_vm/libs/stdio.c
- Timestamp:
- Sep 19, 2012, 10:52:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/stdio.c
r204 r218 33 33 #define SYSCALL_IOC_COMPLETED 0x17 34 34 #define SYSCALL_VOBJ_GET_VBASE 0x1A 35 #define SYSCALL_NIC_WRITE 0x1B 36 #define SYSCALL_NIC_READ 0x1C 37 #define SYSCALL_NIC_COMPLETED 0x1D 35 38 36 39 ////////////////////////////////////////////////////////////////////////////////// … … 645 648 ////////////////////////////////////////////////////////////////////////////////// 646 649 unsigned int giet_fb_write( unsigned int offset, 647 void* 650 void* buffer, 648 651 unsigned int length ) 649 652 { … … 667 670 ////////////////////////////////////////////////////////////////////////////////// 668 671 unsigned int giet_fb_read( unsigned int offset, 669 void* 672 void* buffer, 670 673 unsigned int length ) 671 674 { … … 685 688 { 686 689 return sys_call(SYSCALL_FB_COMPLETED, 690 0, 0, 0, 0); 691 } 692 693 ////////////////////////////////////////////////////////////////////////////////// 694 // giet_nic_write() 695 ////////////////////////////////////////////////////////////////////////////////// 696 // This non-blocking function use the DMA coprocessor to transfer data from the 697 // NIC device to an user buffer. 698 // - offset : offset (in bytes) in the NIC 699 // - buffer : base address of the memory buffer 700 // - length : number of bytes to be transfered 701 // The transfer completion is signaled by an IRQ, and must be tested by the 702 // nic_completed() function. 703 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 704 ////////////////////////////////////////////////////////////////////////////////// 705 706 unsigned int giet_nic_write( unsigned int offset, 707 void* buffer, 708 unsigned int length ) 709 { 710 return sys_call(SYSCALL_NIC_WRITE, 711 offset, 712 (unsigned int)buffer, 713 length, 714 0); 715 } 716 717 ////////////////////////////////////////////////////////////////////////////////// 718 // giet_nic_read() 719 ////////////////////////////////////////////////////////////////////////////////// 720 // This non-blocking function use the DMA coprocessor to transfer data from the 721 // NIC device to an user buffer. 722 // - offset : offset (in bytes) in the NIC 723 // - buffer : base address of the memory buffer 724 // - length : number of bytes to be transfered 725 // The transfer completion is signaled by an IRQ, and must be tested by the 726 // nic_completed() function. 727 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 728 ////////////////////////////////////////////////////////////////////////////////// 729 730 unsigned int giet_nic_read( unsigned int offset, 731 void* buffer, 732 unsigned int length ) 733 { 734 return sys_call(SYSCALL_NIC_READ, 735 offset, 736 (unsigned int)buffer, 737 length, 738 0); 739 } 740 741 ////////////////////////////////////////////////////////////////////////////////// 742 // giet_nic_completed() 743 ////////////////////////////////////////////////////////////////////////////////// 744 // This blocking function returns when the transfer is completed. 745 // - Returns 0 if success, > 0 if error. 746 ////////////////////////////////////////////////////////////////////////////////// 747 unsigned int giet_nic_completed() 748 { 749 return sys_call(SYSCALL_NIC_COMPLETED, 687 750 0, 0, 0, 0); 688 751 }
Note: See TracChangeset
for help on using the changeset viewer.