diff options
author | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2021-04-13 13:55:11 +0200 |
---|---|---|
committer | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2021-04-19 09:02:22 +0200 |
commit | 00a5f9748e3c6757140efda393cd474881e2c7fa (patch) | |
tree | 3a9ca8f241b4abd3a7626356b6f8016fc8b3bc25 /freebsd/sys/dev/mmc/mmcsd.c | |
parent | STM32H7: Fix SDMMC build for all other BSPs (diff) | |
download | rtems-libbsd-00a5f9748e3c6757140efda393cd474881e2c7fa.tar.bz2 |
MMCSD: Use cache aligned alloc for ioctl
Some drivers can't easily work with buffers that are not cache aligned
and have an arbitrary length. Therefore use an aligned malloc instead.
Diffstat (limited to 'freebsd/sys/dev/mmc/mmcsd.c')
-rw-r--r-- | freebsd/sys/dev/mmc/mmcsd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/freebsd/sys/dev/mmc/mmcsd.c b/freebsd/sys/dev/mmc/mmcsd.c index 21f54046..bd45b419 100644 --- a/freebsd/sys/dev/mmc/mmcsd.c +++ b/freebsd/sys/dev/mmc/mmcsd.c @@ -1196,7 +1196,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; |