1 // kalloc.c 2 char *kalloc(int n); 3 void kfree(char *cp, int len); 4 void kinit(void); 5 6 // console.c 7 void cprintf(char *fmt, ...); 8 void panic(char *s); 9 10 // proc.c 11 struct proc; 12 struct jmpbuf; 13 void setupsegs(struct proc *); 14 struct proc * copyproc(struct proc*); 15 struct spinlock; 16 void sleep(void *, struct spinlock *); 17 void wakeup(void *); 18 void scheduler(void); 19 void proc_exit(void); 20 int proc_kill(int); 21 int proc_wait(void); 22 void yield(void); 23 24 // swtch.S 25 struct jmpbuf; 26 int setjmp(struct jmpbuf*); 27 void longjmp(struct jmpbuf*); 28 29 // trap.c 30 void tvinit(void); 31 void idtinit(void); 32 33 // string.c 34 void * memset(void *dst, int c, uint n); 35 int memcmp(const void *v1, const void *v2, uint n); 36 void *memmove(void *dst, const void *src, uint n); 37 int strncmp(const char *p, const char *q, uint n); 38 39 // syscall.c 40 void syscall(void); 41 42 // picirq.c 43 extern uint16_t irq_mask_8259A; 44 void irq_setmask_8259A(uint16_t mask); 45 void pic_init(void); 46 47 // mp.c 48 void mp_init(void); 49 void mp_startthem(void); 50 int mp_bcpu(void); 51 52 // lapic 53 extern uint32_t *lapicaddr; 54 void lapic_init(int); 55 void lapic_startap(uint8_t, int); 56 void lapic_timerinit(void); 57 void lapic_timerintr(void); 58 void lapic_enableintr(void); 59 void lapic_disableintr(void); 60 int cpu(void); 61 62 // spinlock.c 63 struct spinlock; 64 void acquire(struct spinlock*); 65 void release(struct spinlock*); 66 int holding(struct spinlock*); 67 68 // main.c 69 void load_icode(struct proc *p, uint8_t *binary, uint size); 70 71 // pipe.c 72 struct pipe; 73 struct fd; 74 int pipe_alloc(struct fd **fd1, struct fd **fd2); 75 void pipe_close(struct pipe *p, int writeable); 76 int pipe_write(struct pipe *p, char *addr, int n); 77 int pipe_read(struct pipe *p, char *addr, int n); 78 79 // fd.c 80 int fd_ualloc(void); 81 struct fd * fd_alloc(void); 82 void fd_close(struct fd *); 83 int fd_read(struct fd *fd, char *addr, int n); 84 int fd_write(struct fd *fd, char *addr, int n); 85 void fd_incref(struct fd *fd); 86 87 // ide.c 88 void ide_init(void); 89 void ide_intr(void); 90 void* ide_start_read(uint32_t secno, void *dst, uint nsecs); 91 int ide_finish_read(void *); 92 93