xv6-simplified 0.1
简化版xv6
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1
10// 文件描述符
11struct file {
13 int ref; // 引用数
16 struct pipe* pipe; // FD_PIPE
17 // struct inode* ip; // FD_INODE 和 FD_DEVICE
18 struct dirent* entry; // 目录项
19 uint off; // FD_ENTRY
20 short major; // FD_DEVICE
21};
22
23struct devsw {
24 int (*read)(int, uint64, int);
25 int (*write)(int, uint64, int);
26};
27
28extern struct devsw devsw[];
29
30#define CONSOLE 1
31
32// #define major(dev) ((dev) >> 16 & 0xFFFF)
33// #define minor(dev) ((dev) & 0xFFFF)
34// #define mkdev(m,n) ((uint)((m)<<16| (n)))
Definition file.h:23
int(* read)(int, uint64, int)
Definition file.h:24
int(* write)(int, uint64, int)
Definition file.h:25
Definition fat32.h:31
Definition file.h:11
@ FD_DEVICE
Definition file.h:12
@ FD_ENTRY
Definition file.h:12
@ FD_NONE
Definition file.h:12
@ FD_PIPE
Definition file.h:12
uint off
Definition file.h:19
struct pipe * pipe
Definition file.h:16
char writable
Definition file.h:15
char readable
Definition file.h:14
struct dirent * entry
Definition file.h:18
short major
Definition file.h:20
int ref
Definition file.h:13
enum file::@0 type
unsigned long uint64
Definition types.h:24
unsigned int uint
Definition types.h:11