Ytshih/hw2
This commit is contained in:
@@ -18,6 +18,28 @@
|
||||
|
||||
#define UserStackSize 1024 // increase this as necessary!
|
||||
|
||||
class FrameTable {
|
||||
public:
|
||||
FrameTable();
|
||||
~FrameTable();
|
||||
|
||||
int Allocate();
|
||||
void Release(int phyPageNum);
|
||||
size_t RemainSize();
|
||||
|
||||
private:
|
||||
struct Node {
|
||||
Node *next;
|
||||
int idx;
|
||||
Node(int idx = -1);
|
||||
};
|
||||
|
||||
Node *begin, *end;
|
||||
|
||||
size_t available;
|
||||
int *useCount;
|
||||
};
|
||||
|
||||
class AddrSpace {
|
||||
public:
|
||||
AddrSpace(); // Create an address space.
|
||||
@@ -40,8 +62,7 @@ class AddrSpace {
|
||||
ExceptionType Translate(unsigned int vaddr, unsigned int *paddr, int mode);
|
||||
|
||||
private:
|
||||
TranslationEntry *pageTable; // Assume linear page table translation
|
||||
// for now!
|
||||
TranslationEntry *pageTable;
|
||||
unsigned int numPages; // Number of pages in the virtual
|
||||
// address space
|
||||
|
||||
|
||||
Reference in New Issue
Block a user