0
|
1 struct buf;
|
|
2 struct context;
|
|
3 struct file;
|
|
4 struct inode;
|
|
5 struct pipe;
|
|
6 struct proc;
|
|
7 struct spinlock;
|
|
8 struct stat;
|
|
9 struct superblock;
|
|
10
|
|
11 void OkLoop(void);
|
|
12 void NotOkLoop(void);
|
|
13
|
|
14 // mmu.c
|
|
15 void mmuinit0(void);
|
|
16 void mmuinit1(void);
|
|
17 void barriers(void);
|
|
18 void dsb_barrier(void);
|
|
19 void flush_tlb(void);
|
|
20 void flush_dcache_all(void);
|
|
21 void flush_dcache(uint va1, uint va2);
|
|
22 void flush_idcache(void);
|
|
23 void set_pgtbase(uint base);
|
|
24
|
|
25 // bio.c
|
|
26 void binit(void);
|
|
27 struct buf* bread(uint, uint);
|
|
28 void brelse(struct buf*);
|
|
29 void bwrite(struct buf*);
|
|
30
|
|
31 // console.c
|
|
32 void consoleinit(void);
|
|
33 void cprintf(char*, ...);
|
|
34 void consoleintr(int(*)(void));
|
|
35 void panic(char*) __attribute__((noreturn));
|
|
36 void drawcharacter(u8, uint, uint);
|
|
37 void gpuputc(uint);
|
|
38 void gpuinit(void);
|
|
39
|
|
40
|
|
41 // fs.c
|
|
42 void readsb(int dev, struct superblock *sb);
|
|
43 int dirlink(struct inode*, char*, uint);
|
|
44 struct inode* dirlookup(struct inode*, char*, uint*);
|
|
45 struct inode* ialloc(uint, short);
|
|
46 struct inode* idup(struct inode*);
|
|
47 void iinit(void);
|
|
48 void ilock(struct inode*);
|
|
49 void iput(struct inode*);
|
|
50 void iunlock(struct inode*);
|
|
51 void iunlockput(struct inode*);
|
|
52 void iupdate(struct inode*);
|
|
53 int namecmp(const char*, const char*);
|
|
54 struct inode* namei(char*);
|
|
55 struct inode* nameiparent(char*, char*);
|
|
56 int readi(struct inode*, char*, uint, uint);
|
|
57 void stati(struct inode*, struct stat*);
|
|
58 int writei(struct inode*, char*, uint, uint);
|
|
59
|
|
60
|
|
61 // ide.c
|
|
62 void ideinit(void);
|
|
63 void ideintr(void);
|
|
64 void iderw(struct buf*);
|
|
65
|
|
66 // exec.c
|
|
67 int exec(char*, char**);
|
|
68
|
|
69 // file.c
|
|
70 struct file* filealloc(void);
|
|
71 void fileclose(struct file*);
|
|
72 struct file* filedup(struct file*);
|
|
73 void fileinit(void);
|
|
74 int fileread(struct file*, char*, int n);
|
|
75 int filestat(struct file*, struct stat*);
|
|
76 int filewrite(struct file*, char*, int n);
|
|
77
|
|
78
|
|
79 // fs.c
|
|
80 void readsb(int dev, struct superblock *sb);
|
|
81 int dirlink(struct inode*, char*, uint);
|
|
82 struct inode* dirlookup(struct inode*, char*, uint*);
|
|
83 struct inode* ialloc(uint, short);
|
|
84 struct inode* idup(struct inode*);
|
|
85 void iinit(void);
|
|
86 void ilock(struct inode*);
|
|
87 void iput(struct inode*);
|
|
88 void iunlock(struct inode*);
|
|
89 void iunlockput(struct inode*);
|
|
90 void iupdate(struct inode*);
|
|
91 int namecmp(const char*, const char*);
|
|
92 struct inode* namei(char*);
|
|
93 struct inode* nameiparent(char*, char*);
|
|
94 int readi(struct inode*, char*, uint, uint);
|
|
95 void stati(struct inode*, struct stat*);
|
|
96 int writei(struct inode*, char*, uint, uint);
|
|
97
|
|
98 // kalloc.c
|
|
99 char* kalloc(void);
|
|
100 void kfree(char*);
|
|
101 void kinit1(void*, void*);
|
|
102 void kinit2(void*, void*);
|
|
103
|
|
104
|
|
105 // log.c
|
|
106 void initlog(void);
|
|
107 void log_write(struct buf*);
|
|
108 void begin_trans();
|
|
109 void commit_trans();
|
|
110
|
|
111 // pipe.c
|
|
112 int pipealloc(struct file**, struct file**);
|
|
113 void pipeclose(struct pipe*, int);
|
|
114 int piperead(struct pipe*, char*, int);
|
|
115 int pipewrite(struct pipe*, char*, int);
|
|
116
|
|
117 //PAGEBREAK: 16
|
|
118 // proc.c
|
|
119 struct proc* copyproc(struct proc*);
|
|
120 void exit(void);
|
|
121 int fork(void);
|
|
122 int growproc(int);
|
|
123 int kill(int);
|
|
124 void pinit(void);
|
|
125 void procdump(void);
|
|
126 void scheduler(void) __attribute__((noreturn));
|
|
127 void sched(void);
|
|
128 void sleep(void*, struct spinlock*);
|
|
129 void userinit(void);
|
|
130 int wait(void);
|
|
131 void wakeup(void*);
|
|
132 void yield(void);
|
|
133
|
|
134
|
|
135 // swtch.S
|
|
136 void swtch(struct context**, struct context*);
|
|
137
|
|
138 // syscall.c
|
|
139 int argint(int, int*);
|
|
140 int argptr(int, char**, int);
|
|
141 int argstr(int, char**);
|
|
142 int fetchint(uint, int*);
|
|
143 int fetchstr(uint, char**);
|
|
144 void syscall(void);
|
|
145
|
|
146 void kvmalloc(void);
|
|
147
|
|
148
|
|
149 int UsbInitialise(void);
|
|
150 void KeyboardUpdate(void);
|
|
151 char KeyboardGetChar(void);
|
|
152 uint KeyboardCount(void);
|
|
153 uint KeyboardGetAddress(uint);
|
|
154 struct KeyboardLeds KeyboardGetLedSupport(uint);
|
|
155
|
|
156 // spinlock.c
|
|
157 void acquire(struct spinlock*);
|
|
158 void getcallerpcs(void*, uint*);
|
|
159 int holding(struct spinlock*);
|
|
160 void initlock(struct spinlock*, char*);
|
|
161 void release(struct spinlock*);
|
|
162 void pushcli(void);
|
|
163 void popcli(void);
|
|
164
|
|
165 // string.c
|
|
166 int memcmp(const void*, const void*, uint);
|
|
167 void* memmove(void*, const void*, uint);
|
|
168 void* memset(void*, int, uint);
|
|
169 char* safestrcpy(char*, const char*, int);
|
|
170 int strlen(const char*);
|
|
171 int strncmp(const char*, const char*, uint);
|
|
172 char* strncpy(char*, const char*, int);
|
|
173 uint div(uint n, uint d);
|
|
174
|
|
175 // syscall.c
|
|
176 int argint(int, int*);
|
|
177 int argptr(int, char**, int);
|
|
178 int argstr(int, char**);
|
|
179 int fetchint(uint, int*);
|
|
180 int fetchstr(uint, char**);
|
|
181 void syscall(void);
|
|
182
|
|
183 // timer.c
|
|
184 void timer3init(void);
|
|
185 void timer3intr(void);
|
|
186 unsigned long long getsystemtime(void);
|
|
187 void delay(uint);
|
|
188
|
|
189 // trap.c
|
|
190 void tvinit(void);
|
|
191 void sti(void);
|
|
192 void cli(void);
|
|
193 void disable_intrs(void);
|
|
194 void enable_intrs(void);
|
|
195 extern uint ticks;
|
|
196 extern struct spinlock tickslock;
|
|
197 uint readcpsr(void);
|
|
198
|
|
199 // uart.c
|
|
200 void uartinit(void);
|
|
201 void miniuartintr(void);
|
|
202 void uartputc(uint);
|
|
203 void setgpiofunc(uint, uint);
|
|
204 void setgpioval(uint, uint);
|
|
205
|
|
206 // vm.c
|
|
207 void seginit(void);
|
|
208 void kvmalloc(void);
|
|
209 void vmenable(void);
|
|
210 pde_t* setupkvm(void);
|
|
211 char* uva2ka(pde_t*, char*);
|
|
212 int allocuvm(pde_t*, uint, uint);
|
|
213 int deallocuvm(pde_t*, uint, uint);
|
|
214 void freevm(pde_t*);
|
|
215 void inituvm(pde_t*, char*, uint);
|
|
216 int loaduvm(pde_t*, char*, struct inode*, uint, uint);
|
|
217 pde_t* copyuvm(pde_t*, uint);
|
|
218 void switchuvm(struct proc*);
|
|
219 void switchkvm(void);
|
|
220 int copyout(pde_t*, uint, void*, uint);
|
|
221 void clearpteu(pde_t *pgdir, char *uva);
|
|
222
|
|
223 // mailbox.c
|
|
224 uint readmailbox(u8);
|
|
225 void writemailbox(uint *, u8);
|
|
226 void create_request(volatile uint *mbuf, uint tag, uint buflen, uint len, uint *data);
|
|
227 void mailboxinit(void);
|
|
228
|
|
229
|
|
230
|
|
231 // number of elements in fixed-size array
|
|
232 #define NELEM(x) (sizeof(x)/sizeof((x)[0]))
|
|
233
|