ahci: add block operations
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
7aed4b6579
commit
fc0720b118
5 changed files with 60 additions and 9 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#ifndef _BLOCK_H_
|
||||
#define _BLOCK_H_
|
||||
|
||||
#include <fs/vfs.h>
|
||||
#include <kernel/device.h>
|
||||
|
||||
struct block_device;
|
||||
|
|
@ -11,11 +12,19 @@ struct block_ops {
|
|||
};
|
||||
|
||||
struct block_device {
|
||||
char *name;
|
||||
dev_t dev;
|
||||
size_t size;
|
||||
size_t block_size;
|
||||
char name[256];
|
||||
dev_t dev;
|
||||
size_t size;
|
||||
size_t block_size;
|
||||
struct block_ops ops;
|
||||
void *priv;
|
||||
size_t lba_start;
|
||||
};
|
||||
|
||||
struct disk {
|
||||
struct block_device *dev;
|
||||
char model[FILE_NAME_MAX_LEN + 1];
|
||||
list_t part_table;
|
||||
};
|
||||
|
||||
ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_blocks);
|
||||
|
|
|
|||
Loading…
Reference in a new issue