vxBoot/include/vxBoot/fs/smemfs.h

53 lines
1.1 KiB
C

#ifndef __VXBOOT_FS_SMEMFS_H__
# define __VXBOOT_FS_SMEMFS_H__
#include <stddef.h>
#include <stdint.h>
#include <gint/defs/types.h>
//----
// Internal structure used to provide Casio's syscall abstraction
//---
/* Internal superblock use for the Casio's syscall abstraction */
struct smemfs_superblock {
struct smemfs_inode *root_inode;
struct smemfs_inode *fake_root_inode;
};
/* Internal struct used to store SMEM dump */
struct smemfs_inode {
/* File name */
char name[32];
/* Internal file's information */
int type;
size_t fsize;
size_t dsize;
/* Internal abstraction information */
struct smemfs_inode *child;
struct smemfs_inode *sibling;
struct smemfs_inode *parent;
};
//---
// Dev symbols
//---
#define SMEMFS_FAKE_ROOT_INODE ((void*)0xdeadbeef)
extern struct smemfs_superblock smemfs_superblock;
//---
// Primitives
//---
extern struct smemfs_inode *smemfs_mount(void);
extern ssize_t smemfs_pread(struct smemfs_inode *inode,
void *buf, size_t count, off_t pos);
extern struct smemfs_inode *smemfs_alloc_inode(void);
#endif /*__VXBOOT_FS_SMEMFS_H__*/