X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/97901724584e74554916b89dfb8e95dc6497e687..707c6653985f55463e8a59a58b248ba8af3b44b2:/lunaix-os/includes/lunaix/block.h diff --git a/lunaix-os/includes/lunaix/block.h b/lunaix-os/includes/lunaix/block.h index 551bc22..0ddd000 100644 --- a/lunaix-os/includes/lunaix/block.h +++ b/lunaix-os/includes/lunaix/block.h @@ -9,6 +9,16 @@ #define PARTITION_NAME_SIZE 48 #define DEV_ID_SIZE 32 +struct block_dev; + +struct block_dev_ops +{ + int (*block_read)(struct block_dev*, void*, u64_t, size_t); + int (*block_write)(struct block_dev*, void*, u64_t, size_t); + void* (*block_alloc)(struct block_dev*); + void (*block_free)(struct block_dev*, void*); +}; + struct block_dev { struct llist_header parts; @@ -20,6 +30,7 @@ struct block_dev u64_t start_lba; u64_t end_lba; u32_t blk_size; + struct block_dev_ops ops; }; // Lunaix Partition Table @@ -33,7 +44,7 @@ struct lpt_header } __attribute__((packed)); typedef u64_t partition_t; -typedef uint32_t bdev_t; +typedef u32_t bdev_t; typedef void (*devfs_exporter)(struct block_dev* bdev, void* fsnode); void