Sets the current state of the hardware and also saves this state so that future Reset() calls will reset to that epigenetic state
| 2133 | // Sets the current state of the hardware and also saves this state so |
| 2134 | // that future Reset() calls will reset to that epigenetic state |
| 2135 | void cHardwareCPU::InheritState(cHardwareBase& in_hardware) |
| 2136 | { |
| 2137 | m_epigenetic_state = true; |
| 2138 | cHardwareCPU& in_h = (cHardwareCPU&)in_hardware; |
| 2139 | const cLocalThread& thread = in_h.GetThread(in_h.GetCurThread()); |
| 2140 | for (int i=0; i<NUM_REGISTERS; i++) { |
| 2141 | m_epigenetic_saved_reg[i] = thread.reg[i]; |
| 2142 | m_threads[m_cur_thread].reg[i] = m_epigenetic_saved_reg[i]; |
| 2143 | } |
| 2144 | m_epigenetic_saved_stack = thread.stack; |
| 2145 | m_threads[m_cur_thread].stack = m_epigenetic_saved_stack; |
| 2146 | } |
| 2147 | |
| 2148 | ////////////////////////// |
| 2149 | // And the instructions... |
no test coverage detected