CS350 COS
COS
|
#include <sys/queue.h>
#include <sys/spinlock.h>
Go to the source code of this file.
Data Structures | |
struct | Page |
struct | SlabElement |
struct | Slab |
Macros | |
#define | SLAB_NAMELEN 32 |
#define | DECLARE_SLAB(_type) |
#define | DEFINE_SLAB(_type, _pool) |
Typedefs | |
typedef struct Page | Page |
typedef struct XMem | XMem |
typedef struct SlabElement | SlabElement |
typedef struct Slab | Slab |
Functions | |
void | PAlloc_Init () |
void | PAlloc_AddRegion (uintptr_t start, uintptr_t len) |
void * | PAlloc_AllocPage () |
void | PAlloc_Retain (void *pg) |
void | PAlloc_Release (void *pg) |
void | XMem_Init () |
XMem * | XMem_New () |
void | XMem_Destroy (XMem *xmem) |
uintptr_t | XMem_GetBase (XMem *xmem) |
uintptr_t | XMem_GetLength (XMem *xmem) |
bool | XMem_Allocate (XMem *xmem, uintptr_t length) |
void | Slab_Init (Slab *slab, const char *name, uintptr_t objsz, uintptr_t align) |
void * | Slab_Alloc (Slab *slab) __attribute__((malloc)) |
void | Slab_Free (Slab *slab, void *obj) |
struct Page |
#define DECLARE_SLAB | ( | _type | ) |
#define DEFINE_SLAB | ( | _type, | |
_pool | |||
) |
typedef struct SlabElement SlabElement |
PAlloc_AddRegion –
Add a physical memory region to the page allocator.
Definition at line 92 of file palloc.c.
void * PAlloc_AllocPage | ( | ) |
PAlloc_AllocPage –
Allocate a physical page and return the page's address in the Kernel's ident mapped memory region.
NULL | if no memory is available. |
Definition at line 188 of file palloc.c.
void PAlloc_Init | ( | ) |
void PAlloc_Release | ( | void * | pg | ) |
PAlloc_Release –
Deccrement the reference count for a physical page. If the reference count is zero the page will be freed.
Definition at line 265 of file palloc.c.
void PAlloc_Retain | ( | void * | pg | ) |
void * Slab_Alloc | ( | Slab * | slab | ) |
Slab_Alloc –
Free a slab object. @param [in] slab Slab that the object belongs to. @retval NULL Could not allocate an object. @return Pointer to the allocated object.
Definition at line 105 of file slab.c.
void Slab_Free | ( | Slab * | slab, |
void * | region | ||
) |
Slab_Free –
Free a slab object. @param [in] slab Slab that the object belongs to. @param [in] region Object to free.
Definition at line 135 of file slab.c.
Definition at line 92 of file xmem.c.
void XMem_Destroy | ( | XMem * | xmem | ) |
Definition at line 63 of file xmem.c.
void XMem_Init | ( | ) |