Skip to content

Commit

Permalink
DEFSYM TXF capable model numbers:
Browse files Browse the repository at this point in the history
As mentioned in GitHub Issue #263 comment:

#263 (comment)
  • Loading branch information
Fish-Git committed Dec 18, 2020
1 parent e1ef27e commit 439d898
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 1 deletion.
9 changes: 9 additions & 0 deletions facility.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,15 @@ FAC_MOD_OK_FUNC ( modtrans )
{
if (!FACILITY_ENABLED_ARCH( 049_EXECUTION_HINT, archnum ))
return HHC00890E( STFL_049_EXECUTION_HINT );

if (1
&& !is_TXF_model( sysblk.cpumodel )
&& MLVL( VERBOSE )
)
{
// "CPUMODEL %04X does not technically support TXF"
WRMSG( HHC02385, "W", sysblk.cpumodel );
}
}
else if (0
|| bitno == STFL_HERC_TXF_RESTRICT_1
Expand Down
13 changes: 13 additions & 0 deletions hsccmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5098,8 +5098,21 @@ int cpumodel_cmd( int argc, char* argv[], char* cmdline )
set_symbol( "CPUMODEL", chmodel );

if (MLVL( VERBOSE ))
{
// "%-14s set to %s"
WRMSG( HHC02204, "I", argv[0], chmodel );

#if defined( _FEATURE_073_TRANSACT_EXEC_FACILITY )
if (1
&& FACILITY_ENABLED_ARCH( 073_TRANSACT_EXEC, ARCH_900_IDX )
&& !is_TXF_model( sysblk.cpumodel )
)
{
// "CPUMODEL %04X does not technically support TXF"
WRMSG( HHC02385, "W", sysblk.cpumodel );
}
#endif
}
}
else
{
Expand Down
4 changes: 4 additions & 0 deletions impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ int rc;

MSGBUF( buf, "%04X", sysblk.cpumodel );
set_symbol( "CPUMODEL", buf );

#if defined( _FEATURE_073_TRANSACT_EXEC_FACILITY )
defsym_TXF_models();
#endif
}

#if defined( _FEATURE_047_CMPSC_ENH_FACILITY )
Expand Down
2 changes: 1 addition & 1 deletion msgenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ LOGM_DLL_IMPORT int panel_command_capture( char* cmd, char** resp );
//efine HHC02382 (available)
//efine HHC02383 (available)
//efine HHC02384 (available)
//efine HHC02385 (available)
#define HHC02385 "CPUMODEL %04X does not technically support TXF"
#define HHC02386 "Configure CPU error %d"
#define HHC02387 "Configure expanded storage error %d"
#define HHC02388 "Configure storage error %d"
Expand Down
52 changes: 52 additions & 0 deletions transact.c
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,58 @@ void dump_tdb( REGS* regs, TDB* tdb )
}
}

/*-------------------------------------------------------------------*/
/* TXF capable model numbers */
/*-------------------------------------------------------------------*/

struct TXFMODELS
{
const U16 cpumodel; // hex model number
const char* pszModel; // (same things as char string)
const char* pszSymbol; // DEFSYM symbol name
};
typedef struct TXFMODELS TXFMODELS;

#define TXF_MODEL( model, name ) { 0x ## model, #model, #name }

static const TXFMODELS txf_models[] =
{
// REF: https://www-01.ibm.com/servers/resourcelink/lib03060.nsf/pages/lsprITRzOSv2r3?OpenDocument#ibm-top

TXF_MODEL( 1090, zPDT ),
TXF_MODEL( 2827, EC12 ),
TXF_MODEL( 2828, BC12 ),
TXF_MODEL( 2964, z13 ),
TXF_MODEL( 2965, z13s ),
TXF_MODEL( 3906, z14 ),
TXF_MODEL( 3907, z14ZR1 ),
TXF_MODEL( 8561, z15 ),
TXF_MODEL( 8562, z15T02 ),
};

/*-------------------------------------------------------------------*/
/* Boolean helper to return whether cpu model is TXF capable or not */
/*-------------------------------------------------------------------*/
bool is_TXF_model( U16 cpumodel )
{
int i;
for (i=0; i < _countof( txf_models ); i++)
if (cpumodel == txf_models[i].cpumodel)
return true;
return false;
}

/*-------------------------------------------------------------------*/
/* Helper function to define DEFSYM symbols for TXF models by name */
/*-------------------------------------------------------------------*/
void defsym_TXF_models()
{
int i;
for (i=0; i < _countof( txf_models ); i++)
// e.g. "CPUMODEL $(z13s)" ==> "CPUMODEL 2965"
set_symbol( txf_models[i].pszSymbol, txf_models[i].pszModel );
}

#endif /* defined( _FEATURE_073_TRANSACT_EXEC_FACILITY ) */

#endif /*!defined(_GEN_ARCH)*/
4 changes: 4 additions & 0 deletions transact.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ const char* txf_why_str( char* buffer, int buffsize, int why );
#define TXF_QSIE( _regs ) SIE_MODE( _regs ) ? "SIE: " : ""
#define TXF_DUMP_PFX( _msg ) #_msg "D " _msg

/* Miscellaneous helper functions (see implementation for details) */
bool is_TXF_model( U16 cpumodel );
void defsym_TXF_models();

/*-------------------------------------------------------------------*/
/* Why transaction was aborted codes */
/*-------------------------------------------------------------------*/
Expand Down

0 comments on commit 439d898

Please sign in to comment.