Handle disk partitioning
This commit is contained in:
27
kernel/storedev/partsd.h
Normal file
27
kernel/storedev/partsd.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef STOREDEV_PARTSD_H_
|
||||
#define STOREDEV_PARTSD_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct StoreDev;
|
||||
|
||||
typedef struct {
|
||||
struct StoreDev *parent;
|
||||
size_t sectorcount;
|
||||
size_t startsector;
|
||||
} PartSd;
|
||||
|
||||
typedef struct {
|
||||
struct StoreDev *parent;
|
||||
size_t sectorcount;
|
||||
size_t startsector;
|
||||
} PartSdInitExtra;
|
||||
|
||||
int32_t partsd_init(struct StoreDev *sd, void *extra);
|
||||
int32_t partsd_read(struct StoreDev *sd, uint8_t *const buffer, ptrdiff_t sector, ptrdiff_t off, size_t size);
|
||||
int32_t partsd_write(struct StoreDev *sd, const uint8_t *const buffer, ptrdiff_t sector, ptrdiff_t off, size_t size);
|
||||
int32_t partsd_cleanup(struct StoreDev *sd);
|
||||
size_t partsd_capacity(struct StoreDev *sd);
|
||||
|
||||
#endif // STOREDEV_PARTSD_H_
|
||||
Reference in New Issue
Block a user