Skip to content
Snippets Groups Projects
defs.h 2.94 KiB
Newer Older
rtm's avatar
rtm committed
// kalloc.c
char *kalloc(int n);
void kfree(char *cp, int len);
void kinit(void);
rtm's avatar
rtm committed

// console.c
void console_init(void);
rtm's avatar
rtm committed
void cprintf(char *fmt, ...);
void panic(char *s);
void kbd_intr(void);
rtm's avatar
rtm committed

// proc.c
rtm's avatar
rtm committed
struct proc;
void setupsegs(struct proc *);
rsc's avatar
 
rsc committed
struct proc * copyproc(struct proc*);
rtm's avatar
rtm committed
struct spinlock;
void sleep(void *, struct spinlock *);
rtm's avatar
rtm committed
void wakeup(void *);
void scheduler(void);
void proc_exit(void);
int proc_kill(int);
int proc_wait(void);
void yield(void);

// swtch.S
struct jmpbuf;
int setjmp(struct jmpbuf*);
void longjmp(struct jmpbuf*);

// trap.c
rtm's avatar
rtm committed
void tvinit(void);
void idtinit(void);

// 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);

// syscall.c
void syscall(void);
rtm's avatar
rtm committed

// picirq.c
void pic_init(void);
void mp_startthem(void);
kaashoek's avatar
kaashoek committed
int mp_bcpu(void);

// lapic
rtm's avatar
rtm committed
extern uint *lapicaddr;
kaashoek's avatar
kaashoek committed
void lapic_init(int);
rtm's avatar
rtm committed
void lapic_startap(uchar, int);
kaashoek's avatar
kaashoek committed
void lapic_timerinit(void);
void lapic_timerintr(void);
void lapic_enableintr(void);
void lapic_disableintr(void);
void lapic_eoi(void);
kaashoek's avatar
kaashoek committed
int cpu(void);
// ioapic
extern uchar ioapic_id;
void ioapic_init(void);
void ioapic_enable (int irq, int cpu);

rtm's avatar
rtm committed
struct spinlock;
void initlock(struct spinlock *, char *);
rsc's avatar
rsc committed
void acquire(struct spinlock*);
void release(struct spinlock*);
int holding(struct spinlock*);
rtm's avatar
rtm committed
// main.c
rtm's avatar
rtm committed
void load_icode(struct proc *p, uchar *binary, uint size);
rtm's avatar
rtm committed

// 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
kaashoek's avatar
kaashoek committed
struct stat;
rsc's avatar
rsc committed
int fd_ualloc(void);
struct fd * fd_alloc(void);
rtm's avatar
rtm committed
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);
kaashoek's avatar
kaashoek committed
int fd_stat(struct fd *fd, struct stat *);
rsc's avatar
 
rsc committed
void fd_incref(struct fd *fd);
kaashoek's avatar
kaashoek committed

// ide.c
void ide_init(void);
kaashoek's avatar
kaashoek committed
void ide_intr(void);
void* ide_start_rw(int diskno, uint secno, void *dst, uint nsecs, int read);
int ide_finish(void *);
rsc's avatar
 
rsc committed

rtm's avatar
rtm committed
// bio.c
rtm's avatar
rtm committed
struct buf;
struct buf * getblk(uint dev, uint sector);
rtm's avatar
rtm committed
struct buf *bread(uint, uint);
void bwrite(struct buf *, uint);
rtm's avatar
rtm committed
void brelse(struct buf *);

// fs.c
kaashoek's avatar
kaashoek committed
extern uint rootdev;
rtm's avatar
rtm committed
struct inode * iget(uint dev, uint inum);
rtm's avatar
rtm committed
void ilock(struct inode *ip);
void iunlock(struct inode *ip);
rtm's avatar
rtm committed
void idecref(struct inode *ip);
kaashoek's avatar
kaashoek committed
void iincref(struct inode *ip);
rtm's avatar
rtm committed
void iput(struct inode *ip);
struct inode * namei(char *path, int, uint *);
kaashoek's avatar
kaashoek committed
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);
kaashoek's avatar
kaashoek committed
int unlink(char *cp);
void iupdate (struct inode *ip);
rtm's avatar
rtm committed
int link(char *file1, char *file2);