18#ifndef __VSF_LINUX_FS_INTERNAL_H__
19#define __VSF_LINUX_FS_INTERNAL_H__
30#if VSF_USE_LINUX == ENABLED
32#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
33# include "../../include/termios.h"
40#if defined(__VSF_LINUX_FS_CLASS_IMPLEMENT)
41# define __VSF_CLASS_IMPLEMENT__
42#elif defined(__VSF_LINUX_FS_CLASS_INHERIT__)
43# define __VSF_CLASS_INHERIT__
54#if VSF_USE_FS != ENABLED
55# error VSF_USE_FS MUST be enabled to use fs in linux
126 void *mmapped_buffer;
141#if defined(__VSF_LINUX_FS_CLASS_IMPLEMENT) || defined(__VSF_LINUX_FS_CLASS_INHERIT__)
143typedef struct vsf_linux_fs_priv_t {
151} vsf_linux_fs_priv_t;
154typedef void (*vsf_linux_stream_on_evt_t)(vsf_linux_stream_priv_t *priv,
vsf_protect_t orig,
short event,
bool is_ready);
158 implement(vsf_linux_fs_priv_t)
163 vsf_linux_stream_on_evt_t on_evt;
164 bool stream_rx_allocated;
165 bool stream_tx_allocated;
171 implement(vsf_linux_stream_priv_t)
172 vsf_linux_pipe_priv_t *pipe_remote;
176typedef struct vsf_linux_term_priv_t {
177 implement(vsf_linux_pipe_priv_t)
183} vsf_linux_term_priv_t;
193 unsigned short *semadj_arr;
205#if defined(__VSF_LINUX_FS_CLASS_IMPLEMENT) || defined(__VSF_LINUX_FS_CLASS_INHERIT__)
216#if defined(__VSF_LINUX_FS_CLASS_IMPLEMENT) || defined(__VSF_LINUX_FS_CLASS_INHERIT__)
237typedef struct vk_vfs_file_t vk_vfs_file_t;
282#undef __VSF_LINUX_FS_CLASS_IMPLEMENT
283#undef __VSF_LINUX_FS_CLASS_INHERIT__
Definition vsf_linux_fs.h:94
Definition vsf_linux_fs.h:115
Definition vsf_linux.h:278
Definition vsf_linux.h:158
Definition vsf_queue_stream.h:60
Definition vsf_simple_stream.h:254
int pid_t
Definition types.h:85
long long off64_t
Definition types.h:97
int ssize_t
Definition types.h:68
#define vsf_dcl_class
Definition ooc_class.h:46
#define vsf_class(__name)
Definition ooc_class.h:48
uint32_t uintptr_t
Definition stdint.h:38
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned long long uint64_t
Definition stdint.h:11
Definition vsf_list.h:888
Definition vsf_linux_fs.h:70
int(* fn_setsize)(vsf_linux_fd_t *sfd, off64_t size)
Definition vsf_linux_fs.h:80
ssize_t(* fn_write)(vsf_linux_fd_t *sfd, const void *buf, size_t count)
Definition vsf_linux_fs.h:77
int feature
Definition vsf_linux_fs.h:72
int(* fn_msync)(vsf_linux_fd_t *sfd, void *buffer)
Definition vsf_linux_fs.h:85
int priv_size
Definition vsf_linux_fs.h:71
int(* fn_fcntl)(vsf_linux_fd_t *sfd, int cmd, uintptr_t arg)
Definition vsf_linux_fs.h:75
int(* fn_stat)(vsf_linux_fd_t *sfd, struct stat *buf)
Definition vsf_linux_fs.h:81
int(* fn_close)(vsf_linux_fd_t *sfd)
Definition vsf_linux_fs.h:78
int(* fn_eof)(vsf_linux_fd_t *sfd)
Definition vsf_linux_fs.h:79
ssize_t(* fn_read)(vsf_linux_fd_t *sfd, void *buf, size_t count)
Definition vsf_linux_fs.h:76
int(* fn_munmap)(vsf_linux_fd_t *sfd, void *buffer)
Definition vsf_linux_fs.h:84
void(* fn_init)(vsf_linux_fd_t *sfd)
Definition vsf_linux_fs.h:73
void(* fn_fini)(vsf_linux_fd_t *sfd)
Definition vsf_linux_fs.h:74
Definition vsf_linux_fs.h:88
short pendind_events
Definition vsf_linux_fs.h:89
void(* cb)(vsf_linux_fd_priv_t *priv, void *param, short events, vsf_protect_t orig)
Definition vsf_linux_fs.h:91
void * param
Definition vsf_linux_fs.h:90
Definition vsf_linux.h:128
uintalu_t vsf_protect_t
Definition vsf_arch_abstraction.h:53
void(* vsf_param_eda_evthandler_t)(uintptr_t target, vsf_evt_t evt)
Definition vsf_eda.h:658
int vsf_linux_fs_bind_target_relative(vk_vfs_file_t *dir, const char *pathname, void *target, const vsf_linux_fd_op_t *op, uint_fast32_t feature, uint64_t size)
Definition vsf_linux_fs.c:2736
int vsf_linux_fs_get_target(const char *pathname, void **target)
Definition vsf_linux_fs.c:2724
int vsf_linux_fs_bind_dir_target(const char *pathname, void *target)
Definition vsf_linux_fs.c:2789
vsf_linux_fd_t * vsf_linux_tx_pipe(vsf_linux_pipe_priv_t *priv_rx)
Definition vsf_linux_fs.c:3293
int vsf_linux_fd_bind_target_ex(int fd, void *target, const vsf_linux_fd_op_t *op, vsf_param_eda_evthandler_t peda_read, vsf_param_eda_evthandler_t peda_write, uint_fast32_t feature, uint64_t size)
Definition vsf_linux_fs.c:2697
void vsf_linux_fd_set_events(vsf_linux_fd_priv_t *priv, short events, vsf_protect_t orig)
Definition vsf_linux_fs.c:1158
int vsf_linux_fd_set_feature(int fd, uint_fast32_t feature)
Definition vsf_linux_fs.c:885
int vsf_linux_fs_bind_target(const char *pathname, void *target, vsf_param_eda_evthandler_t peda_read, vsf_param_eda_evthandler_t peda_write)
Definition vsf_linux_fs.c:2776
bool vsf_linux_fd_is_block(vsf_linux_fd_t *sfd)
Definition vsf_linux_fs.c:1081
const vsf_linux_fd_op_t __vsf_linux_stream_fdop
Definition vsf_linux_fs.c:231
int vsf_linux_fd_get_feature(int fd, uint_fast32_t *feature)
Definition vsf_linux_fs.c:873
int vsf_linux_create_pty(int num)
Definition vsf_linux_fs.c:3350
vsf_linux_fd_priv_callback_t * vsf_linux_fd_claim_calback(vsf_linux_fd_priv_t *priv)
Definition vsf_linux_fs.c:1106
int vsf_linux_fd_create(vsf_linux_fd_t **sfd, const vsf_linux_fd_op_t *op)
Definition vsf_linux_fs.c:1027
vsf_linux_fd_t * vsf_linux_rx_stream(vsf_stream_t *stream)
Definition vsf_linux_fs.c:3179
int vsf_linux_fs_bind_pipe(const char *pathname1, const char *pathname2, bool exclusive)
Definition vsf_linux_fs.c:3321
vsf_linux_fd_t * vsf_linux_fd_get(int fd)
Definition vsf_linux_fs.c:849
int vsf_linux_fd_bind_target(int fd, void *target, vsf_param_eda_evthandler_t peda_read, vsf_param_eda_evthandler_t peda_write)
Definition vsf_linux_fs.c:2717
const vsf_linux_fd_op_t vsf_linux_term_fdop
Definition vsf_linux_fs.c:252
int vsf_linux_fd_get_target(int fd, void **target)
Definition vsf_linux_fs.c:2684
void vsf_linux_fd_delete(int fd)
Definition vsf_linux_fs.c:1055
const vsf_linux_fd_op_t vsf_linux_pipe_fdop
Definition vsf_linux_fs.c:241
void vsf_linux_fd_clear_status(vsf_linux_fd_priv_t *priv, short status, vsf_protect_t orig)
Definition vsf_linux_fs.c:1184
int vsf_linux_fd_set_size(int fd, uint64_t size)
Definition vsf_linux_fs.c:904
void vsf_linux_fd_release_calback(vsf_linux_fd_priv_t *priv, vsf_linux_fd_priv_callback_t *callback)
Definition vsf_linux_fs.c:1120
int vsf_linux_fs_bind_target_ex(const char *pathname, void *target, const vsf_linux_fd_op_t *op, vsf_param_eda_evthandler_t peda_read, vsf_param_eda_evthandler_t peda_write, uint_fast32_t feature, uint64_t size)
Definition vsf_linux_fs.c:2758
short vsf_linux_fd_get_status(vsf_linux_fd_priv_t *priv, short status)
Definition vsf_linux_fs.c:1191
short vsf_linux_fd_pend_events(vsf_linux_fd_priv_t *priv, short events, vsf_linux_trigger_t *trig, vsf_protect_t orig)
Definition vsf_linux_fs.c:1125
void vsf_linux_fd_set_status(vsf_linux_fd_priv_t *priv, short status, vsf_protect_t orig)
Definition vsf_linux_fs.c:1173
vsf_linux_fd_t * vsf_linux_stream(vsf_stream_t *stream_rx, vsf_stream_t *stream_tx)
Definition vsf_linux_fs.c:3165
const vsf_linux_fd_op_t vsf_linux_key_fdop
Definition vsf_linux_fs.c:263
vsf_linux_fd_t * vsf_linux_rx_pipe(vsf_queue_stream_t *queue_stream)
Definition vsf_linux_fs.c:3264
vsf_linux_fd_t * vsf_linux_tx_stream(vsf_stream_t *stream)
Definition vsf_linux_fs.c:3184
const vsf_linux_fd_op_t __vsf_linux_fs_fdop
Definition vsf_linux_fs.c:200
int vsf_linux_fd_add_feature(int fd, uint_fast32_t feature)
Definition vsf_linux_fs.c:895
@ VSF_LINUX_FDOP_FEATURE_FS
Definition vsf_linux_fs.h:67
int vsf_linux_fs_bind_buffer(const char *pathname, void *buffer, uint_fast32_t feature, uint64_t size)
Definition vsf_linux_fs.c:2855
uint64_t offset
Definition vsf_memfs.h:49
uint32_t size
Definition vsf_memfs.h:50
uint8_t status
Definition vsf_tgui.h:139
struct event_t events[32]
Definition vsf_xboot.c:36