apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.6k stars 1.11k forks source link

Implement mmap for BCH and FTL #8019

Open xiaoxiang781216 opened 1 year ago

xiaoxiang781216 commented 1 year ago

After https://github.com/apache/nuttx/pull/8000, mmap/munmap is the first-class interface, since block/mtd(e.g. RAM disk or XIP flash) device may support mmap too, It could be useful to:

  1. Add mmap callback to block_operations and mtd_dev_s: https://github.com/apache/nuttx/blob/master/include/nuttx/fs/fs.h#L260-L274 https://github.com/apache/nuttx/blob/master/include/nuttx/mtd/mtd.h#L141-L187
  2. Forward mmap from file_operations to block_operations to mtd_dev_s: https://github.com/apache/nuttx/blob/master/drivers/bch/bchdev_driver.c#L81 https://github.com/apache/nuttx/blob/master/drivers/mtd/ftl.c#L106-L117
xiaoxiang781216 commented 1 year ago

@jlaitine I create an issue to track the block/mtd related work, please take a look.