Compare commits

...

2 commits

Author SHA1 Message Date
Gwenhael Le Moine
9b0150b6a1
remove CPU_SPIN_LOOP references
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2024-09-22 13:30:20 +02:00
Gwenhael Le Moine
adf3512f3e
remove CPU_SPIN_SHUTDN
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2024-09-22 13:28:31 +02:00
4 changed files with 1 additions and 83 deletions

View file

@ -151,30 +151,6 @@
*/
#define DEBUG_LEVEL DEBUG_C_REVISION
/* CPU_SPIN_SHUTDN
If this symbol is defined, the cpu module implements the SHUTDN
instruction as a spin loop; when the instruction is encountered in the
run stream, the program counter is reset to the starting nibble of its
opcode.
If this symbol is not defined, the cpu module implements the SHUTDN
instruction signaling a Chf condition; the main emulator loop
condition handler works in concert with the GUI module to implement
an idle loop when this condition is handled.
This option MUST be defined if the revision of either the cpu emulation
module (cpu.c) or the GUI module (x11.c) is less than 3.1.
Starting from release 3.1, this option is disabled by default, to
waste as little (real) cpu time as possible; however, expect a
loss of timing accuracy.
Notice also that when this function is defined the CpuHaltRequest()
and CpuRunRequest() functions are disabled; as a consequence, all
interactive emulator's extended functions will be disabled as well.
*/
/* #define CPU_SPIN_SHUTDN */
/* 2.1: FORCE_NONMODAL
If this symbol is defined, nonmodal navigation is forced in the
OSF/Motif GUI, by setting navigationType to XmNONE and traversalOn

View file

@ -362,24 +362,12 @@ static void ExecSHUTDN( void )
{
debug1( DEBUG_C_TRACE, CPU_I_CALLED, "SHUTDN" );
#ifdef CPU_SPIN_SHUTDN
/* If the CPU_SPIN_SHUTDN symbol is defined, the CPU module implements
SHUTDN as a spin loop; the program counter is reset to the starting
nibble of the SHUTDN opcode.
*/
cpu_status.PC -= 3;
#endif
/* Set shutdown flag */
cpu_status.shutdn = 1;
#ifndef CPU_SPIN_SHUTDN
/* If the CPU_SPIN_SHUTDN symbol is not defined, the CPU module implements
SHUTDN signalling the condition CPU_I_SHUTDN
*/
/* the CPU module implements SHUTDN signalling the condition CPU_I_SHUTDN */
ChfCondition CPU_I_SHUTDN, CHF_INFO ChfEnd;
ChfSignal();
#endif
}
/*---------------------------------------------------------------------------
@ -2527,11 +2515,6 @@ void CpuReset( void )
/* Set inner_loop and inner_loop_max to default values */
cpu_status.inner_loop = INNER_LOOP_MED;
cpu_status.inner_loop_max = 0;
/* Reset reset_req if necessary */
#ifdef CPU_SPIN_LOOP
cpu_status.reset_req = 0;
#endif
}
/* .+
@ -2700,11 +2683,6 @@ void CpuWake( void )
/* Clear SHUTDN flag */
cpu_status.shutdn = 0;
#ifdef CPU_SPIN_SHUTDN
/* Adjust PC if SHUTDN is implemented using a spin loop */
cpu_status.PC += 3;
#endif
/* Clear PC if necessary */
/* if(cpu_status.OUT == (OutputRegister)0)
cpu_status.PC = (Address)0;
@ -2768,12 +2746,6 @@ int CpuHaltRequest( void )
{
debug1( DEBUG_C_TRACE | DEBUG_C_INT, CPU_I_CALLED, "CpuHaltRequest" );
#ifdef CPU_SPIN_SHUTDN
ChfCondition CPU_E_NO_HALT, CHF_ERROR ChfEnd;
ChfSignal();
return -1;
#else
if ( cpu_status.halt++ == 0 ) {
debug0( DEBUG_C_INT, CPU_I_HALT );
@ -2786,8 +2758,6 @@ int CpuHaltRequest( void )
}
return cpu_status.halt;
#endif
}
/* .+
@ -2822,12 +2792,6 @@ int CpuRunRequest( void )
{
debug1( DEBUG_C_TRACE | DEBUG_C_INT, CPU_I_CALLED, "CpuRunRequest" );
#ifdef CPU_SPIN_SHUTDN
ChfCondition CPU_E_NO_HALT, CHF_ERROR ChfEnd;
ChfSignal();
return -1;
#else
if ( cpu_status.halt > 0 )
if ( --cpu_status.halt == 0 ) {
debug0( DEBUG_C_INT, CPU_I_RUN );
@ -2837,8 +2801,6 @@ int CpuRunRequest( void )
}
return cpu_status.halt;
#endif
}
/* .+
@ -2866,13 +2828,7 @@ int CpuHaltAllowed( void )
{
debug1( DEBUG_C_TRACE | DEBUG_C_INT, CPU_I_CALLED, "CpuHaltAllowed" );
#ifdef CPU_SPIN_SHUTDN
return 0;
#else
return 1;
#endif
}
/* .+

View file

@ -270,10 +270,6 @@ struct CpuStatus {
#define INNER_LOOP_MAX 26
#define INNER_LOOP_MED 13
#define INNER_LOOP_MIN 2
#ifdef CPU_SPIN_LOOP
int reset_req; /* Reset req. after shutdn */
#endif
};
enum ExitOption /* 2.1: EmulatorExit() option */

View file

@ -281,15 +281,6 @@ static ChfAction EmulatorLoopHandler( const ChfDescriptor* d, const ChfState s,
/* Condition from CPU modules; check Condition Code */
switch ( ChfGetConditionCode( d ) ) {
case CPU_I_SHUTDN:
#ifdef CPU_SPIN_SHUTDN
/* CPU shutdown signalled with CPU_SPIN_SHUTDN defined;
Fatal error.
*/
ChfCondition CPU_F_BAD_SHUTDN, CHF_FATAL ChfEnd;
ChfSignal();
act = CHF_RESIGNAL;
#else
{
/* 3.1: CPU_SPIN_SHUTDN is not defined, and the cpu emulator
has just executed a shutdown instruction.
@ -464,7 +455,6 @@ static ChfAction EmulatorLoopHandler( const ChfDescriptor* d, const ChfState s,
act = CHF_CONTINUE;
}
#endif
break;
case CPU_I_EMULATOR_INT: