kern

view src/bdev.h @ 93:083849df660b

split the system call implementations out of fs.c into fs_sys.c
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 11 Dec 2011 10:17:58 +0200
parents f83f50c17c3b
children
line source
1 #ifndef BDEV_H_
2 #define BDEV_H_
4 #include "fs.h" /* for dev_t */
6 /* TODO buffer cache */
8 struct block_device {
9 int ata_dev;
10 uint32_t offset, size;
12 /* Partition type (if the blkdev is a partition), otherwise 0.
13 * Used as just an extra sanity check to make sure we don't
14 * try to mount the wrong filesystem.
15 */
16 int ptype;
17 };
19 struct block_device *blk_open(dev_t dev);
20 void blk_close(struct block_device *bdev);
22 int blk_read(struct block_device *bdev, uint32_t blk, int count, void *buf);
23 int blk_write(struct block_device *bdev, uint32_t blk, int count, void *buf);
25 dev_t bdev_by_name(const char *name);
27 #endif /* BDEV_H_ */