diff -rbup synth/arch/current/ChangeLog /opt/ecos/ecos/packages/hal/synth/arch/current/ChangeLog --- synth/arch/current/ChangeLog Fri Jun 18 09:25:16 2004 +++ /opt/ecos/ecos/packages/hal/synth/arch/current/ChangeLog Mon Jun 21 09:53:55 2004 @@ -1,3 +1,10 @@ +2004-06-21 Alexander Neundorf + + * include/hal_io.h: + Add cyg_hal_sys_readdir(), cyg_hal_sys_lstat(), + cyg_hal_sys_fstat() system call toegther with their + accompanying data structures and file mode bits + 2004-06-18 William Donahue * include/hal_io.h (CYG_HAL_SYS_FD_ZERO): Added misisng } diff -rbup synth/arch/current/include/hal_io.h /opt/ecos/ecos/packages/hal/synth/arch/current/include/hal_io.h --- synth/arch/current/include/hal_io.h Fri Jun 18 09:25:19 2004 +++ /opt/ecos/ecos/packages/hal/synth/arch/current/include/hal_io.h Mon Jun 21 09:54:57 2004 @@ -381,6 +381,19 @@ struct cyg_hal_sys_itimerval { #define CYG_HAL_SYS_S_IWOTH (CYG_HAL_SYS_S_IWGRP>>3) #define CYG_HAL_SYS_S_IXOTH (CYG_HAL_SYS_S_IXGRP>>3) +#define CYG_HAL_SYS_S_IFMT 0170000 /*bitmask for the file type bitfields*/ +#define CYG_HAL_SYS_S_IFSOCK 0140000 /*socket*/ +#define CYG_HAL_SYS_S_IFLNK 0120000 /*symbolic link*/ +#define CYG_HAL_SYS_S_IFREG 0100000 /*regular file*/ +#define CYG_HAL_SYS_S_IFBLK 0060000 /*block device*/ +#define CYG_HAL_SYS_S_IFDIR 0040000 /*directory*/ +#define CYG_HAL_SYS_S_IFCHR 0020000 /*character device*/ +#define CYG_HAL_SYS_S_IFIFO 0010000 /*fifo*/ +#define CYG_HAL_SYS_S_ISUID 0004000 /*set UID bit*/ +#define CYG_HAL_SYS_S_ISGID 0002000 /*set GID bit (see below)*/ +#define CYG_HAL_SYS_S_ISVTX 0001000 /*sticky bit (see below)*/ + + struct cyg_hal_sys_mmap_args { unsigned long addr; unsigned long len; @@ -402,6 +415,41 @@ struct cyg_hal_sys_mmap_args { #define CYG_HAL_SYS_MAP_FIXED 0x10 /* Interpret addr exactly. */ // System calls, or rather the subset that is needed internally. +struct cyg_hal_sys_dirent +{ + unsigned long d_ino; + unsigned long d_off; + unsigned short int d_reclen; + char d_name[256]; +}; + +struct cyg_hal_sys_timespec +{ + unsigned int tv_sec; + unsigned int tv_nsec; +}; + +struct cyg_hal_sys_stat +{ + unsigned int dev; /* inode */ + unsigned long ino; /* device */ + unsigned short mode; /* protection */ + unsigned short nlink; /* number of hard links */ + unsigned short uid; /* user ID of owner */ + unsigned short gid; /* group ID of owner */ + unsigned long rdev; /* device type (if inode device) */ + unsigned long size; /* total size, in bytes */ + unsigned int blksize; /* blocksize for filesystem I/O */ + unsigned int blocks; /* number of blocks allocated */ + struct cyg_hal_sys_timespec atime; /* time of last access */ + struct cyg_hal_sys_timespec mtime; /* time of last modification */ + struct cyg_hal_sys_timespec ctime; /* time of last change */ +}; + +externC int cyg_hal_sys_readdir(unsigned int fd, struct cyg_hal_sys_dirent *dp, unsigned int count); +externC int cyg_hal_sys_lstat(const char* name, struct cyg_hal_sys_stat *buf); +externC int cyg_hal_sys_fstat(int fd, struct cyg_hal_sys_stat *buf); + externC unsigned long cyg_hal_sys_write(int, const void*, long); externC unsigned long cyg_hal_sys_read(int, void*, long); externC int cyg_hal_sys_lseek(int, int, int); diff -rbup synth/i386linux/current/ChangeLog /opt/ecos/ecos/packages/hal/synth/i386linux/current/ChangeLog --- synth/i386linux/current/ChangeLog Thu Apr 22 17:26:55 2004 +++ /opt/ecos/ecos/packages/hal/synth/i386linux/current/ChangeLog Mon Jun 21 10:04:12 2004 @@ -1,3 +1,9 @@ +2004-06-21 Alexander Neundorf + + * src/syscall-i386-linux-1.0.S: + Add readdir, lstat and fstat system calls + + 2004-04-22 Jani Monoses * cdl/hal_synth_i386.cdl : diff -rbup synth/i386linux/current/src/syscall-i386-linux-1.0.S /opt/ecos/ecos/packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S --- synth/i386linux/current/src/syscall-i386-linux-1.0.S Sun Sep 15 19:53:47 2002 +++ /opt/ecos/ecos/packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S Fri Jun 4 14:27:17 2004 @@ -436,3 +436,7 @@ SYSCALL3(writev) SYSCALL1(fdatasync) SYSCALL2(getcwd) SYSCALL2(access) + +SYSCALL3(readdir) +STATCALL2(lstat) +STATCALL2(fstat)