Skip to content

Commit

Permalink
Tweak disabled wait and 'stop' response to lessen confusion.
Browse files Browse the repository at this point in the history
Closes #631.
  • Loading branch information
Fish-Git committed Feb 29, 2024
1 parent 4f51886 commit 2e763e9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 24 deletions.
3 changes: 2 additions & 1 deletion cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,8 +1861,9 @@ void (ATTR_REGPARM(1) ARCH_DEP(process_interrupt))(REGS *regs)
|| !(sysblk.started_mask ^ regs->cpubit)
)
{
char buf[40];
char buf[128];
STR_PSW( regs, buf );
STRLCAT( buf, "; processor stopped" );

if (regs->insttrace && sysblk.traceFILE)
tf_0809( regs, buf );
Expand Down
62 changes: 40 additions & 22 deletions hscpufun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,36 +1087,54 @@ int stop_cmd_cpu( int argc, char* argv[], char* cmdline )

UPPER_ARGV_0( argv );

UNREFERENCED(argc);
UNREFERENCED(argv);
UNREFERENCED(cmdline);

OBTAIN_INTLOCK(NULL);
UNREFERENCED( argc );
UNREFERENCED( argv );
UNREFERENCED( cmdline );

if (IS_CPU_ONLINE(sysblk.pcpu))
OBTAIN_INTLOCK( NULL );
{
REGS *regs = sysblk.regs[sysblk.pcpu];
if ( regs->cpustate != CPUSTATE_STARTED )
if (IS_CPU_ONLINE( sysblk.pcpu ))
{
WRMSG(HHC00816, "W", PTYPSTR(sysblk.pcpu), sysblk.pcpu, "started");
rc = 1;
REGS* regs = sysblk.regs[ sysblk.pcpu ];

if (regs->cpustate != CPUSTATE_STARTED)
{
if (1
&& regs->cpustate == CPUSTATE_STOPPED
&& WAITSTATE( &regs->psw )
&& IS_IC_DISABLED_WAIT_PSW( regs )
)
{
// "Processor %s%02X: processor already stopped due to disabled wait"
WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ));
}
else
{
// "Processor %s%02X: processor is not %s"
WRMSG( HHC00816, "W", PTYPSTR( sysblk.pcpu ), sysblk.pcpu, "started" );
}
rc = 1;
}
else
{
regs->opinterv = 1;
regs->cpustate = CPUSTATE_STOPPING;

ON_IC_INTERRUPT( regs );
WAKEUP_CPU( regs );

// "Processor %s%02X: %s"
WRMSG( HHC00834, "I", PTYPSTR(sysblk.pcpu), sysblk.pcpu, "manual state selected" );
}
}
else
{
regs->opinterv = 1;
regs->cpustate = CPUSTATE_STOPPING;
ON_IC_INTERRUPT(regs);
WAKEUP_CPU (regs);
WRMSG( HHC00834, "I", PTYPSTR(sysblk.pcpu), sysblk.pcpu, "manual state selected" );
// "Processor %s%02X: processor is not %s"
WRMSG( HHC00816, "W", PTYPSTR( sysblk.pcpu ), sysblk.pcpu, "online" );
rc = 1;
}
}
else
{
WRMSG(HHC00816, "W", PTYPSTR(sysblk.pcpu), sysblk.pcpu, "online");
rc = 1;
}

RELEASE_INTLOCK(NULL);
RELEASE_INTLOCK( NULL );

return rc;
}
Expand Down
2 changes: 1 addition & 1 deletion msgenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ LOGM_DLL_IMPORT int panel_command_capture( char* cmd, char** resp, bool quiet )
#define HHC00823 "You have %d seconds to attach a debugger before crash dump will be taken!"
#define HHC00824 "Debugger attached! NOT crashing!"
#define HHC00825 "TIME'S UP! (or debugger has been detached!) - Forcing crash dump!"
//efine HHC00826 (available)
#define HHC00826 "Processor %s%02X: processor already stopped due to disabled wait"
#define HHC00827 "Processor %s%02X: engine %02X type %1d set: %s"
#define HHC00828 "Processor %s%02X: ipl failed: %s" // (IPL I/O error)
#define HHC00829 "Command cannot be issued once system has been IPLed"
Expand Down

0 comments on commit 2e763e9

Please sign in to comment.