UNIX xv6 (rev8, 9/1/15)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
defs.h File Reference

Go to the source code of this file.

Macros

#define NELEM(x)   (sizeof(x)/sizeof((x)[0]))
 

Functions

void binit (void)
 
struct bufbread (uint, uint)
 
void brelse (struct buf *)
 
void bwrite (struct buf *)
 
void consoleinit (void)
 
void cprintf (char *,...)
 
void consoleintr (int(*)(void))
 
void panic (char *) __attribute__((noreturn))
 
int exec (char *, char **)
 
struct filefilealloc (void)
 
void fileclose (struct file *)
 
struct filefiledup (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)
 
void readsb (int dev, struct superblock *sb)
 
int dirlink (struct inode *, char *, uint)
 
struct inodedirlookup (struct inode *, char *, uint *)
 
struct inodeialloc (uint, short)
 
struct inodeidup (struct inode *)
 
void iinit (int dev)
 
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 inodenamei (char *)
 
struct inodenameiparent (char *, char *)
 
int readi (struct inode *, char *, uint, uint)
 
void stati (struct inode *, struct stat *)
 
int writei (struct inode *, char *, uint, uint)
 
void ideinit (void)
 
void ideintr (void)
 
void iderw (struct buf *)
 
void ioapicenable (int irq, int cpu)
 
void ioapicinit (void)
 
char * kalloc (void)
 
void kfree (char *)
 
void kinit1 (void *, void *)
 
void kinit2 (void *, void *)
 
void kbdintr (void)
 
void cmostime (struct rtcdate *r)
 
int cpunum (void)
 
void lapiceoi (void)
 
void lapicinit (void)
 
void lapicstartap (uchar, uint)
 
void microdelay (int)
 
void initlog (int dev)
 
void log_write (struct buf *)
 
void begin_op ()
 
void end_op ()
 
int mpbcpu (void)
 
void mpinit (void)
 
void mpstartthem (void)
 
void picenable (int)
 
void picinit (void)
 
int pipealloc (struct file **, struct file **)
 
void pipeclose (struct pipe *, int)
 
int piperead (struct pipe *, char *, int)
 
int pipewrite (struct pipe *, char *, int)
 
struct proccopyproc (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 sched (void)
 
void sleep (void *, struct spinlock *)
 
void userinit (void)
 
int wait (void)
 
void wakeup (void *)
 
void yield (void)
 
void swtch (struct context **, struct context *)
 
void acquire (struct spinlock *)
 
void getcallerpcs (void *, uint *)
 
int holding (struct spinlock *)
 
void initlock (struct spinlock *, char *)
 
void release (struct spinlock *)
 
void pushcli (void)
 
void popcli (void)
 
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)
 
int argint (int, int *)
 
int argptr (int, char **, int)
 
int argstr (int, char **)
 
int fetchint (uint, int *)
 
int fetchstr (uint, char **)
 
void syscall (void)
 
void timerinit (void)
 
void idtinit (void)
 
void tvinit (void)
 
void uartinit (void)
 
void uartintr (void)
 
void uartputc (int)
 
void seginit (void)
 
void kvmalloc (void)
 
void vmenable (void)
 
pde_tsetupkvm (void)
 
char * uva2ka (pde_t *, char *)
 
int allocuvm (pde_t *, uint, uint)
 
int deallocuvm (pde_t *, uint, uint)
 
void freevm (pde_t *)
 
void inituvm (pde_t *, char *, uint)
 
int loaduvm (pde_t *, char *, struct inode *, uint, uint)
 
pde_tcopyuvm (pde_t *, uint)
 
void switchuvm (struct proc *)
 
void switchkvm (void)
 
int copyout (pde_t *, uint, void *, uint)
 
void clearpteu (pde_t *pgdir, char *uva)
 

Variables

uchar ioapicid
 
volatile uintlapic
 
int ismp
 
uint ticks
 
struct spinlock tickslock
 

Macro Definition Documentation

#define NELEM (   x)    (sizeof(x)/sizeof((x)[0]))

Definition at line 183 of file defs.h.

Function Documentation

void acquire ( struct spinlock )

Definition at line 25 of file spinlock.c.

int allocuvm ( pde_t ,
uint  ,
uint   
)

Definition at line 221 of file vm.c.

int argint ( int  ,
int *   
)

Definition at line 46 of file syscall.c.

int argptr ( int  ,
char **  ,
int   
)

Definition at line 55 of file syscall.c.

int argstr ( int  ,
char **   
)

Definition at line 72 of file syscall.c.

void begin_op ( )

Definition at line 125 of file log.c.

void binit ( void  )

