diff options
Diffstat (limited to 'kernel/file.h')
-rw-r--r-- | kernel/file.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/file.h b/kernel/file.h index f28018f..5cf15a2 100644 --- a/kernel/file.h +++ b/kernel/file.h @@ -1,11 +1,12 @@ struct file { - enum { FD_NONE, FD_PIPE, FD_INODE } type; + enum { FD_NONE, FD_PIPE, FD_INODE, FD_DEVICE } type; int ref; // reference count char readable; char writable; - struct pipe *pipe; - struct inode *ip; - uint off; + struct pipe *pipe; // FD_PIPE + struct inode *ip; // FD_INODE and FD_DEVICE + uint off; // FD_INODE + short major; // FD_DEVICE }; @@ -25,11 +26,10 @@ struct inode { uint addrs[NDIRECT+1]; }; -// table mapping major device number to -// device functions +// map major device number to device functions. struct devsw { - int (*read)(struct inode*, int, uint64, int); - int (*write)(struct inode*, int, uint64, int); + int (*read)(int, uint64, int); + int (*write)(int, uint64, int); }; extern struct devsw devsw[]; |