Commit 43f1a7c1 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Store memory and the profiler into the machine state, will later be captured by OOB calls.

parent 2590c64e
......@@ -9,6 +9,8 @@
package cc.squirreljme.vm.summercoat;
import net.multiphasicapps.profiler.ProfilerSnapshot;
/**
* This contains the machine state.
*
......@@ -16,9 +18,33 @@ package cc.squirreljme.vm.summercoat;
*/
public final class MachineState
{
/** The virtual machine memory. */
protected final WritableMemory memory;
/** The profiler snapshot to write to. */
protected final ProfilerSnapshot profiler;
/** Was the supervisor okay? */
private volatile boolean _supervisorokay;
/**
* Initializes the machine state.
*
* @param __mem The memory state.
* @param __pf The profiler, this is optional.
* @throws NullPointerException If no memory was specified.
* @since 2019/12/28
*/
public MachineState(WritableMemory __mem, ProfilerSnapshot __pf)
throws NullPointerException
{
if (__mem == null)
throw new NullPointerException("NARG");
this.memory = __mem;
this.profiler = __pf;
}
/**
* Flags that the supervisor booted okay.
*
......
......@@ -371,7 +371,7 @@ public class SummerCoatFactory
}
// Setup non-cpu VM state
MachineState ms = new MachineState();
MachineState ms = new MachineState(vmem, __ps);
// Setup virtual execution CPU
NativeCPU cpu = new NativeCPU(ms, vmem, 0, __ps);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment