mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
drivers/rptun: flush the image memory when read from the file system
Flush the image memory to make sure the remote core access the correct image. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -981,6 +981,7 @@ static int rptun_store_load(FAR void *store_, size_t offset,
|
||||
{
|
||||
FAR struct rptun_store_s *store = store_;
|
||||
FAR char *tmp;
|
||||
ssize_t ret;
|
||||
|
||||
if (pa == METAL_BAD_PHYS)
|
||||
{
|
||||
@@ -1003,7 +1004,13 @@ static int rptun_store_load(FAR void *store_, size_t offset,
|
||||
}
|
||||
|
||||
file_seek(&store->file, offset, SEEK_SET);
|
||||
return file_read(&store->file, tmp, size);
|
||||
ret = file_read(&store->file, tmp, size);
|
||||
if (ret > 0)
|
||||
{
|
||||
metal_cache_flush(tmp, ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user