Changeset 631 for trunk/softs/giet_tsar
- Timestamp:
- Feb 12, 2014, 1:42:52 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/giet_tsar/stdio.c
r629 r631 87 87 extern struct plouf seg_ioc_base; 88 88 extern struct plouf seg_mmc_base; 89 extern struct plouf seg_ramdisk_base; 89 90 90 91 //////////////////////////////////////////////////////////////////////////////////////// … … 915 916 // BLOCK_DEVICE (IOC) 916 917 ////////////////////////////////////////////////////////////////////////////////////////// 918 // The block size is 512 bytes. 917 919 // The functions below use the three variables _ioc_lock _ioc_done, 918 920 // and _ioc_status for synchronisation. … … 933 935 // (x = X_SIZE-1 / y = Y_SIZE), which requires and extended address access. 934 936 // If USE_EXT_IO not set, we use the IOC contrÃŽler in cluster (0,0). 937 // 938 // If USE_RAMDISK is set, we access a "virtual" block device controler implemented 939 // as a memory-mapped segment in cluster [0,0] at address seg_ramdisk_base. 940 // The tranfer being fully synchronous, the IOC interrupt is not activated. 935 941 /////////////////////////////////////////////////////////////////////////////////////// 936 942 … … 967 973 _ioc_get_lock(); 968 974 969 if ( USE_EXT_IO ) // extended addressing to cluster_io 975 if ( USE_RAMDISK ) // we use an extended_memcpy 976 { 977 unsigned int src_address = (unsigned int)buffer; 978 unsigned int src_cluster = ext; 979 unsigned int dst_address = (unsigned int)&seg_ramdisk_base + lba*512; 980 unsigned int dst_cluster = 0; 981 982 _extended_memcpy( dst_cluster, 983 dst_address, 984 src_cluster, 985 src_address, 986 count*512 ); 987 988 _ioc_status = BLOCK_DEVICE_WRITE_SUCCESS; 989 _ioc_done = 1; 990 } 991 else if ( USE_EXT_IO ) // extended addressing to cluster_io 970 992 { 971 993 unsigned int cluster = ((X_SIZE-1)<<Y_WIDTH) + Y_SIZE; … … 1007 1029 _ioc_get_lock(); 1008 1030 1009 if ( USE_EXT_IO ) // extended addressing to cluster_io 1031 if ( USE_RAMDISK ) // we use an extended_memcpy 1032 { 1033 unsigned int dst_address = (unsigned int)buffer; 1034 unsigned int dst_cluster = ext; 1035 unsigned int src_address = (unsigned int)&seg_ramdisk_base + lba*512; 1036 unsigned int src_cluster = 0; 1037 1038 _extended_memcpy( dst_cluster, 1039 dst_address, 1040 src_cluster, 1041 src_address, 1042 count*512 ); 1043 1044 _ioc_status = BLOCK_DEVICE_READ_SUCCESS; 1045 _ioc_done = 1; 1046 } 1047 else if ( USE_EXT_IO ) // extended addressing to cluster_io 1010 1048 { 1011 1049 unsigned int cluster = ((X_SIZE-1)<<Y_WIDTH) + Y_SIZE; … … 1081 1119 1082 1120 ////////////////////////////////////////////////////////////////////////////////////// 1083 // This ISR must be executed when an IRQ is activated by MEMC to signal1084 // an error detected by the TSAR memory cache after a write transaction.1085 // It displays an error message on the TTY terminal allocated to the processor1086 // executing the ISR.1087 //////////////////////////////////////////////////////////////////////////////////////1088 in_drivers void _mmc_isr()1089 {1090 int* mmc_address = (int*)&seg_mmc_base;1091 unsigned int cluster_xy = _procid() / NB_PROCS_MAX;1092 1093 _tty_printf( "WRITE ERROR signaled by Memory Cache in cluster %x\n", cluster_xy );1094 }1095 1096 //////////////////////////////////////////////////////////////////////////////////////1097 1121 // FRAME_BUFFER 1098 1122 ////////////////////////////////////////////////////////////////////////////////////// … … 1150 1174 src_address, 1151 1175 length ); 1176 } 1177 1178 ////////////////////////////////////////////////////////////////////////////////////// 1179 // This ISR must be executed when an IRQ is activated by MEMC to signal 1180 // an error detected by the TSAR memory cache after a write transaction. 1181 // It displays an error message on the TTY terminal allocated to the processor 1182 // executing the ISR. 1183 ////////////////////////////////////////////////////////////////////////////////////// 1184 in_drivers void _mmc_isr() 1185 { 1186 int* mmc_address = (int*)&seg_mmc_base; 1187 unsigned int cluster_xy = _procid() / NB_PROCS_MAX; 1188 1189 _tty_printf( "WRITE ERROR signaled by Memory Cache in cluster %x\n", cluster_xy ); 1152 1190 } 1153 1191
Note: See TracChangeset
for help on using the changeset viewer.