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