xv6-65oo2/defs.h

131 lines
3 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 console_init(void);
2006-06-12 15:22:12 +00:00
void cprintf(char *fmt, ...);
void panic(char *s);
void kbd_intr(void);
2006-06-12 15:22:12 +00:00
// proc.c
void pinit(void);
2006-06-12 15:22:12 +00:00
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;
2006-08-29 17:01:40 +00:00
uint growproc(int);
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, 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 16:02:20 +00:00
// syscall.c
void syscall(void);
2006-06-16 20:29:25 +00:00
// picirq.c
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
2006-07-20 09:07:53 +00:00
extern uint *lapicaddr;
2006-06-28 16:35:03 +00:00
void lapic_init(int);
2006-07-20 09:07:53 +00:00
void lapic_startap(uchar, 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);
void lapic_eoi(void);
2006-07-12 17:00:54 +00:00
int cpu(void);
// ioapic
extern uchar ioapic_id;
void ioapic_init(void);
void ioapic_enable (int irq, int cpu);
// spinlock.c
struct spinlock;
void initlock(struct spinlock *, char *);
2006-07-17 05:00:25 +00:00
void acquire(struct spinlock*);
void release(struct spinlock*);
int holding(struct spinlock*);
2006-06-21 01:53:07 +00:00
2006-06-22 20:47:23 +00:00
// main.c
2006-07-20 09:07:53 +00:00
void load_icode(struct proc *p, uchar *binary, uint 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
2006-08-12 04:33:50 +00:00
struct stat;
void fd_init(void);
2006-07-17 01:25:22 +00:00
int fd_ualloc(void);
struct fd * fd_alloc(void);
2006-06-27 14:35:53 +00: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);
2006-08-12 04:33:50 +00:00
int fd_stat(struct fd *fd, struct stat *);
void fd_incref(struct fd *fd);
// ide.c
void ide_init(void);
2006-07-10 13:08:37 +00:00
void ide_intr(void);
void* ide_start_rw(int diskno, uint secno, void *dst, uint nsecs, int read);
int ide_finish(void *);
// bio.c
void binit(void);
struct buf;
struct buf * getblk(uint dev, uint sector);
struct buf *bread(uint, uint);
void bwrite(struct buf *, uint);
void brelse(struct buf *);
// fs.c
2006-08-15 15:53:46 +00:00
extern uint rootdev;
void iinit(void);
struct inode * iget(uint dev, uint inum);
2006-07-21 22:10:40 +00:00
void ilock(struct inode *ip);
void iunlock(struct inode *ip);
2006-07-29 09:35:02 +00:00
void idecref(struct inode *ip);
2006-08-15 15:53:46 +00:00
void iincref(struct inode *ip);
void iput(struct inode *ip);
struct inode * namei(char *path, int, uint *, char **, struct inode **);
2006-08-12 04:33:50 +00:00
void stati(struct inode *ip, struct stat *st);
int readi(struct inode *ip, char *xdst, uint off, uint n);
int writei(struct inode *ip, char *addr, uint off, uint n);
struct inode *mknod(char *, short, short, short);
struct inode * mknod1(struct inode *, char *, short, short, short);
int unlink(char *cp);
void iupdate (struct inode *ip);
2006-08-13 02:12:44 +00:00
int link(char *file1, char *file2);