|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <miniOS/fs/sysfs.h>#include <miniOS/fs/vfs.h>#include <miniOS/mm/heap.h>#include <miniOS/io.h>#include <string.h>
Macros | |
| #define | SYSFS_MAX_NODES 256 |
Functions | |
| static uint32_t | sysfs_node_to_ino (sysfs_node_t *node) |
| static sysfs_node_t * | sysfs_ino_to_node (uint32_t ino) |
| sysfs_node_t * | sysfs_create_dir (sysfs_node_t *parent, const char *name) |
| sysfs_node_t * | sysfs_create_file (sysfs_node_t *parent, const char *name, const char *buf, uint32_t len, int(*callback)(char *, uint32_t)) |
| sysfs_node_t * | sysfs_create_file_show (sysfs_node_t *parent, const char *name, int(*callback)(char *buf, uint32_t bufsiz)) |
| static int | sysfs_lookup (const char *path, vfs_inode_info_t *out) |
| static int | sysfs_read (uint32_t ino, uint64_t off, void *buf, uint32_t len) |
| static int | sysfs_readdir (uint32_t ino, uint64_t *offset, vfs_dirent_cb_t cb, void *ud) |
| static int | sysfs_unlink (uint32_t parent_ino, const char *name) |
| static int | sysfs_rmdir (uint32_t parent_ino, const char *name) |
| static int | sysfs_statfs (vfs_statfs_t *out) |
| static int | sysfs_mount (const char *source, const char *target, const void *data) |
| void | sysfs_init (void) |
Variables | |
| sysfs_node_t * | g_sysfs_root = NULL |
| static vfs_ops_t | sysfs_ops |
| static sysfs_node_t * | g_sysfs_nodes [SYSFS_MAX_NODES] |
| static uint32_t | g_sysfs_next_ino = 1 |
| #define SYSFS_MAX_NODES 256 |
| sysfs_node_t * sysfs_create_dir | ( | sysfs_node_t * | parent, |
| const char * | name ) |


| sysfs_node_t * sysfs_create_file | ( | sysfs_node_t * | parent, |
| const char * | name, | ||
| const char * | buf, | ||
| uint32_t | len, | ||
| int(* | callback )(char *, uint32_t) ) |


| sysfs_node_t * sysfs_create_file_show | ( | sysfs_node_t * | parent, |
| const char * | name, | ||
| int(* | callback )(char *buf, uint32_t bufsiz) ) |

| void sysfs_init | ( | void | ) |


|
static |

|
static |


|
static |


|
static |



|
static |


|
static |

|
static |


|
static |

|
static |
|
static |
| sysfs_node_t* g_sysfs_root = NULL |
|
static |