xv6-cs450/defs.h

69 lines
1.5 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);
2006-06-26 17:11:19 +02:00
void cons_putc(int);
2006-06-12 17:22:12 +02:00
// proc.c
struct proc;
2006-06-15 18:02:20 +02:00
void setupsegs(struct proc *);
struct proc * newproc(void);
void swtch(void);
2006-06-15 21:58:01 +02:00
void sleep(void *);
void wakeup(void *);
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 * memcpy(void *dst, void *src, unsigned n);
void * memset(void *dst, int c, unsigned n);
2006-06-21 03:53:07 +02:00
int memcmp(const void *v1, const void *v2, unsigned n);
void *memmove(void *dst, const void *src, unsigned n);
2006-06-15 18:02:20 +02:00
// syscall.c
void syscall(void);
2006-06-16 22:29:25 +02:00
// picirq.c
void irq_setmask_8259A(uint16_t mask);
void pic_init(void);
2006-06-21 03:53:07 +02:00
// mp.c
void mp_init(void);
2006-06-22 22:47:23 +02:00
int cpu(void);
int mp_isbcpu(void);
2006-06-28 18:35:03 +02:00
void lapic_init(int);
void lapic_timerinit(void);
void lapic_timerintr(void);
void lapic_enableintr(void);
void lapic_disableintr(void);
// spinlock.c
extern uint32_t kernel_lock;
void acquire_spinlock(uint32_t* lock);
void release_spinlock(uint32_t* lock);
void release_grant_spinlock(uint32_t* lock, int cpu);
2006-06-21 03:53:07 +02:00
2006-06-22 22:47:23 +02:00
// main.c
void load_icode(struct proc *p, uint8_t *binary, unsigned 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
int fd_ualloc();
struct fd * fd_alloc();
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);