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 cpunum(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 void exit(void); 107 int fork(void); 108 int growproc(int); 109 int kill(int); 110 void pinit(void); 111 void procdump(void); 112 void scheduler(void) __attribute__((noreturn)); 113 void sched(void); 114 void sleep(void*, struct spinlock*); 115 void userinit(void); 116 int wait(void); 117 void wakeup(void*); 118 void yield(void); 119 120 // swtch.S 121 void swtch(struct context**, struct context*); 122 123 // spinlock.c 124 void acquire(struct spinlock*); 125 void getcallerpcs(void*, uint*); 126 int holding(struct spinlock*); 127 void initlock(struct spinlock*, char*); 128 void release(struct spinlock*); 129 void pushcli(void); 130 void popcli(void); 131 132 // sleeplock.c 133 void acquiresleep(struct sleeplock*); 134 void releasesleep(struct sleeplock*); 135 int holdingsleep(struct sleeplock*); 136 void initsleeplock(struct sleeplock*, char*); 137 138 // string.c 139 int memcmp(const void*, const void*, uint); 140 void* memmove(void*, const void*, uint); 141 void* memset(void*, int, uint); 142 char* safestrcpy(char*, const char*, int); 143 int strlen(const char*); 144 int strncmp(const char*, const char*, uint); 145 char* strncpy(char*, const char*, int); 146 147 // syscall.c 148 int argint(int, int*); 149 int argptr(int, char**, int); 150 int argstr(int, char**); 151 int fetchint(uint, int*); 152 int fetchstr(uint, char**); 153 void syscall(void); 154 155 // timer.c 156 void timerinit(void); 157 158 // trap.c 159 void idtinit(void); 160 extern uint ticks; 161 void tvinit(void); 162 extern struct spinlock tickslock; 163 164 // uart.c 165 void uartinit(void); 166 void uartintr(void); 167 void uartputc(int); 168 169 // vm.c 170 void seginit(void); 171 void kvmalloc(void); 172 pde_t* setupkvm(void); 173 char* uva2ka(pde_t*, char*); 174 int allocuvm(pde_t*, uint, uint); 175 int deallocuvm(pde_t*, uint, uint); 176 void freevm(pde_t*); 177 void inituvm(pde_t*, char*, uint); 178 int loaduvm(pde_t*, char*, struct inode*, uint, uint); 179 pde_t* copyuvm(pde_t*, uint); 180 void switchuvm(struct proc*); 181 void switchkvm(void); 182 int copyout(pde_t*, uint, void*, uint); 183 void clearpteu(pde_t *pgdir, char *uva); 184 185 // number of elements in fixed-size array 186 #define NELEM(x) (sizeof(x)/sizeof((x)[0])) 187