mtd_test.h 735 B

12345678910111213141516171819202122232425
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/mtd/mtd.h>
  3. #include <linux/sched/signal.h>
  4. static inline int mtdtest_relax(void)
  5. {
  6. cond_resched();
  7. if (signal_pending(current)) {
  8. pr_info("aborting test due to pending signal!\n");
  9. return -EINTR;
  10. }
  11. return 0;
  12. }
  13. int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum);
  14. int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
  15. unsigned int eb, int ebcnt);
  16. int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
  17. unsigned int eb, int ebcnt);
  18. int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf);
  19. int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
  20. const void *buf);