Source code for the Trusted Boot Module.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
tbm-mcu/source/fs/mufs/dir.h

22 lines
532 B

#pragma once
struct mufs_dtree {
uint32_t file_size;
uint32_t root;
uint8_t depth;
} __attribute__((packed));
struct mufs_dentry {
uint8_t type;
struct mufs_dtree tree;
uint16_t path_len;
} __attribute__((packed));
#define MUFS_FILE BIT(0)
#define MUFS_DIR BIT(1)
struct mufs_tree *resolve_path(struct mufs *fs, const char *path);
size_t read_dirent(struct mufs *fs, struct mufs_tree *tree,
struct mufs_dirent *dirent, uint32_t va);
size_t write_dirent(struct mufs_tree *tree,
uint32_t va, struct mufs_dirent *dirent);