vmprocess.java

来自「nachos操作系统框架」· Java 代码 · 共 74 行

JAVA
74
字号
package nachos.vm;import nachos.machine.*;import nachos.threads.*;import nachos.userprog.*;import nachos.vm.*;/** * A <tt>UserProcess</tt> that supports demand-paging. */public class VMProcess extends UserProcess {    /**     * Allocate a new process.     */    public VMProcess() {	super();    }    /**     * Save the state of this process in preparation for a context switch.     * Called by <tt>UThread.saveState()</tt>.     */    public void saveState() {	super.saveState();    }    /**     * Restore the state of this process after a context switch. Called by     * <tt>UThread.restoreState()</tt>.     */    public void restoreState() {	super.restoreState();    }    /**     * Initializes page tables for this process so that the executable can be     * demand-paged.     *     * @return	<tt>true</tt> if successful.     */    protected boolean loadSections() {	return super.loadSections();    }    /**     * Release any resources allocated by <tt>loadSections()</tt>.     */    protected void unloadSections() {	super.unloadSections();    }        /**     * Handle a user exception. Called by     * <tt>UserKernel.exceptionHandler()</tt>. The     * <i>cause</i> argument identifies which exception occurred; see the     * <tt>Processor.exceptionZZZ</tt> constants.     *     * @param	cause	the user exception that occurred.     */    public void handleException(int cause) {	Processor processor = Machine.processor();	switch (cause) {	default:	    super.handleException(cause);	    break;	}    }	    private static final int pageSize = Processor.pageSize;    private static final char dbgProcess = 'a';    private static final char dbgVM = 'v';}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?