Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #include <linux/mtd/mtd.h>
0003 #include <linux/sched/signal.h>
0004 
0005 static inline int mtdtest_relax(void)
0006 {
0007     cond_resched();
0008     if (signal_pending(current)) {
0009         pr_info("aborting test due to pending signal!\n");
0010         return -EINTR;
0011     }
0012 
0013     return 0;
0014 }
0015 
0016 int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum);
0017 int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
0018                     unsigned int eb, int ebcnt);
0019 int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
0020                 unsigned int eb, int ebcnt);
0021 
0022 int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf);
0023 int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
0024         const void *buf);