xv6-65oo2/defs.h
Frans Kaashoek 4714c20521 Checkpoint page-table version for SMP
Includes code for TLB shootdown (which actually seems unnecessary for xv6)
2010-07-23 07:41:13 -04:00

178 lines
5 KiB
C

struct buf;
struct context;
struct file;
struct inode;
struct pipe;
struct proc;
struct spinlock;
struct stat;
// bio.c
void binit(void);
struct buf* bread(uint, uint);
void brelse(struct buf*);
void bwrite(struct buf*);
// console.c
void consoleinit(void);
void cprintf(char*, ...);
void consoleintr(int(*)(void));
void panic(char*) __attribute__((noreturn));
// exec.c
int exec(char*, char**);
// file.c
struct file* filealloc(void);
void fileclose(struct file*);
struct file* filedup(struct file*);
void fileinit(void);
int fileread(struct file*, char*, int n);
int filestat(struct file*, struct stat*);
int filewrite(struct file*, char*, int n);
// fs.c
int dirlink(struct inode*, char*, uint);
struct inode* dirlookup(struct inode*, char*, uint*);
struct inode* ialloc(uint, short);
struct inode* idup(struct inode*);
void iinit(void);
void ilock(struct inode*);
void iput(struct inode*);
void iunlock(struct inode*);
void iunlockput(struct inode*);
void iupdate(struct inode*);
int namecmp(const char*, const char*);
struct inode* namei(char*);
struct inode* nameiparent(char*, char*);
int readi(struct inode*, char*, uint, uint);
void stati(struct inode*, struct stat*);
int writei(struct inode*, char*, uint, uint);
// ide.c
void ideinit(void);
void ideintr(void);
void iderw(struct buf*);
// ioapic.c
void ioapicenable(int irq, int cpu);
extern uchar ioapicid;
void ioapicinit(void);
// kalloc.c
extern int nfreemem;
char* kalloc(int);
void kfree(char*, int);
void kinit(char*,uint);
// kbd.c
void kbdintr(void);
// lapic.c
int cpunum(void);
extern volatile uint* lapic;
void lapiceoi(void);
void lapicinit(int);
void lapic_tlbflush(uint);
void lapicstartap(uchar, uint);
void microdelay(int);
// mp.c
extern int ismp;
int mpbcpu(void);
void mpinit(void);
void mpstartthem(void);
// picirq.c
void picenable(int);
void picinit(void);
// pipe.c
int pipealloc(struct file**, struct file**);
void pipeclose(struct pipe*, int);
int piperead(struct pipe*, char*, int);
int pipewrite(struct pipe*, char*, int);
//PAGEBREAK: 16
// proc.c
struct proc* copyproc(struct proc*);
void exit(void);
int fork(void);
int growproc(int);
int kill(int);
void pinit(void);
void procdump(void);
void scheduler(void) __attribute__((noreturn));
void sleep(void*, struct spinlock*);
void userinit(void);
int wait(void);
void wakeup(void*);
void yield(void);
// swtch.S
void swtch(struct context**, struct context*);
void jstack(uint);
// spinlock.c
void acquire(struct spinlock*);
void getcallerpcs(void*, uint*);
int holding(struct spinlock*);
void initlock(struct spinlock*, char*);
void release(struct spinlock*);
void pushcli();
void popcli();
// string.c
int memcmp(const void*, const void*, uint);
void* memmove(void*, const void*, uint);
void* memset(void*, int, uint);
char* safestrcpy(char*, const char*, int);
int strlen(const char*);
int strncmp(const char*, const char*, uint);
char* strncpy(char*, const char*, int);
// syscall.c
int argint(int, int*);
int argptr(int, char**, int);
int argstr(int, char**);
int fetchint(struct proc*, uint, int*);
int fetchstr(struct proc*, uint, char**);
void syscall(void);
// timer.c
void timerinit(void);
// trap.c
void idtinit(void);
extern int ticks;
void tvinit(void);
extern struct spinlock tickslock;
// uart.c
void uartinit(void);
void uartintr(void);
void uartputc(int);
// vm.c
#define PGROUNDUP(sz) ((sz+PGSIZE-1) & ~(PGSIZE-1))
void pminit(void);
void ksegment(void);
void kvmalloc(void);
void loadkvm(void);
void vminit(void);
void jkstack();
void printstack(void);
void printpgdir(uint*);
uint* setupkvm(void); // XXX need pde_t*
char* uva2ka(uint*, char*);
int allocuvm(uint*, char*, uint); // XXX need pde_t*
void freevm(uint*);
void inituvm(uint*, char*, char*, uint);
int loaduvm(uint*, char*, struct inode *ip, uint, uint);
uint* copyuvm(uint*,uint);
void loadvm(struct proc*);
// number of elements in fixed-size array
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))