xv6-65oo2/defs.h

95 lines
2.1 KiB
C
Raw Normal View History

2006-06-12 15:22:12 +00:00
// kalloc.c
char *kalloc(int n);
void kfree(char *cp, int len);
2006-06-15 16:02:20 +00:00
void kinit(void);
2006-06-12 15:22:12 +00:00
// console.c
void cprintf(char *fmt, ...);
void panic(char *s);
2006-06-26 15:11:19 +00:00
void cons_putc(int);
2006-06-12 15:22:12 +00:00
// proc.c
struct proc;
2006-07-11 01:07:40 +00:00
struct jmpbuf;
2006-06-15 16:02:20 +00:00
void setupsegs(struct proc *);
struct proc * copyproc(struct proc*);
struct spinlock;
void sleep(void *, struct spinlock *);
2006-06-15 19:58:01 +00:00
void wakeup(void *);
2006-07-11 01:07:40 +00:00
void scheduler(void);
void proc_exit(void);
int proc_kill(int);
int proc_wait(void);
void yield(void);
2006-07-11 01:07:40 +00:00
// swtch.S
struct jmpbuf;
int setjmp(struct jmpbuf*);
void longjmp(struct jmpbuf*);
2006-06-15 16:02:20 +00:00
// trap.c
void tvinit(void);
void idtinit(void);
2006-06-15 16:02:20 +00:00
// string.c
void * memset(void *dst, int c, unsigned n);
2006-06-21 01:53:07 +00:00
int memcmp(const void *v1, const void *v2, unsigned n);
void *memmove(void *dst, const void *src, unsigned n);
int strncmp(const char *p, const char *q, unsigned n);
2006-06-15 16:02:20 +00:00
// syscall.c
void syscall(void);
2006-06-16 20:29:25 +00:00
// picirq.c
extern uint16_t irq_mask_8259A;
2006-06-16 20:29:25 +00:00
void irq_setmask_8259A(uint16_t mask);
void pic_init(void);
2006-06-21 01:53:07 +00:00
// mp.c
void mp_init(void);
void mp_startthem(void);
2006-07-12 17:00:54 +00:00
int mp_bcpu(void);
// lapic
extern uint32_t *lapicaddr;
2006-06-28 16:35:03 +00:00
void lapic_init(int);
2006-07-12 17:00:54 +00:00
void lapic_startap(uint8_t, int);
2006-06-28 16:35:03 +00:00
void lapic_timerinit(void);
void lapic_timerintr(void);
void lapic_enableintr(void);
void lapic_disableintr(void);
2006-07-12 17:00:54 +00:00
int cpu(void);
// spinlock.c
struct spinlock;
void acquire(struct spinlock * lock);
void release(struct spinlock * lock);
void acquire1(struct spinlock * lock, struct proc *);
void release1(struct spinlock * lock, struct proc *);
2006-06-21 01:53:07 +00:00
2006-06-22 20:47:23 +00:00
// main.c
void load_icode(struct proc *p, uint8_t *binary, unsigned size);
2006-06-27 14:35:53 +00: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);
void fd_incref(struct fd *fd);
// ide.c
void ide_init(void);
2006-07-10 13:08:37 +00:00
void ide_intr(void);
2006-07-10 19:06:48 +00:00
void* ide_start_read(uint32_t secno, void *dst, unsigned nsecs);
int ide_finish_read(void *);