forked from mit-pdos/xv6-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefs.h
131 lines (114 loc) · 3.08 KB
/
defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// kalloc.c
char *kalloc(int n);
void kfree(char *cp, int len);
void kinit(void);
// console.c
void console_init(void);
void cprintf(char *fmt, ...);
void panic(char *s);
void kbd_intr(void);
// proc.c
void pinit(void);
struct proc;
struct jmpbuf;
void setupsegs(struct proc *);
struct proc * copyproc(struct proc*);
struct spinlock;
uint growproc(int);
void sleep(void *, struct spinlock *);
void wakeup(void *);
void scheduler(void);
void proc_exit(void);
int proc_kill(int);
int proc_wait(void);
void yield(void);
// swtch.S
struct jmpbuf;
int setjmp(struct jmpbuf*);
void longjmp(struct jmpbuf*);
// trap.c
void tvinit(void);
void idtinit(void);
// string.c
void * memset(void *dst, int c, uint n);
int memcmp(const void *v1, const void *v2, uint n);
void *memmove(void *dst, const void *src, uint n);
int strncmp(const char *p, const char *q, uint n);
// syscall.c
void syscall(void);
// picirq.c
void pic_init(void);
// mp.c
void mp_init(void);
void mp_startthem(void);
int mp_bcpu(void);
// lapic
extern uint *lapicaddr;
void lapic_init(int);
void lapic_startap(uchar, int);
void lapic_timerinit(void);
void lapic_timerintr(void);
void lapic_enableintr(void);
void lapic_disableintr(void);
void lapic_eoi(void);
int cpu(void);
// ioapic
extern uchar ioapic_id;
void ioapic_init(void);
void ioapic_enable (int irq, int cpu);
// spinlock.c
struct spinlock;
void initlock(struct spinlock *, char *);
void acquire(struct spinlock*);
void release(struct spinlock*);
int holding(struct spinlock*);
// main.c
void load_icode(struct proc *p, uchar *binary, uint size);
// pipe.c
struct pipe;
struct fd;
int pipe_alloc(struct fd **fd1, struct fd **fd2);
void pipe_close(struct pipe *p, int writeable);
int pipe_write(struct pipe *p, char *addr, int n);
int pipe_read(struct pipe *p, char *addr, int n);
// fd.c
struct stat;
void fd_init(void);
int fd_ualloc(void);
struct fd * fd_alloc(void);
void fd_close(struct fd *);
int fd_read(struct fd *fd, char *addr, int n);
int fd_write(struct fd *fd, char *addr, int n);
int fd_stat(struct fd *fd, struct stat *);
void fd_incref(struct fd *fd);
// ide.c
void ide_init(void);
void ide_intr(void);
void* ide_start_rw(int diskno, uint secno, void *dst, uint nsecs, int read);
int ide_finish(void *);
// bio.c
void binit(void);
struct buf;
struct buf * getblk(uint dev, uint sector);
struct buf *bread(uint, uint);
void bwrite(struct buf *, uint);
void brelse(struct buf *);
// fs.c
extern uint rootdev;
void iinit(void);
struct inode * iget(uint dev, uint inum);
void ilock(struct inode *ip);
void iunlock(struct inode *ip);
void itrunc(struct inode *ip);
void idecref(struct inode *ip);
void iincref(struct inode *ip);
void iput(struct inode *ip);
struct inode * namei(char *path, int, uint *, char **, struct inode **);
void stati(struct inode *ip, struct stat *st);
int readi(struct inode *ip, char *xdst, uint off, uint n);
int writei(struct inode *ip, char *addr, uint off, uint n);
struct inode *mknod(char *, short, short, short);
struct inode * mknod1(struct inode *, char *, short, short, short);
int unlink(char *cp);
void iupdate (struct inode *ip);
int link(char *file1, char *file2);