00001 struct buf;
00002 struct context;
00003 struct file;
00004 struct inode;
00005 struct pipe;
00006 struct proc;
00007 struct spinlock;
00008 struct stat;
00009
00010
00011 void binit(void);
00012 struct buf* bread(uint, uint);
00013 void brelse(struct buf*);
00014 void bwrite(struct buf*);
00015
00016
00017 void consoleinit(void);
00018 void cprintf(char*, ...);
00019 void consoleintr(int(*)(void));
00020 void panic(char*) __attribute__((noreturn));
00021
00022
00023 int exec(char*, char**);
00024
00025
00026 struct file* filealloc(void);
00027 void fileclose(struct file*);
00028 struct file* filedup(struct file*);
00029 void fileinit(void);
00030 int fileread(struct file*, char*, int n);
00031 int filestat(struct file*, struct stat*);
00032 int filewrite(struct file*, char*, int n);
00033
00034
00035 int dirlink(struct inode*, char*, uint);
00036 struct inode* dirlookup(struct inode*, char*, uint*);
00037 struct inode* ialloc(uint, short);
00038 struct inode* idup(struct inode*);
00039 void iinit(void);
00040 void ilock(struct inode*);
00041 void iput(struct inode*);
00042 void iunlock(struct inode*);
00043 void iunlockput(struct inode*);
00044 void iupdate(struct inode*);
00045 int namecmp(const char*, const char*);
00046 struct inode* namei(char*);
00047 struct inode* nameiparent(char*, char*);
00048 int readi(struct inode*, char*, uint, uint);
00049 void stati(struct inode*, struct stat*);
00050 int writei(struct inode*, char*, uint, uint);
00051
00052
00053 void ideinit(void);
00054 void ideintr(void);
00055 void iderw(struct buf*);
00056
00057
00058 void ioapicenable(int irq, int cpu);
00059 extern uchar ioapicid;
00060 void ioapicinit(void);
00061
00062
00063 char* kalloc(int);
00064 void kfree(char*, int);
00065 void kinit(void);
00066
00067
00068 void kbdintr(void);
00069
00070
00071 int cpunum(void);
00072 extern volatile uint* lapic;
00073 void lapiceoi(void);
00074 void lapicinit(int);
00075 void lapicstartap(uchar, uint);
00076 void microdelay(int);
00077
00078
00079 extern int ismp;
00080 int mpbcpu(void);
00081 void mpinit(void);
00082 void mpstartthem(void);
00083
00084
00085 void picenable(int);
00086 void picinit(void);
00087
00088
00089 int pipealloc(struct file**, struct file**);
00090 void pipeclose(struct pipe*, int);
00091 int piperead(struct pipe*, char*, int);
00092 int pipewrite(struct pipe*, char*, int);
00093
00094
00095 struct proc* copyproc(struct proc*);
00096 void exit(void);
00097 int fork(void);
00098 int growproc(int);
00099 int kill(int);
00100 void pinit(void);
00101 void procdump(void);
00102 void scheduler(void) __attribute__((noreturn));
00103 void ksegment(void);
00104 void usegment(void);
00105 void sleep(void*, struct spinlock*);
00106 void userinit(void);
00107 int wait(void);
00108 void wakeup(void*);
00109 void yield(void);
00110
00111
00112 void swtch(struct context**, struct context*);
00113
00114
00115 void acquire(struct spinlock*);
00116 void getcallerpcs(void*, uint*);
00117 int holding(struct spinlock*);
00118 void initlock(struct spinlock*, char*);
00119 void release(struct spinlock*);
00120 void pushcli();
00121 void popcli();
00122
00123
00124 int memcmp(const void*, const void*, uint);
00125 void* memmove(void*, const void*, uint);
00126 void* memset(void*, int, uint);
00127 char* safestrcpy(char*, const char*, int);
00128 int strlen(const char*);
00129 int strncmp(const char*, const char*, uint);
00130 char* strncpy(char*, const char*, int);
00131
00132
00133 int argint(int, int*);
00134 int argptr(int, char**, int);
00135 int argstr(int, char**);
00136 int fetchint(struct proc*, uint, int*);
00137 int fetchstr(struct proc*, uint, char**);
00138 void syscall(void);
00139
00140
00141 void timerinit(void);
00142
00143
00144 void idtinit(void);
00145 extern int ticks;
00146 void tvinit(void);
00147 extern struct spinlock tickslock;
00148
00149
00150 void uartinit(void);
00151 void uartintr(void);
00152 void uartputc(int);
00153
00154
00155 #define NELEM(x) (sizeof(x)/sizeof((x)[0]))
00156