Definition at line 40 of file bio.c.

struct buf* bread ( uint  ,
uint   
)

Definition at line 100 of file bio.c.

void brelse ( struct buf )

Definition at line 124 of file bio.c.

void bwrite ( struct buf )

Definition at line 113 of file bio.c.

void clearpteu ( pde_t pgdir,
char *  uva 
)

Definition at line 297 of file vm.c.

void cmostime ( struct rtcdate r)

Definition at line 204 of file lapic.c.

void consoleinit ( void  )

Definition at line 281 of file console.c.

void consoleintr ( int(*)(void)  )

Definition at line 188 of file console.c.

int copyout ( pde_t ,
uint  ,
void *  ,
uint   
)

Definition at line 358 of file vm.c.

struct proc* copyproc ( struct proc )
pde_t* copyuvm ( pde_t ,
uint   
)

Definition at line 310 of file vm.c.

void cprintf ( char *  ,
  ... 
)

Definition at line 54 of file console.c.

int cpunum ( void  )

Definition at line 100 of file lapic.c.

int deallocuvm ( pde_t ,
uint  ,
uint   
)

Definition at line 250 of file vm.c.

int dirlink ( struct inode ,
char *  ,
uint   
)

Definition at line 533 of file fs.c.

struct inode* dirlookup ( struct inode ,
char *  ,
uint  
)

Definition at line 506 of file fs.c.

void end_op ( )

Definition at line 145 of file log.c.

int exec ( char *  ,
char **   
)

Definition at line 11 of file exec.c.

void exit ( void  )

Definition at line 173 of file proc.c.

int fetchint ( uint  ,
int *   
)

Definition at line 18 of file syscall.c.

int fetchstr ( uint  ,
char **   
)

Definition at line 30 of file syscall.c.

struct file* filealloc ( void  )

Definition at line 26 of file file.c.

void fileclose ( struct file )

Definition at line 56 of file file.c.

struct file* filedup ( struct file )

Definition at line 44 of file file.c.

void fileinit ( void  )

Definition at line 19 of file file.c.

int fileread ( struct file ,
char *  ,
int  n 
)

Definition at line 96 of file file.c.

int filestat ( struct file ,
struct stat  
)

Definition at line 83 of file file.c.

int filewrite ( struct file ,
char *  ,
int  n 
)

Definition at line 117 of file file.c.

int fork ( void  )

Definition at line 129 of file proc.c.

void freevm ( pde_t )

Definition at line 278 of file vm.c.

void getcallerpcs ( void *  ,
uint  
)
int growproc ( int  )

Definition at line 108 of file proc.c.

int holding ( struct spinlock )

Definition at line 86 of file spinlock.c.

struct inode* ialloc ( uint  ,
short   
)

Definition at line 177 of file fs.c.

void ideinit ( void  )

Definition at line 48 of file ide.c.

void ideintr ( void  )

Definition at line 100 of file ide.c.

void iderw ( struct buf )

Definition at line 134 of file ide.c.

void idtinit ( void  )

Definition at line 30 of file trap.c.

struct inode* idup ( struct inode )

Definition at line 256 of file fs.c.

void iinit ( int  dev)

Definition at line 163 of file fs.c.

void ilock ( struct inode )

Definition at line 267 of file fs.c.

void initlock ( struct spinlock ,
char *   
)

Definition at line 13 of file spinlock.c.

void initlog ( int  dev)

Definition at line 53 of file log.c.

void inituvm ( pde_t ,
char *  ,
uint   
)

Definition at line 182 of file vm.c.

void ioapicenable ( int  irq,
int  cpu 
)

Definition at line 71 of file ioapic.c.

void ioapicinit ( void  )

Definition at line 49 of file ioapic.c.

void iput ( struct inode )

Definition at line 318 of file fs.c.

void iunlock ( struct inode )

Definition at line 299 of file fs.c.

void iunlockput ( struct inode )

Definition at line 340 of file fs.c.

void iupdate ( struct inode )

Definition at line 200 of file fs.c.

char* kalloc ( void  )

Definition at line 83 of file kalloc.c.

void kbdintr ( void  )

Definition at line 47 of file kbd.c.

void kfree ( char *  )

Definition at line 60 of file kalloc.c.

int kill ( int  )

Definition at line 412 of file proc.c.

void kinit1 ( void *  ,
void *   
)

Definition at line 31 of file kalloc.c.

void kinit2 ( void *  ,
void *   
)

Definition at line 39 of file kalloc.c.

void kvmalloc ( void  )

Definition at line 149 of file vm.c.

void lapiceoi ( void  )

Definition at line 121 of file lapic.c.

void lapicinit ( void  )

