1 struct buf; 2 struct context; 3 struct file; 4 struct inode; 5 struct pipe; 6 struct proc; 7 struct rtcdate; 8 struct spinlock; 9 struct sleeplock; 10 struct stat; 11 struct superblock; 12 13 // bio.c 14 void binit(void); 15 struct buf* bread(uint, uint); 16 void brelse(struct buf*); 17 void bwrite(struct buf*); 18 19 // console.c 20 void consoleinit(void); 21 void cprintf(char*, ...); 22 void consoleintr(int(*)(void)); 23 void panic(char*) __attribute__((noreturn)); 24 25 // exec.c 26 int exec(char*, char**); 27 28 // file.c 29 struct file* filealloc(void); 30 void fileclose(struct file*); 31 struct file* filedup(struct file*); 32 void fileinit(void); 33 int fileread(struct file*, char*, int n); 34 int filestat(struct file*, struct stat*); 35 int filewrite(struct file*, char*, int n); 36 37 // fs.c 38 void readsb(int dev, struct superblock *sb); 39 int dirlink(struct inode*, char*, uint); 40 struct inode* dirlookup(struct inode*, char*, uint*); 41 struct inode* ialloc(uint, short); 42 struct inode* idup(struct inode*); 43 void iinit(int dev); 44 void ilock(struct inode*); 45 void iput(struct inode*); 46 void iunlock(struct inode*); 47 void iunlockput(struct inode*); 48 void iupdate(struct inode*); 49 int namecmp(const char*, const char*); 50 struct inode* namei(char*); 51 struct inode* nameiparent(char*, char*); 52 int readi(struct inode*, char*, uint, uint); 53 void stati(struct inode*, struct stat*); 54 int writei(struct inode*, char*, uint, uint); 55 56 // ide.c 57 void ideinit(void); 58 void ideintr(void); 59 void iderw(struct buf*); 60 61 // ioapic.c 62 void ioapicenable(int irq, int cpu); 63 extern uchar ioapicid; 64 void ioapicinit(void); 65 66 // kalloc.c 67 char* kalloc(void); 68 void kfree(char*); 69 void kinit1(void*, void*); 70 void kinit2(void*, void*); 71 72 // kbd.c 73 void kbdintr(void); 74 75 // lapic.c 76 void cmostime(struct rtcdate *r); 77 int lapiccpunum(void); 78 extern volatile uint* lapic; 79 void lapiceoi(void); 80 void lapicinit(void); 81 void lapicstartap(uchar, uint); 82 void microdelay(int); 83 84 // log.c 85 void initlog(int dev); 86 void log_write(struct buf*); 87 void begin_op(); 88 void end_op(); 89 90 // mp.c 91 extern int ismp; 92 void mpinit(void); 93 94 // picirq.c 95 void picenable(int); 96 void picinit(void); 97 98 // pipe.c 99 int pipealloc(struct file**, struct file**); 100 void pipeclose(struct pipe*, int); 101 int piperead(struct pipe*, char*, int); 102 int pipewrite(struct pipe*, char*, int); 103 104 //PAGEBREAK: 16 105 // proc.c 106 int cpuid(void); 107 void exit(void); 108 int fork(void); 109 int growproc(int); 110 int kill(int); 111 struct proc* myproc(); 112 void pinit(void); 113 void procdump(void); 114 void scheduler(void) __attribute__((noreturn)); 115 void sched(void); 116 void setproc(struct proc*); 117 void sleep(void*, struct spinlock*); 118 void userinit(void); 119 int wait(void); 120 void wakeup(void*); 121 void yield(void); 122 123 // swtch.S 124 void swtch(struct context**, struct context*); 125 126 // spinlock.c 127 void acquire(struct spinlock*); 128 void getcallerpcs(void*, uint*); 129 int holding(struct spinlock*); 130 void initlock(struct spinlock*, char*); 131 void release(struct spinlock*); 132 void pushcli(void); 133 void popcli(void); 134 135 // sleeplock.c 136 void acquiresleep(struct sleeplock*); 137 void releasesleep(struct sleeplock*); 138 int holdingsleep(struct sleeplock*); 139 void initsleeplock(struct sleeplock*, char*); 140 141 // string.c 142 int memcmp(const void*, const void*, uint); 143 void* memmove(void*, const void*, uint); 144 void* memset(void*, int, uint); 145 char* safestrcpy(char*, const char*, int); 146 int strlen(const char*); 147 int strncmp(const char*, const char*, uint); 148 char* strncpy(char*, const char*, int); 149 150 // syscall.c 151 int argint(int, int*); 152 int argptr(int, char**, int); 153 int argstr(int, char**); 154 int fetchint(uint, int*); 155 int fetchstr(uint, char**); 156 void syscall(void); 157 158 // timer.c 159 void timerinit(void); 160 161 // trap.c 162 void idtinit(void); 163 extern uint ticks; 164 void tvinit(void); 165 extern struct spinlock tickslock; 166 167 // uart.c 168 void uartinit(void); 169 void uartintr(void); 170 void uartputc(int); 171 172 // vm.c 173 void seginit(void); 174 void kvmalloc(void); 175 pde_t* setupkvm(void); 176 char* uva2ka(pde_t*, char*); 177 int allocuvm(pde_t*, uint, uint); 178 int deallocuvm(pde_t*, uint, uint); 179 void freevm(pde_t*); 180 void inituvm(pde_t*, char*, uint); 181 int loaduvm(pde_t*, char*, struct inode*, uint, uint); 182 pde_t* copyuvm(pde_t*, uint); 183 void switchuvm(struct proc*); 184 void switchkvm(void); 185 int copyout(pde_t*, uint, void*, uint); 186 void clearpteu(pde_t *pgdir, char *uva); 187 188 // number of elements in fixed-size array 189 #define NELEM(x) (sizeof(x)/sizeof((x)[0])) 190