remove CPU_SPIN_SHUTDN

Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
Gwenhael Le Moine 2024-09-22 13:28:31 +02:00
parent b138240450
commit adf3512f3e
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
3 changed files with 1 additions and 74 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
}
/*---------------------------------------------------------------------------
@ -2700,11 +2688,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 +2751,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 +2763,6 @@ int CpuHaltRequest( void )
}
return cpu_status.halt;
#endif
}
/* .+
@ -2822,12 +2797,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 +2806,6 @@ int CpuRunRequest( void )
}
return cpu_status.halt;
#endif
}
/* .+
@ -2866,13 +2833,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

@ -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: