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
This commit is contained in:
Axel Dörfler
2002-10-08 03:19:57 +00:00
parent edef81d01c
commit 11fe0cb8de
6 changed files with 26 additions and 8 deletions
+1
View File
@@ -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);
+2 -2
View File
@@ -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 <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);
}
+3 -4
View File
@@ -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 *);
};
+12
View File
@@ -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);
+1
View File
@@ -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,