Files
my-kern/include/myke/vfs/vfs-driver.h
Rick Rongen 03f0ec6f88 feat: Vfs and Ext2 support. Code style/attribute improvements
Added VFS and Ext2 support.
Optimized attributes of methods to improve code highlighting.
Printf attribute, malloc attribute, etc.
2021-10-06 21:45:15 +02:00

37 lines
989 B
C

//
// Created by rick on 19-09-21.
//
#ifndef NEW_KERNEL_VFS_DRIVER_H
#define NEW_KERNEL_VFS_DRIVER_H
#include <myke/driver.h>
#include <myke/vfs/vfs.h>
typedef struct vfs_driver {
char name[16];
struct {
} flags;
// api
int (*vfs_mount)(vfs_mount_t *mount);
int (*open)(vfs_mount_t *mount, vfs_fd_t *dir, const char *path, int mode, vfs_fd_t *out);
int (*close)(vfs_mount_t *mount, vfs_fd_t *fd);
int (*fstat)(vfs_mount_t *mount, vfs_fd_t *fd, stat_t *target, int flags);
int (*fread)(vfs_mount_t *mount, vfs_fd_t *fd, void *target, size_t size);
int (*dgetent)(vfs_mount_t *mount, vfs_fd_t *fd, void *target, size_t size);
} __attribute__((__aligned__(STRUCT_ALIGNMENT))) vfs_driver_t;
void vfs_mk_dirent_record(vfs_dirent_t *ent, uint32_t inode, uint32_t cur_offset, uint8_t type, char *name,
size_t name_length);
#define VFS_DRIVER(order) GENERIC_DRIVER(vfs_driver, order)
#endif //NEW_KERNEL_VFS_DRIVER_H