Class PTE

java.lang.Object
  |
  +--PTE

public class PTE
extends java.lang.Object

A PTE represents a memory page table entry.


Field Summary
static int NUM_CLASSES
          PTE.NUM_CLASSES is the number of reference classes used in the reference class field of a page table entry.
static int PERMISSION_BITS
          PTE.PERMISSION_BITS is the number of permission bits and the number of reference class bits in a page table entry.
 
Constructor Summary
PTE(int pn)
          new PTE(pn) returns a new page table entry with page number pn.
 
Method Summary
 void assignFrame(int fn)
          pte.assignFrame(fn) sets the frame number for pte to fn and sets its present bit to 1.
 int getFrameNumber()
          pte.getFrameNumber() returns the frame number currently assigned to the page that is controlled by pte or -1 if if there is no frame assigned to the page.
 int getPermissions()
          pte.getPermissions() returns the permission bits of pte.
 int getRefClass()
          pte.getRefClass() returns the reference class bits of pte.
 boolean isDirty()
          pte.isDirty() returns true if the page controlled by pte has been recently written.
 boolean isPresent()
          pte.isPresent() returns the present bit of pte.
 boolean isReferenced()
          pte.isReferenced() returns true if the page controlled by pte has been recently referenced.
 void print()
          pte.print() writes pte to System.out in tabular form.
static void printHeader()
          PTE.printHeader() writes a header for tables containing pte entries printed with the print() method.
 void releaseFrame()
          pte.releaseFrame() clears the frame number and present bit of pte.
 void resetDirtyBit()
          pte.resetDirtyBit() resets the reference bit in pte.
 void resetReferenceBit()
          pte.resetReferenceBit() resets the reference bit in pte.
 void setFrameNumber(int n)
          pte.setFrameNumber(n) sets the frame number for the page that is controlled by pte to n.
 void setPermissions(int p)
          pte.setPermissions(p) sets the permission bits of pte from p.
 void setPresent(boolean b)
          pte.setPresent(b) sets the present bit of pte to b.
 void setRefClass(int c)
          pte.setRefClass(c) sets the reference class bits of pte from c.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSION_BITS

public static final int PERMISSION_BITS
PTE.PERMISSION_BITS is the number of permission bits and the number of reference class bits in a page table entry.

See Also:
Constant Field Values

NUM_CLASSES

public static final int NUM_CLASSES
PTE.NUM_CLASSES is the number of reference classes used in the reference class field of a page table entry.

See Also:
Constant Field Values
Constructor Detail

PTE

public PTE(int pn)
new PTE(pn) returns a new page table entry with page number pn.

Method Detail

isPresent

public boolean isPresent()
pte.isPresent() returns the present bit of pte. This bit is true if the page represented by pte is currently in physical memory.


setPresent

public void setPresent(boolean b)
pte.setPresent(b) sets the present bit of pte to b.


getPermissions

public int getPermissions()
pte.getPermissions() returns the permission bits of pte. The individual permission bits can be accessed by bitwise ANDing with MMU.READ, MMU.WRITE, or MMU.FETCH, and checking if the result is non-zero.


setPermissions

public void setPermissions(int p)
pte.setPermissions(p) sets the permission bits of pte from p. This parameter shoud be a bitwise OR of the desired constants MMU.READ, MMI.WRITE, e MMU.READ, and MMU.FETCH.


resetReferenceBit

public void resetReferenceBit()
pte.resetReferenceBit() resets the reference bit in pte.


isReferenced

public boolean isReferenced()
pte.isReferenced() returns true if the page controlled by pte has been recently referenced.


resetDirtyBit

public void resetDirtyBit()
pte.resetDirtyBit() resets the reference bit in pte.


isDirty

public boolean isDirty()
pte.isDirty() returns true if the page controlled by pte has been recently written.


getRefClass

public int getRefClass()
pte.getRefClass() returns the reference class bits of pte. The individual reference class bits can be accessed by bitwise ANDing with MMU.READ, MMU.WRITE, or MMU.FETCH, and checking if the result is non-zero.


setRefClass

public void setRefClass(int c)
pte.setRefClass(c) sets the reference class bits of pte from c. This parameter shoud be a bitwise OR of the desired constants MMU.READ, MMI.WRITE, and MMU.FETCH.


getFrameNumber

public int getFrameNumber()
pte.getFrameNumber() returns the frame number currently assigned to the page that is controlled by pte or -1 if if there is no frame assigned to the page.


setFrameNumber

public void setFrameNumber(int n)
pte.setFrameNumber(n) sets the frame number for the page that is controlled by pte to n.


assignFrame

public void assignFrame(int fn)
pte.assignFrame(fn) sets the frame number for pte to fn and sets its present bit to 1.


releaseFrame

public void releaseFrame()
pte.releaseFrame() clears the frame number and present bit of pte.


printHeader

public static void printHeader()
PTE.printHeader() writes a header for tables containing pte entries printed with the print() method.


print

public void print()
pte.print() writes pte to System.out in tabular form.