-public abstract class Runtime implements UsermodeConstants,Registers {
- /** Pages are 4k in size */
- protected final int PAGE_SIZE;
- protected final int PAGE_WORDS;
- protected final int PAGE_SHIFT;
- protected final int TOTAL_PAGES;
- /** This is the upper limit of the pages allocated by the sbrk() syscall. */
- protected final int BRK_LIMIT;
- protected final int STACK_BOTTOM;
-
- /** This is the maximum size of command line arguments */
- public final static int ARGS_MAX = 1024*1024;
-
- /** True if we allow empty pages (_emptyPage) to exist in memory.
- Empty pages are pages which are allocated by the program but do not contain any
- data yet (they are all 0s). If empty pages are allowed subclasses must always
- access main memory with the memRead and memWrite functions */
- private final boolean allowEmptyPages;
- /** the "empty page" */
- private final static int[] _emptyPage = new int[0];
-
- protected final static boolean isEmptyPage(int[] page) { return page == _emptyPage; }
-
- /** Returns a new empty page (_emptyPage is empty pages are enabled or a new zero'd page) */
- private final int[] emptyPage() { return allowEmptyPages ? _emptyPage : new int[PAGE_WORDS]; }
+public abstract class Runtime implements UsermodeConstants,Registers,Cloneable {
+ /** Number of bits to shift to get the page number (1<<<pageShift == pageSize) */
+ protected final int pageShift;
+ /** Bottom of region of memory allocated to the stack */
+ protected final int stackBottom;