summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/mmc/mmcsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/dev/mmc/mmcsd.c')
-rw-r--r--freebsd/sys/dev/mmc/mmcsd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/freebsd/sys/dev/mmc/mmcsd.c b/freebsd/sys/dev/mmc/mmcsd.c
index 3960845c..ff517abc 100644
--- a/freebsd/sys/dev/mmc/mmcsd.c
+++ b/freebsd/sys/dev/mmc/mmcsd.c
@@ -546,6 +546,11 @@ mmcsd_attach(device_t dev)
*/
rev = ext_csd[EXT_CSD_REV];
+/*
+ * Cache flush functions are currently not available. Use of on-device cache can
+ * cause data loss.
+ */
+#ifndef __rtems__
/*
* With revision 1.5 (MMC v4.5, EXT_CSD_REV == 6) and later, take
* advantage of the device R/W cache if present and useage is not
@@ -567,6 +572,7 @@ mmcsd_attach(device_t dev)
sc->flags |= MMCSD_FLUSH_CACHE;
}
}
+#endif
/*
* Ignore user-creatable enhanced user data area and general purpose
@@ -1196,7 +1202,11 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag)
goto out;
}
if (len != 0) {
+#ifndef __rtems__
dp = malloc(len, M_TEMP, M_WAITOK);
+#else /* __rtems__ */
+ dp = rtems_cache_aligned_malloc(len);
+#endif /* __rtems__ */
err = copyin((void *)(uintptr_t)mic->data_ptr, dp, len);
if (err != 0)
goto out;