#ifndef __UCOS_DEV_H__ #define __UCOS_DEV_H__ #include #include typedef struct sys_table_t { int (*fork_r)(struct _reent *r); int (*kill_r)(struct _reent *r, int pid, int sig); int (*execve_r)(struct _reent *r, const char *, char *const *, char *const *); int (*wait_r)(struct _reent *r, int *); void (*exit)(int ret); int (*gettimeofday_r)(struct _reent *r, struct timeval *tp, void *tzp); _CLOCK_T_ (*times_r)(struct _reent *, struct tms *); int (*getpid_r)(struct _reent *r); int (*creat_r)(struct _reent *r, const char *path, int mode); void* (*sbrk_r)(struct _reent *r, ptrdiff_t ptrdiff); int (*isatty_r)(struct _reent *r, int fd); } sys_table_t; extern sys_table_t *g_p_sys_table; typedef struct io_device_table_t { const char *name; void *p_internals; int (*open_r )( struct _reent *r, const char *path, int flags, int mode ); int (*close_r )( struct _reent *r, int fd ); long (*write_r )( struct _reent *r, int fd, const char *ptr, int len ); long (*read_r )( struct _reent *r, int fd, char *ptr, int len ); off_t (*lseek_r) (struct _reent *r, int fd, off_t offset, int whence); int (*fstat_r) (struct _reent *r, int fd, struct stat *buf); } io_device_table_t; extern io_device_table_t *g_device_tables[]; #endif /* __UCOS_DEV_H__ */