Definition at line 54 of file lapic.c.

void lapicstartap ( uchar  ,
uint   
)

Definition at line 140 of file lapic.c.

int loaduvm ( pde_t ,
char *  ,
struct inode ,
uint  ,
uint   
)

Definition at line 197 of file vm.c.

void log_write ( struct buf )

Definition at line 211 of file log.c.

int memcmp ( const void *  ,
const void *  ,
uint   
)

Definition at line 16 of file string.c.

void* memmove ( void *  ,
const void *  ,
uint   
)

Definition at line 32 of file string.c.

void* memset ( void *  ,
int  ,
uint   
)

Definition at line 5 of file string.c.

void microdelay ( int  )

Definition at line 130 of file lapic.c.

int mpbcpu ( void  )

Definition at line 21 of file mp.c.

void mpinit ( void  )

Definition at line 100 of file mp.c.

void mpstartthem ( void  )
int namecmp ( const char *  ,
const char *   
)

Definition at line 498 of file fs.c.

struct inode* namei ( char *  )

Definition at line 641 of file fs.c.

struct inode* nameiparent ( char *  ,
char *   
)

Definition at line 648 of file fs.c.

void panic ( char *  )

Definition at line 106 of file console.c.

void picenable ( int  )

Definition at line 26 of file picirq.c.

void picinit ( void  )

Definition at line 33 of file picirq.c.

void pinit ( void  )

Definition at line 24 of file proc.c.

int pipealloc ( struct file **  ,
struct file **   
)

Definition at line 22 of file pipe.c.

void pipeclose ( struct pipe ,
int   
)

Definition at line 59 of file pipe.c.

int piperead ( struct pipe ,
char *  ,
int   
)

Definition at line 100 of file pipe.c.

int pipewrite ( struct pipe ,
char *  ,
int   
)

Definition at line 78 of file pipe.c.

void popcli ( void  )

Definition at line 108 of file spinlock.c.

void procdump ( void  )

Definition at line 436 of file proc.c.

void pushcli ( void  )

Definition at line 97 of file spinlock.c.

int readi ( struct inode ,
char *  ,
uint  ,
uint   
)

Definition at line 435 of file fs.c.

void readsb ( int  dev,
struct superblock sb 
)

Definition at line 29 of file fs.c.

void release ( struct spinlock )

Definition at line 44 of file spinlock.c.

char* safestrcpy ( char *  ,
const char *  ,
int   
)

Definition at line 83 of file string.c.

void sched ( void  )

Definition at line 301 of file proc.c.

void scheduler ( void  )

Definition at line 266 of file proc.c.

void seginit ( void  )

Definition at line 17 of file vm.c.

pde_t* setupkvm ( void  )

Definition at line 129 of file vm.c.

void sleep ( void *  ,
struct spinlock  
)

Definition at line 352 of file proc.c.

void stati ( struct inode ,
struct stat  
)

Definition at line 423 of file fs.c.

int strlen ( const char *  )

Definition at line 97 of file string.c.

int strncmp ( const char *  ,
const char *  ,
uint   
)

Definition at line 59 of file string.c.

char* strncpy ( char *  ,
const char *  ,
int   
)

Definition at line 69 of file string.c.

void switchkvm ( void  )

Definition at line 158 of file vm.c.

void switchuvm ( struct proc )

Definition at line 165 of file vm.c.

void swtch ( struct context **  ,
struct context  
)
void syscall ( void  )

Definition at line 127 of file syscall.c.

void timerinit ( void  )

Definition at line 25 of file timer.c.

void tvinit ( void  )

Definition at line 18 of file trap.c.

void uartinit ( void  )

Definition at line 19 of file uart.c.

void uartintr ( void  )

Definition at line 74 of file uart.c.

void uartputc ( int  )

Definition at line 52 of file uart.c.

void userinit ( void  )

Definition at line 79 of file proc.c.

char* uva2ka ( pde_t ,
char *   
)

Definition at line 342 of file vm.c.

void vmenable ( void  )
int wait ( void  )

Definition at line 217 of file proc.c.

void wakeup ( void *  )

Definition at line 401 of file proc.c.

int writei ( struct inode ,
char *  ,
uint  ,
uint   
)

Definition at line 463 of file fs.c.

void yield ( void  )

Definition at line 320 of file proc.c.

Variable Documentation

uchar ioapicid

Definition at line 18 of file mp.c.

int ismp

Definition at line 16 of file mp.c.

volatile uint* lapic

Definition at line 43 of file lapic.c.

uint ticks

Definition at line 15 of file trap.c.

struct spinlock tickslock

Definition at line 14 of file trap.c.