nachos.machine
Class TranslationEntry

java.lang.Object
  extended by nachos.machine.TranslationEntry

public final class TranslationEntry
extends Object

A single translation between a virtual page and a physical page.


Field Summary
 boolean dirty
          This flag is set to true every time the page is written by a user program.
 int ppn
          The physical page number.
 boolean readOnly
          If this flag is true, the user pprogram is not allowed to modify the contents of this virtual page.
 boolean used
          This flag is set to true every time the page is read or written by a user program.
 boolean valid
          If this flag is false, this translation entry is ignored.
 int vpn
          The virtual page number.
 
Constructor Summary
TranslationEntry()
          Allocate a new invalid translation entry.
TranslationEntry(int vpn, int ppn, boolean valid, boolean readOnly, boolean used, boolean dirty)
          Allocate a new translation entry with the specified initial state.
TranslationEntry(TranslationEntry entry)
          Allocate a new translation entry, copying the contents of an existing one.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vpn

public int vpn
The virtual page number.


ppn

public int ppn
The physical page number.


valid

public boolean valid
If this flag is false, this translation entry is ignored.


readOnly

public boolean readOnly
If this flag is true, the user pprogram is not allowed to modify the contents of this virtual page.


used

public boolean used
This flag is set to true every time the page is read or written by a user program.


dirty

public boolean dirty
This flag is set to true every time the page is written by a user program.

Constructor Detail

TranslationEntry

public TranslationEntry()
Allocate a new invalid translation entry.


TranslationEntry

public TranslationEntry(int vpn,
                        int ppn,
                        boolean valid,
                        boolean readOnly,
                        boolean used,
                        boolean dirty)
Allocate a new translation entry with the specified initial state.

Parameters:
vpn - the virtual page numben.
ppn - the physical page number.
valid - the valid bit.
readOnly - the read-only bit.
used - the used bit.
dirty - the dirty bit.

TranslationEntry

public TranslationEntry(TranslationEntry entry)
Allocate a new translation entry, copying the contents of an existing one.

Parameters:
entry - the translation entry to copy.