mirror of
https://github.com/SDL-Hercules-390/hyperion.git
synced 2026-07-26 02:29:51 +02:00
Add single devnum support to CKD Search Key trace command
This commit is contained in:
@@ -1673,7 +1673,7 @@
|
||||
"Format: \"t?\" displays whether instruction tracing is on or off\n" \
|
||||
"and the address range if any.\n"
|
||||
|
||||
#define tckd_cmd_desc "Turn CKD_KEY tracing on/off"
|
||||
#define tckd_cmd_desc "Turn CKD Search Key tracing on/off"
|
||||
#define odev_cmd_desc "Turn ORB tracing on/off"
|
||||
#define tdev_cmd_desc "Turn CCW tracing on/off"
|
||||
#define tplus_cmd_desc "Turn on instruction tracing"
|
||||
@@ -2082,7 +2082,7 @@ COMMAND( "f{+/-}adr", NULL, SYSCMDNOPER,
|
||||
COMMAND( "o{+/-}dev", NULL, SYSCMDNOPER, odev_cmd_desc, NULL )
|
||||
COMMAND( "t{+/-}dev", NULL, SYSCMDNOPER, tdev_cmd_desc, NULL )
|
||||
#if defined( OPTION_CKD_KEY_TRACING )
|
||||
COMMAND( "t{+/-}CKD", NULL, SYSCMDNOPER, tckd_cmd_desc, NULL )
|
||||
COMMAND( "t{+/-}CKD [devnum]", NULL, SYSCMDNOPER, tckd_cmd_desc, NULL )
|
||||
#endif
|
||||
// PROGRAMMING NOTE: the following CCKD 'sf' shadow file commands
|
||||
// are directly routed by the 'CallHercCmd' function in "cmdtab.c".
|
||||
|
||||
@@ -408,7 +408,8 @@ int altcyls; /* Number alternate cyls */
|
||||
(cu->devt == 0x3990 && // ... or in 24-byte sense
|
||||
ckd->devt == 0x3380)); // ... compatibility for 3380
|
||||
// ... hosted on 3990 controller
|
||||
devchar[10] = ckd->devclass; // Device class code
|
||||
devchar[10] = ckd->devclass; // Device class code:
|
||||
// (always X'20'=DASD)
|
||||
devchar[11] = ckd->code; // Device type code
|
||||
store_hw(devchar+12, cyls - altcyls); // Primary cylinders
|
||||
store_hw(devchar+14, ckd->heads); // Tracks per cylinder
|
||||
|
||||
@@ -41,7 +41,8 @@ typedef struct _CKDDEV { /* CKD Device table entry */
|
||||
const char *name; /* Device name */
|
||||
U16 devt; /* Device type */
|
||||
BYTE model; /* Device model */
|
||||
BYTE devclass; /* Device class */
|
||||
BYTE devclass; /* Device class: X'20'=DASD */
|
||||
#define DEVCLASS_DASD 0x20
|
||||
BYTE code; /* Device code */
|
||||
U16 cyls; /* Number primary cylinders */
|
||||
U16 altcyls; /* Number alternate cylinders*/
|
||||
|
||||
@@ -8034,7 +8034,7 @@ static int fonoff_cmd( REGS* regs, char* cmdline )
|
||||
/*-------------------------------------------------------------------*/
|
||||
int OnOffCommand( int argc, char* argv[], char* cmdline )
|
||||
{
|
||||
char* cmd = cmdline; /* Copy of panel command */
|
||||
char* cmd = cmdline; /* (just a shorter name) */
|
||||
bool plus_enable_on; /* true == x+, false == x- */
|
||||
char* onoroff; /* x+ == "on", x- == "off" */
|
||||
DEVBLK* dev;
|
||||
@@ -8057,82 +8057,160 @@ int OnOffCommand( int argc, char* argv[], char* cmdline )
|
||||
}
|
||||
|
||||
OBTAIN_INTLOCK( NULL );
|
||||
|
||||
if (!IS_CPU_ONLINE( sysblk.pcpu ))
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
// "Processor %s%02X: processor is not %s"
|
||||
WRMSG( HHC00816, "W", PTYPSTR( sysblk.pcpu ), sysblk.pcpu, "online" );
|
||||
return 0;
|
||||
}
|
||||
if (!IS_CPU_ONLINE( sysblk.pcpu ))
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
// "Processor %s%02X: processor is not %s"
|
||||
WRMSG( HHC00816, "W", PTYPSTR( sysblk.pcpu ), sysblk.pcpu, "online" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
regs = sysblk.regs[ sysblk.pcpu ];
|
||||
regs = sysblk.regs[ sysblk.pcpu ];
|
||||
|
||||
// f- and f+ commands - mark 4K page frame as -unusable or +usable
|
||||
// f- and f+ commands - mark 4K page frame as -unusable or +usable
|
||||
|
||||
if (cmd[0] == 'f')
|
||||
{
|
||||
int rc = fonoff_cmd( regs, cmdline );
|
||||
RELEASE_INTLOCK( NULL );
|
||||
return rc;
|
||||
}
|
||||
if (cmd[0] == 'f')
|
||||
{
|
||||
int rc = fonoff_cmd( regs, cmdline );
|
||||
RELEASE_INTLOCK( NULL );
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if defined( OPTION_CKD_KEY_TRACING )
|
||||
|
||||
// t+ckd and t-ckd commands - turn CKD_KEY tracing on/off
|
||||
// t+ckd [devnum] and t-ckd [devnum] commands - turn CKD Search Key tracing on/off
|
||||
|
||||
if ((cmd[0] == 't') && (strcasecmp(cmd+2, "ckd") == 0))
|
||||
{
|
||||
for (dev = sysblk.firstdev; dev != NULL; dev = dev->nextdev)
|
||||
if (1
|
||||
&& (cmd[0] == 't')
|
||||
&& (cmd[2] == 'c' || cmd[2] == 'C')
|
||||
&& (cmd[3] == 'k' || cmd[3] == 'K')
|
||||
&& (cmd[4] == 'd' || cmd[4] == 'D')
|
||||
&& (cmd[5] == 0 || cmd[5] == ' ')
|
||||
)
|
||||
{
|
||||
if (dev->devchar[10] == 0x20)
|
||||
char buf[64]; // (results message buffer)
|
||||
|
||||
if (cmd[5] == 0) // (just "t+ckd" without any device number)
|
||||
{
|
||||
// Enable CKD Search Key tracing for all CKD devices...
|
||||
|
||||
bool bFound = false;
|
||||
|
||||
for (dev = sysblk.firstdev; dev != NULL; dev = dev->nextdev)
|
||||
{
|
||||
if (dev->devchar[10] == DEVCLASS_DASD)
|
||||
{
|
||||
bFound = true;
|
||||
dev->ckdkeytrace = plus_enable_on;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFound)
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
// "No dasd devices found"
|
||||
WRMSG( HHC02226, "E" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Build results message
|
||||
MSGBUF( buf, "%s for all dasd devices", onoroff );
|
||||
}
|
||||
else if (cmd[5] != ' ')
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
// "Invalid argument %s%s"
|
||||
WRMSG( HHC02205, "E", cmd, "" );
|
||||
return -1;
|
||||
}
|
||||
else // (optional device number presumably specified)
|
||||
{
|
||||
const char* p;
|
||||
U16 lcss, devnum;
|
||||
|
||||
// Position to start of devnum operand
|
||||
for (p = &cmd[6]; *p && *p == ' '; ++p);
|
||||
|
||||
// Parse the device number
|
||||
if (parse_single_devnum( p, &lcss, &devnum ) < 0)
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
return -1; // (error message already displayed)
|
||||
}
|
||||
|
||||
// Validate device number
|
||||
if (!(dev = find_device_by_devnum( lcss, devnum )))
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
// HHC02200 "%1d:%04X device not found"
|
||||
devnotfound_msg( lcss, devnum );
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (dev->devchar[10] != DEVCLASS_DASD)
|
||||
{
|
||||
RELEASE_INTLOCK( NULL );
|
||||
// "%1d:%04X is not a dasd device"
|
||||
WRMSG( HHC02225, "E", lcss, devnum );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Enable CKD Search Key tracing for this device
|
||||
dev->ckdkeytrace = plus_enable_on;
|
||||
|
||||
// Build results message
|
||||
MSGBUF( buf, "%s for device %1d:%04X", onoroff, lcss, devnum );
|
||||
}
|
||||
|
||||
RELEASE_INTLOCK( NULL );
|
||||
|
||||
// "%-14s set to %s"
|
||||
WRMSG( HHC02204, "I", "CKD key trace", buf );
|
||||
return 0;
|
||||
}
|
||||
RELEASE_INTLOCK( NULL );
|
||||
WRMSG( HHC02204, "I", "CKD key trace", onoroff );
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// o+devn and o-devn commands - turn ORB tracing on/off
|
||||
// t+devn and t-devn commands - turn CCW tracing on/off
|
||||
// o+devn and o-devn commands - turn ORB tracing on/off
|
||||
// t+devn and t-devn commands - turn CCW tracing on/off
|
||||
|
||||
if (1
|
||||
&& (cmd[0] == 'o' || cmd[0] == 't')
|
||||
&& parse_single_devnum_silent( &cmd[2], &lcss, &devnum ) == 0
|
||||
)
|
||||
{
|
||||
char* typ;
|
||||
char buf[40];
|
||||
|
||||
if (!(dev = find_device_by_devnum( lcss, devnum )))
|
||||
if (1
|
||||
&& (cmd[0] == 'o' || cmd[0] == 't')
|
||||
&& parse_single_devnum_silent( &cmd[2], &lcss, &devnum ) == 0
|
||||
)
|
||||
{
|
||||
// HHC02200 "%1d:%04X device not found"
|
||||
devnotfound_msg( lcss, devnum );
|
||||
char* typ;
|
||||
char buf[40];
|
||||
|
||||
if (!(dev = find_device_by_devnum( lcss, devnum )))
|
||||
{
|
||||
// HHC02200 "%1d:%04X device not found"
|
||||
devnotfound_msg( lcss, devnum );
|
||||
RELEASE_INTLOCK( NULL );
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (cmd[0] == 'o')
|
||||
{
|
||||
typ = "ORB trace";
|
||||
dev->orbtrace = plus_enable_on;
|
||||
}
|
||||
else // (cmd[0] == 't')
|
||||
{
|
||||
typ = "CCW trace";
|
||||
dev->orbtrace = plus_enable_on;
|
||||
dev->ccwtrace = plus_enable_on;
|
||||
}
|
||||
MSGBUF( buf, "%s for %1d:%04X", typ, lcss, devnum );
|
||||
// "%-14s set to %s"
|
||||
WRMSG( HHC02204, "I", buf, onoroff );
|
||||
RELEASE_INTLOCK( NULL );
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (cmd[0] == 'o')
|
||||
{
|
||||
typ = "ORB trace";
|
||||
dev->orbtrace = plus_enable_on;
|
||||
}
|
||||
else // (cmd[0] == 't')
|
||||
{
|
||||
typ = "CCW trace";
|
||||
dev->orbtrace = plus_enable_on;
|
||||
dev->ccwtrace = plus_enable_on;
|
||||
}
|
||||
MSGBUF( buf, "%s for %1d:%04X", typ, lcss, devnum );
|
||||
// "%-14s set to %s"
|
||||
WRMSG( HHC02204, "I", buf, onoroff );
|
||||
RELEASE_INTLOCK( NULL );
|
||||
return 0;
|
||||
}
|
||||
|
||||
RELEASE_INTLOCK( NULL );
|
||||
|
||||
// "Invalid argument %s%s"
|
||||
WRMSG( HHC02205, "E", cmd, "" );
|
||||
return -1;
|
||||
|
||||
+1
-1
@@ -1132,7 +1132,7 @@ panel commands:
|
||||
tt32 *Control/query CTCI-WIN functionality
|
||||
txf *Transactional-Execution Facility tracing
|
||||
tzoffset Set tzoffset parameter
|
||||
t{+/-}CKD Turn CKD_KEY tracing on/off
|
||||
t{+/-}CKD [devnum] Turn CKD Search Key tracing on/off
|
||||
t{+/-}dev Turn CCW tracing on/off
|
||||
u *Disassemble storage
|
||||
uptime Display how long Hercules has been running
|
||||
|
||||
@@ -1357,8 +1357,8 @@ LOGM_DLL_IMPORT int panel_command_capture( char* cmd, char** resp, bool quiet )
|
||||
#define HHC02222 "Unsupported function"
|
||||
#define HHC02223 "%s of %s-labeled volume %s pending for drive %u:%4.4X %s"
|
||||
#define HHC02224 "Store status rejected: CPU not stopped"
|
||||
//efine HHC02225 (available)
|
||||
//efine HHC02226 (available)
|
||||
#define HHC02225 "%1d:%04X is not a dasd device"
|
||||
#define HHC02226 "No dasd devices found"
|
||||
#define HHC02227 "Shell/Exec commands are disabled"
|
||||
#define HHC02228 "%s key pressed"
|
||||
#define HHC02229 "Instruction %s %s%s%s"
|
||||
|
||||
Reference in New Issue
Block a user