summaryrefslogtreecommitdiff
path: root/extmod/vfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/vfs.h')
-rw-r--r--extmod/vfs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/extmod/vfs.h b/extmod/vfs.h
index 730dea043..85b020faa 100644
--- a/extmod/vfs.h
+++ b/extmod/vfs.h
@@ -38,6 +38,12 @@
#define MP_S_IFDIR (0x4000)
#define MP_S_IFREG (0x8000)
+// these are the values for mp_vfs_blockdev_t.flags
+#define MP_BLOCKDEV_FLAG_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func
+#define MP_BLOCKDEV_FLAG_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount
+#define MP_BLOCKDEV_FLAG_HAVE_IOCTL (0x0004) // new protocol with ioctl
+#define MP_BLOCKDEV_FLAG_NO_FILESYSTEM (0x0008) // the block device has no filesystem on it
+
// constants for block protocol ioctl
#define BP_IOCTL_INIT (1)
#define BP_IOCTL_DEINIT (2)
@@ -50,6 +56,20 @@ typedef struct _mp_vfs_proto_t {
mp_import_stat_t (*import_stat)(void *self, const char *path);
} mp_vfs_proto_t;
+typedef struct _mp_vfs_blockdev_t {
+ uint16_t flags;
+ mp_obj_t readblocks[4];
+ mp_obj_t writeblocks[4];
+ // new protocol uses just ioctl, old uses sync (optional) and count
+ union {
+ mp_obj_t ioctl[4];
+ struct {
+ mp_obj_t sync[2];
+ mp_obj_t count[2];
+ } old;
+ } u;
+} mp_vfs_blockdev_t;
+
typedef struct _mp_vfs_mount_t {
const char *str; // mount point with leading /
size_t len;