xv6-cs450/defs.h

101 lines
2.1 KiB
C
Raw Normal View History

2006-06-12 17:22:12 +02:00
// kalloc.c
char *kalloc(int n);
void kfree(char *cp, int len);
2006-06-15 18:02:20 +02:00
void kinit(void);
2006-06-12 17:22:12 +02:00
// console.c
void cprintf(char *fmt, ...);
void panic(char *s);
// proc.c
struct proc;
2006-07-11 03:07:40 +02:00
struct jmpbuf;
2006-06-15 18:02:20 +02:00
void setupsegs(struct proc *);
struct proc * copyproc(struct proc*);
struct spinlock;
void sleep(void *, struct spinlock *);
2006-06-15 21:58:01 +02:00
void wakeup(void *);
2006-07-11 03:07:40 +02:00
void scheduler(void);
void proc_exit(void);
int proc_kill(int);
int proc_wait(void);
void yield(void);
2006-07-11 03:07:40 +02:00
// swtch.S
struct jmpbuf;
int setjmp(struct jmpbuf*);
void longjmp(struct jmpbuf*);
2006-06-15 18:02:20 +02:00
// trap.c
void tvinit(void);
void idtinit(void);
2006-06-15 18:02:20 +02:00
// string.c
void * memset(void *dst, int c, uint n);
int memcmp(const void *v1, const void *v2, uint n);
void *memmove(void *dst, const void *src, uint n);
int strncmp(const char *p, const char *q, uint n);
2006-06-15 18:02:20 +02:00
// syscall.c
void syscall(void);
2006-06-16 22:29:25 +02:00
// picirq.c
2006-07-20 11:07:53 +02:00
extern ushort irq_mask_8259A;
void irq_setmask_8259A(ushort mask);
2006-06-16 22:29:25 +02:00
void pic_init(void);
2006-06-21 03:53:07 +02:00
// mp.c
void mp_init(void);
void mp_startthem(void);
2006-07-12 19:00:54 +02:00
int mp_bcpu(void);
// lapic
2006-07-20 11:07:53 +02:00
extern uint *lapicaddr;
2006-06-28 18:35:03 +02:00
void lapic_init(int);
2006-07-20 11:07:53 +02:00
void lapic_startap(uchar, int);
2006-06-28 18:35:03 +02:00
void lapic_timerinit(void);
void lapic_timerintr(void);
void lapic_enableintr(void);
void lapic_disableintr(void);
2006-07-12 19:00:54 +02:00
int cpu(void);
// spinlock.c
struct spinlock;
2006-07-17 07:00:25 +02:00
void acquire(struct spinlock*);
void release(struct spinlock*);
int holding(struct spinlock*);
2006-06-21 03:53:07 +02:00
2006-06-22 22:47:23 +02:00
// main.c
2006-07-20 11:07:53 +02:00
void load_icode(struct proc *p, uchar *binary, uint size);
2006-06-27 16:35:53 +02:00
// pipe.c
struct pipe;
struct fd;
int pipe_alloc(struct fd **fd1, struct fd **fd2);
void pipe_close(struct pipe *p, int writeable);
int pipe_write(struct pipe *p, char *addr, int n);
int pipe_read(struct pipe *p, char *addr, int n);
// fd.c
2006-07-17 03:25:22 +02:00
int fd_ualloc(void);
struct fd * fd_alloc(void);
2006-06-27 16:35:53 +02:00
void fd_close(struct fd *);
int fd_read(struct fd *fd, char *addr, int n);
int fd_write(struct fd *fd, char *addr, int n);
void fd_incref(struct fd *fd);
// ide.c
void ide_init(void);
2006-07-10 15:08:37 +02:00
void ide_intr(void);
void* ide_start_read(int diskno, uint secno, void *dst, uint nsecs);
2006-07-10 21:06:48 +02:00
int ide_finish_read(void *);
// bio.c
struct buf;
struct buf *bread(uint, uint);
void brelse(struct buf *);
// fs.c
struct inode * iget(uint dev, uint inum);
void iput(struct inode *ip);