mirror of
https://github.com/drasko/codezero.git
synced 2026-02-26 16:53:14 +01:00
Added per-task curdir. and chdir, pager_read/write, mmap and munmap calls.
They look like what they should look like, but untested.
This commit is contained in:
@@ -86,7 +86,7 @@ struct dentry {
|
||||
struct list_head children; /* List of children dentries */
|
||||
struct list_head vref; /* For vnode's dirent reference list */
|
||||
struct list_head cache_list; /* Dentry cache reference */
|
||||
struct vnode *vnode; /* The vnode associated with dirent */
|
||||
struct vnode *vnode; /* The vnode associated with dentry */
|
||||
struct dentry_ops ops;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,9 +6,16 @@
|
||||
#ifndef __FS0_SYSCALLS_H__
|
||||
#define __FS0_SYSCALLS_H__
|
||||
|
||||
/* Posix calls */
|
||||
int sys_open(l4id_t sender, char *pathname, int flags, u32 mode);
|
||||
int sys_read(l4id_t sender, int fd, void *buf, int cnt);
|
||||
int sys_write(l4id_t sender, int fd, void *buf, int cnt);
|
||||
int sys_lseek(l4id_t sender, int fd, unsigned long offset, int whence);
|
||||
int sys_readdir(l4id_t sender, int fd, void *buf, int count);
|
||||
int sys_mkdir(l4id_t sender, const char *pathname, unsigned int mode);
|
||||
int sys_chdir(l4id_t sender, const char *pathname);
|
||||
|
||||
/* Calls from pager that completes a posix call */
|
||||
int pager_sys_read(l4id_t sender, unsigned long vnum, unsigned long f_offset,
|
||||
unsigned long npages, void *pagebuf);
|
||||
|
||||
int pager_sys_write(l4id_t sender, unsigned long vnum, unsigned long f_offset,
|
||||
unsigned long npages, void *pagebuf);
|
||||
#endif /* __FS0_SYSCALLS_H__ */
|
||||
|
||||
@@ -18,6 +18,8 @@ struct tcb {
|
||||
struct list_head list;
|
||||
int fd[TASK_OFILES_MAX];
|
||||
struct id_pool *fdpool;
|
||||
struct vnode *curdir;
|
||||
struct vnode *rootdir;
|
||||
};
|
||||
|
||||
struct tcb *find_task(int tid);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <memfs/memfs.h>
|
||||
#include <l4/macros.h>
|
||||
#include <stdio.h>
|
||||
#include <task.h>
|
||||
|
||||
extern struct list_head vnode_cache;
|
||||
extern struct list_head dentry_cache;
|
||||
@@ -92,7 +93,7 @@ extern struct vfs_mountpoint vfs_root;
|
||||
|
||||
int vfs_mount_root(struct superblock *sb);
|
||||
struct vnode *generic_vnode_lookup(struct vnode *thisnode, char *path);
|
||||
struct vnode *vfs_lookup_bypath(struct superblock *sb, char *path);
|
||||
struct vnode *vfs_lookup_bypath(struct tcb *task, char *path);
|
||||
struct vnode *vfs_lookup_byvnum(struct superblock *sb, unsigned long vnum);
|
||||
|
||||
#endif /* __VFS_H__ */
|
||||
|
||||
Reference in New Issue
Block a user