Forráskód Böngészése

waterDataDiscreteRateMining standardDeviationMemoryDefinition.c 姚强 commit at 2021-02-23

姚强 4 éve
szülő
commit
3d1c48242c

+ 17 - 0
waterDataDiscreteRateMining/dataSharedMemory/standardDeviationMemoryDefinition.c

@@ -418,3 +418,20 @@ static void __dma_memcpy(u32 daddr, s16 dmod, u32 saddr, s16 smod, size_t cnt, u
 	 * without the anomaly version (because we are atomic already).
 	 */
 	__builtin_bfin_ssync();
+
+	if (bfin_read_MDMA_S_CONFIG())
+		while (!(bfin_read_MDMA_D_IRQ_STATUS() & DMA_DONE))
+			continue;
+
+	if (conf & DMA2D) {
+		/* For larger bit sizes, we've already divided down cnt so it
+		 * is no longer a multiple of 64k.  So we have to break down
+		 * the limit here so it is a multiple of the incoming size.
+		 * There is no limitation here in terms of total size other
+		 * than the hardware though as the bits lost in the shift are
+		 * made up by MODIFY (== we can hit the whole address space).
+		 * X: (2^(16 - 0)) * 1 == (2^(16 - 1)) * 2 == (2^(16 - 2)) * 4
+		 */
+		u32 shift = abs(dmod) >> 1;
+		size_t ycnt = cnt >> (16 - shift);
+		cnt = 1 << (16 - shift);