From 11fe0cb8de932243324b119e4567e7d5d69c4540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 8 Oct 2002 03:19:57 +0000 Subject: [PATCH] Added prototypes for the sys_/user_ attribute calls. Changed the file_descriptor structure (more status_t, name removed). Changed "extern inline" to "static inline" in thread.h/arch_thread.h as those also work with -O0 -g. Added prototypes for [arch_cpu_]user_strlcpy(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1454 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/cpu.h | 1 + headers/private/kernel/arch/thread.h | 4 ++-- headers/private/kernel/arch/x86/arch_thread.h | 9 +++++++-- headers/private/kernel/fd.h | 7 +++---- headers/private/kernel/vfs.h | 12 ++++++++++++ headers/private/kernel/vm.h | 1 + 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/headers/private/kernel/arch/cpu.h b/headers/private/kernel/arch/cpu.h index 79801cb7c6..57fe19a384 100644 --- a/headers/private/kernel/arch/cpu.h +++ b/headers/private/kernel/arch/cpu.h @@ -41,6 +41,7 @@ void arch_cpu_global_TLB_invalidate(void); int arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr *fault_handler); int arch_cpu_user_strcpy(char *to, const char *from, addr *fault_handler); int arch_cpu_user_strncpy(char *to, const char *from, size_t size, addr *fault_handler); +int arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr *fault_handler); int arch_cpu_user_memset(void *s, char c, size_t count, addr *fault_handler); void arch_cpu_idle(void); diff --git a/headers/private/kernel/arch/thread.h b/headers/private/kernel/arch/thread.h index c3334fc7fc..4ad3e097d2 100644 --- a/headers/private/kernel/arch/thread.h +++ b/headers/private/kernel/arch/thread.h @@ -15,8 +15,8 @@ void arch_thread_dump_info(void *info); void arch_thread_enter_uspace(addr entry, void *args, addr ustack_top); void arch_thread_switch_kstack_and_call(struct thread *t, addr new_kstack, void (*func)(void *), void *arg); -struct thread *arch_thread_get_current_thread(void); -void arch_thread_set_current_thread(struct thread *t); +//struct thread *arch_thread_get_current_thread(void); +//void arch_thread_set_current_thread(struct thread *t); // for any inline overrides #include diff --git a/headers/private/kernel/arch/x86/arch_thread.h b/headers/private/kernel/arch/x86/arch_thread.h index 14fa30a446..f61167362c 100644 --- a/headers/private/kernel/arch/x86/arch_thread.h +++ b/headers/private/kernel/arch/x86/arch_thread.h @@ -16,13 +16,18 @@ void i386_push_iframe(struct thread *t, struct iframe *frame); void i386_pop_iframe(struct thread *t); -extern inline struct thread *arch_thread_get_current_thread(void) { +static +inline struct thread * +arch_thread_get_current_thread(void) +{ struct thread *t; read_dr3(t); return t; } -extern inline void arch_thread_set_current_thread(struct thread *t) { +static inline void +arch_thread_set_current_thread(struct thread *t) +{ write_dr3(t); } diff --git a/headers/private/kernel/fd.h b/headers/private/kernel/fd.h index 98234aa9f5..a1faf6ceee 100644 --- a/headers/private/kernel/fd.h +++ b/headers/private/kernel/fd.h @@ -27,16 +27,15 @@ struct io_context { }; struct fd_ops { - char *fs_name; // can be removed, it's not used anywhere ssize_t (*fd_read) (struct file_descriptor *, off_t pos, void *buffer, size_t *length); ssize_t (*fd_write)(struct file_descriptor *, off_t pos, const void *buffer, size_t *length); off_t (*fd_seek)(struct file_descriptor *, off_t pos, int seekType); - int (*fd_ioctl)(struct file_descriptor *, ulong op, void *buffer, size_t length); + status_t (*fd_ioctl)(struct file_descriptor *, ulong op, void *buffer, size_t length); // int (*fd_poll)(struct file_descriptor *, int); status_t (*fd_read_dir)(struct file_descriptor *,struct dirent *buffer,size_t bufferSize,uint32 *_count); status_t (*fd_rewind_dir)(struct file_descriptor *); - int (*fd_stat)(struct file_descriptor *, struct stat *); - int (*fd_close)(struct file_descriptor *); + status_t (*fd_stat)(struct file_descriptor *, struct stat *); + status_t (*fd_close)(struct file_descriptor *); void (*fd_free)(struct file_descriptor *); }; diff --git a/headers/private/kernel/vfs.h b/headers/private/kernel/vfs.h index 3cfd9bd2b7..e8e5562bd7 100755 --- a/headers/private/kernel/vfs.h +++ b/headers/private/kernel/vfs.h @@ -80,6 +80,12 @@ int sys_rename(const char *oldpath, const char *newpath); int sys_access(const char *path, int mode); int sys_read_stat(const char *path, bool traverseLink, struct stat *stat); int sys_write_stat(int fd, const char *path, bool traverseLink, struct stat *stat, int statMask); +int sys_open_attr_dir(int fd, const char *path); +int sys_create_attr(int fd, const char *name, uint32 type, int openMode); +int sys_open_attr(int fd, const char *name, int openMode); +int sys_write_attr_stat(int fd, const struct stat *stat, int statMask); +int sys_remove_attr(int fd, const char *name); +int sys_rename_attr(int fromFile, const char *fromName, int toFile, const char *toName); int sys_getcwd(char *buffer, size_t size); int sys_setcwd(int fd, const char *path); @@ -108,6 +114,12 @@ int user_rename(const char *oldpath, const char *newpath); int user_access(const char *path, int mode); int user_read_stat(const char *path, bool traverseLink, struct stat *stat); int user_write_stat(int fd, const char *path, bool traverseLink, struct stat *stat, int statMask); +int user_open_attr_dir(int fd, const char *path); +int user_create_attr(int fd, const char *name, uint32 type, int openMode); +int user_open_attr(int fd, const char *name, int openMode); +int user_write_attr_stat(int fd, const struct stat *stat, int statMask); +int user_remove_attr(int fd, const char *name); +int user_rename_attr(int fromFile, const char *fromName, int toFile, const char *toName); int user_getcwd(char *buffer, size_t size); int user_setcwd(int fd, const char *path); diff --git a/headers/private/kernel/vm.h b/headers/private/kernel/vm.h index bca0d38591..afab2e44ef 100755 --- a/headers/private/kernel/vm.h +++ b/headers/private/kernel/vm.h @@ -49,6 +49,7 @@ int vm_put_physical_page(addr vaddr); int user_memcpy(void *to, const void *from, size_t size); int user_strcpy(char *to, const char *from); int user_strncpy(char *to, const char *from, size_t size); +int user_strlcpy(char *to, const char *from, size_t size); int user_memset(void *s, char c, size_t count); region_id user_vm_create_anonymous_region(char *uname, void **uaddress, int addr_type,