miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
sysfs.c File Reference
#include <miniOS/fs/sysfs.h>
#include <miniOS/fs/vfs.h>
#include <miniOS/mm/heap.h>
#include <miniOS/io.h>
#include <string.h>
Include dependency graph for sysfs.c:

Macros

#define SYSFS_MAX_NODES   256

Functions

static uint32_t sysfs_node_to_ino (sysfs_node_t *node)
static sysfs_node_tsysfs_ino_to_node (uint32_t ino)
sysfs_node_tsysfs_create_dir (sysfs_node_t *parent, const char *name)
sysfs_node_tsysfs_create_file (sysfs_node_t *parent, const char *name, const char *buf, uint32_t len, int(*callback)(char *, uint32_t))
sysfs_node_tsysfs_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_tg_sysfs_root = NULL
static vfs_ops_t sysfs_ops
static sysfs_node_tg_sysfs_nodes [SYSFS_MAX_NODES]
static uint32_t g_sysfs_next_ino = 1

Macro Definition Documentation

◆ SYSFS_MAX_NODES

#define SYSFS_MAX_NODES   256

Function Documentation

◆ sysfs_create_dir()

sysfs_node_t * sysfs_create_dir ( sysfs_node_t * parent,
const char * name )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_create_file()

sysfs_node_t * sysfs_create_file ( sysfs_node_t * parent,
const char * name,
const char * buf,
uint32_t len,
int(* callback )(char *, uint32_t) )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_create_file_show()

sysfs_node_t * sysfs_create_file_show ( sysfs_node_t * parent,
const char * name,
int(* callback )(char *buf, uint32_t bufsiz) )
Here is the call graph for this function:

◆ sysfs_init()

void sysfs_init ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_ino_to_node()

sysfs_node_t * sysfs_ino_to_node ( uint32_t ino)
static
Here is the caller graph for this function:

◆ sysfs_lookup()

int sysfs_lookup ( const char * path,
vfs_inode_info_t * out )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_mount()

int sysfs_mount ( const char * source,
const char * target,
const void * data )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_node_to_ino()

uint32_t sysfs_node_to_ino ( sysfs_node_t * node)
static
Here is the caller graph for this function:

◆ sysfs_read()

int sysfs_read ( uint32_t ino,
uint64_t off,
void * buf,
uint32_t len )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_readdir()

int sysfs_readdir ( uint32_t ino,
uint64_t * offset,
vfs_dirent_cb_t cb,
void * ud )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_rmdir()

int sysfs_rmdir ( uint32_t parent_ino,
const char * name )
static
Here is the caller graph for this function:

◆ sysfs_statfs()

int sysfs_statfs ( vfs_statfs_t * out)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysfs_unlink()

int sysfs_unlink ( uint32_t parent_ino,
const char * name )
static
Here is the caller graph for this function:

Variable Documentation

◆ g_sysfs_next_ino

uint32_t g_sysfs_next_ino = 1
static

◆ g_sysfs_nodes

sysfs_node_t* g_sysfs_nodes[SYSFS_MAX_NODES]
static

◆ g_sysfs_root

sysfs_node_t* g_sysfs_root = NULL

◆ sysfs_ops

vfs_ops_t sysfs_ops
static