miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
syscall_fs.c File Reference
#include <miniOS/syscall.h>
#include <miniOS/sched/sched.h>
#include <miniOS/fs/vfs.h>
#include <miniOS/fs/pipe.h>
#include <miniOS/mm/heap.h>
#include <miniOS/mm/vmm.h>
#include <miniOS/types.h>
#include <miniOS/drivers/tty.h>
#include <miniOS/net/net_socket.h>
#include <miniOS/net/unix_sock.h>
#include <string.h>
#include <stdint.h>
#include "syscall_internal.h"
Include dependency graph for syscall_fs.c:

Classes

struct  mini_pollfd
struct  mini_timeval_t
struct  mini_fd_set_t
struct  __attribute__
struct  getdents_state_t
struct  kernel_stat_t
struct  kernel_statfs_t

Macros

#define POLLIN   0x0001
#define POLLOUT   0x0004
#define POLLERR   0x0008
#define POLLHUP   0x0010
#define POLLNVAL   0x0020
#define KST_IFREG   0100000U
#define KST_IFDIR   0040000U
#define KST_IFCHR   0020000U
#define KST_IFBLK   0060000U

Functions

static uint64_t fs_rdtsc (void)
struct mini_pollfd __attribute__ ((packed))
static int getdents_cb (const char *name, uint8_t name_len, uint32_t inode, uint8_t file_type, void *ud)
static int socket_has_other_fd_ref (struct thread *thread, int closing_fd, net_sock_t *sock)
static void populate_stat (const vfs_inode_info_t *info, kernel_stat_t *st)
static uint32_t synthetic_access_bits (const vfs_inode_info_t *info)
int64_t syscall_dispatch_fs (uint64_t nr, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6)

Variables

typedef __attribute__
uint64_t miniOS_tsc_hz
uint64_t miniOS_tsc_boot
int fd
short events
short revents

Macro Definition Documentation

◆ KST_IFBLK

#define KST_IFBLK   0060000U

◆ KST_IFCHR

#define KST_IFCHR   0020000U

◆ KST_IFDIR

#define KST_IFDIR   0040000U

◆ KST_IFREG

#define KST_IFREG   0100000U

◆ POLLERR

#define POLLERR   0x0008

◆ POLLHUP

#define POLLHUP   0x0010

◆ POLLIN

#define POLLIN   0x0001

◆ POLLNVAL

#define POLLNVAL   0x0020

◆ POLLOUT

#define POLLOUT   0x0004

Function Documentation

◆ __attribute__()

struct mini_pollfd __attribute__ ( (packed) )

◆ fs_rdtsc()

uint64_t fs_rdtsc ( void )
inlinestatic
Here is the caller graph for this function:

◆ getdents_cb()

int getdents_cb ( const char * name,
uint8_t name_len,
uint32_t inode,
uint8_t file_type,
void * ud )
static
Here is the caller graph for this function:

◆ populate_stat()

void populate_stat ( const vfs_inode_info_t * info,
kernel_stat_t * st )
static
Here is the caller graph for this function:

◆ socket_has_other_fd_ref()

int socket_has_other_fd_ref ( struct thread * thread,
int closing_fd,
net_sock_t * sock )
static
Here is the caller graph for this function:

◆ synthetic_access_bits()

uint32_t synthetic_access_bits ( const vfs_inode_info_t * info)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ syscall_dispatch_fs()

int64_t syscall_dispatch_fs ( uint64_t nr,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
uint64_t arg4,
uint64_t arg5,
uint64_t arg6 )
Here is the caller graph for this function:

Variable Documentation

◆ __attribute__

typedef __attribute__

◆ events

short events

◆ fd

int fd

◆ miniOS_tsc_boot

uint64_t miniOS_tsc_boot
extern

◆ miniOS_tsc_hz

uint64_t miniOS_tsc_hz
extern

◆ revents

short revents