Main Page | Data Structures | File List | Globals | Related Pages

frame.c File Reference

Provides the implementantion of physical page frame allocation. More...

#include <frame.h>
#include <malloc.h>
#include <stdlib.h>
#include <x86/proc_reg.h>

Functions

void frame_allocator_reserve (FrameAddress start, FrameAddress end)
 Reserve frame from the allocator.

void frame_allocator_fill (FrameAddress start, FrameAddress end)
int frame_allocator_initialize (FrameAddress start, FrameAddress end)
 Initializes the frame allocator.

Frame * frame_allocator_split (Frame *frame, FrameAlignment request, Frame *start, Frame *end)
Frame * frame_allocator_attempt_split (FrameAlignment request, Frame *start, Frame *end)
Frame * frame_allocator_coalesce (Frame *frame, FrameAlignment request, Frame *start, Frame *end)
Frame * frame_allocator_attempt_coalesce (FrameAlignment request, Frame *start, Frame *end)
Frame * frame_allocate_within (FrameAlignment alignment, FrameAddress start, FrameAddress end)
 Allocate a frame within a memory region.

Frame * frame_allocate (FrameAlignment alignment)
 Allocate a frame.

void frame_free (Frame *frame)
 Free a frame.

unsigned int frame_availability (void)
 The number of available frames for allocation.


Variables

FrameAllocator frameAllocator


Detailed Description

Provides the implementantion of physical page frame allocation.

Author:
Lee Salzman (lsalzman)

Hassaan Moin Khan (hkhan)

Bug:
No known bugs.

Function Documentation

Frame* frame_allocate FrameAlignment  alignment  ) 
 

Allocate a frame.

Allocate a frame from anywhere within the managed physical memory.

Parameters:
alignment the alignment of the frame
Returns:
The allocated frame or NULL on failure.

Frame* frame_allocate_within FrameAlignment  alignment,
FrameAddress  start,
FrameAddress  end
 

Allocate a frame within a memory region.

Allocates a frame of the specified alignment within a given region of the physical address space.

Parameters:
alignment the alignment of the frame
start the frame address of the start of the region
end the frame address of the last acceptable firame of the region
Returns:
The allocated frame or NULL on failure.

int frame_allocator_initialize FrameAddress  start,
FrameAddress  end
 

Initializes the frame allocator.

Initialize the frame allocator to manage a specified region of physical memory.

Parameters:
start the frame address of the start of the managed region
end the frame address of the last frame of the managed region
Returns:
0 on success -1 on failure

void frame_allocator_reserve FrameAddress  start,
FrameAddress  end
 

Reserve frame from the allocator.

Reserves page frames from the allocator so that they may not be used.

Parameters:
start the frame address of the start of the reserved frames
end the frame address of the last frame of the reserved frames
Returns:
Void

unsigned int frame_availability void   ) 
 

The number of available frames for allocation.

Return the number of frames available for allocation, if allocated at the least alignment possible.

Returns:
The number of frames.

void frame_free Frame *  frame  ) 
 

Free a frame.

Return the frame to the free list

Parameters:
frame the frame to free
Returns:
Void


Generated on Fri Apr 9 21:59:16 2004 for 15-410 Project 3 by doxygen 1.3.2