xv6/kalloc.c File Reference

#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"

Go to the source code of this file.

Data Structures

struct  run

Functions

void kinit (void)
void kfree (char *v, int len)
char * kalloc (int n)

Variables

struct {
   struct spinlock   lock
   struct run *   freelist
kmem


Function Documentation

char* kalloc ( int  n  ) 

Definition at line 91 of file kalloc.c.

References acquire(), cprintf(), kmem, run::len, run::next, PAGE, panic(), r, and release().

Referenced by allocproc(), bootothers(), exec(), fork(), growproc(), pipealloc(), and userinit().

void kfree ( char *  v,
int  len 
)

Definition at line 46 of file kalloc.c.

References acquire(), kmem, run::len, memset(), run::next, PAGE, panic(), r, and release().

Referenced by exec(), fork(), growproc(), kinit(), pipealloc(), pipeclose(), and wait().

void kinit ( void   ) 

Definition at line 28 of file kalloc.c.

References cprintf(), initlock(), kfree(), kmem, run::len, and PAGE.

Referenced by mpmain().


Variable Documentation

struct run* freelist

Definition at line 20 of file kalloc.c.

struct { ... } kmem

Referenced by kalloc(), kfree(), and kinit().

struct spinlock lock

Definition at line 19 of file kalloc.c.


Generated on Fri Jan 7 12:25:49 2011 for xv6 by  doxygen 1.5.6