Implement storedevs, prepare to port littlefs

This commit is contained in:
2025-08-16 12:34:36 +02:00
parent c936910199
commit 2b0566c56f
91 changed files with 54963 additions and 37 deletions

20
kernel/storedev/ramsd.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef STOREDEV_RAMSD_H_
#define STOREDEV_RAMSD_H_
struct StoreDev;
typedef struct {
size_t capacity;
uint8_t *buffer;
} RamSd;
typedef struct {
size_t capacity;
} RamSdInitExtra;
int32_t ramsd_init(struct StoreDev *sd, void *extra);
int32_t ramsd_read(struct StoreDev *sd, uint8_t *const buffer, size_t n, size_t off);
int32_t ramsd_write(struct StoreDev *sd, const uint8_t *const buffer, size_t n, size_t off);
int32_t ramsd_cleanup(struct StoreDev *sd);
#endif // STOREDEV_RAMSD_H_