📄 vmprocess.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -