xv6-cs450/defs.h

149 lines
3.3 KiB
C
Raw Normal View History

2006-06-12 17:22:12 +02:00
// kalloc.c
2006-09-06 19:27:19 +02:00
char* kalloc(int);
void kfree(char*, int);
2006-06-15 18:02:20 +02:00
void kinit(void);
2006-06-12 17:22:12 +02:00
// console.c
void console_init(void);
void cprintf(char*, ...);
2007-08-08 12:27:04 +02:00
void panic(char*) __attribute__((noreturn));
void kbd_intr(void);
2006-06-12 17:22:12 +02:00
// proc.c
void pinit(void);
2006-06-12 17:22:12 +02:00
struct proc;
void setupsegs(struct proc*);
struct proc* copyproc(struct proc*);
struct spinlock;
2006-09-07 16:13:26 +02:00
int growproc(int);
void sleep(void*, struct spinlock*);
2006-09-06 19:27:19 +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-09-07 17:45:38 +02:00
void procdump(void);
void userinit(void);
2006-07-11 03:07:40 +02:00
2006-09-08 16:40:51 +02:00
// setjmp.S
2006-07-11 03:07:40 +02:00
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
2006-09-06 19:27:19 +02:00
void* memset(void*, int, uint);
int memcmp(const void*, const void*, uint);
2006-09-06 19:27:19 +02:00
void* memmove(void*, const void*, uint);
int strncmp(const char*, const char*, uint);
2007-08-08 10:37:22 +02:00
char* safestrcpy(char*, const char*, int);
int strlen(const char*);
2006-06-15 18:02:20 +02:00
// syscall.c
void syscall(void);
int fetchint(struct proc*, uint, int*);
2006-09-07 16:13:26 +02:00
int fetchstr(struct proc*, uint, char**);
int argint(int, int*);
int argptr(int, char**, int);
int argstr(int, char**);
2006-06-16 22:29:25 +02:00
// picirq.c
void pic_init(void);
2006-09-07 17:29:54 +02:00
void irq_enable(int);
// 8253pit.c
void pit8253_timerinit(void);
2006-06-21 03:53:07 +02:00
// mp.c
extern int ismp;
void mp_init(void);
void mp_startthem(void);
2006-07-12 19:00:54 +02:00
int mp_bcpu(void);
2006-09-08 16:40:51 +02:00
// lapic.c
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);
void lapic_eoi(void);
2006-07-12 19:00:54 +02:00
int cpu(void);
2006-09-08 16:40:51 +02:00
// ioapic.c
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 07:00:25 +02:00
void acquire(struct spinlock*);
void release(struct spinlock*);
int holding(struct spinlock*);
2006-09-07 18:54:23 +02:00
void getcallerpcs(void*, uint*);
2006-06-21 03:53:07 +02:00
2006-06-22 22:47:23 +02:00
// main.c
void load_icode(struct proc*, uchar*, uint);
2006-06-27 16:35:53 +02:00
// pipe.c
struct pipe;
2006-09-06 20:38:56 +02:00
struct file;
int pipe_alloc(struct file**, struct file**);
void pipe_close(struct pipe*, int);
int pipe_write(struct pipe*, char*, int);
int pipe_read(struct pipe*, char*, int);
2006-06-27 16:35:53 +02:00
2006-09-06 21:47:07 +02:00
// file.c
2006-08-12 06:33:50 +02:00
struct stat;
2006-09-06 20:43:45 +02:00
void fileinit(void);
struct file* filealloc(void);
void fileclose(struct file*);
int fileread(struct file*, char*, int n);
int filewrite(struct file*, char*, int n);
int filestat(struct file*, struct stat*);
void fileincref(struct file*);
// ide.c
void ide_init(void);
2006-07-10 15:08:37 +02:00
void ide_intr(void);
2006-09-07 17:29:54 +02:00
void ide_rw(int, uint, void*, uint, int);
// bio.c
void binit(void);
struct buf;
struct buf* bread(uint, uint);
void bwrite(struct buf*);
void brelse(struct buf*);
// fs.c
2007-08-21 21:58:55 +02:00
struct inode;
struct uinode;
void iinit(void);
struct inode* ilock(struct uinode*);
struct uinode* iunlock(struct inode*);
void iput(struct uinode*);
struct uinode* idup(struct uinode*);
struct uinode* namei(char*);
void stati(struct inode*, struct stat*);
int readi(struct inode*, char*, uint, uint);
int writei(struct inode*, char*, uint, uint);
int dirlink(struct inode *dp, char *name, uint ino);
struct uinode* dirlookup(struct inode *dp, char *name, uint *poff);
void iupdate(struct inode *ip);
int namecmp(const char *s, const char *t);
struct uinode* ialloc(uint, short);
struct uinode* nameiparent(char *path, char *name);
// exec.c
int exec(char*, char**);
2007-08-08 11:41:21 +02:00
// number of elements in fixed-size array
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))