Files
Fish (David B. Trout) 3c7e2faa23 Rework Facility implementation + new SA23-7832-13 facilities:
1. Use separate numeric 'modnnn' check functions. Each facility should now have its own separate check function! No more sharing of common check functions across multiple facilities! (This should hopefully make the many modnnn check functions easier to understand and maintain.)

2. Add code to featchk.h to ensure all facility FEATURE macros that have multiple macros #defined for them (e.g. facility 45 for example, which has 4 separate "FEATURE_045_xxxxx" macros defined for it), always have *ALL* of their defined macros #defined, or all of them not #defined.

3. Update README with helpful inter-facility dependency and incompatibility charts gleaned from latest POPs to make it easier to code/understand the various inter-facility dependency requirements and relationships.

4. Provide framework for the new facilities introduced by the latest Principles of Operation manual (SA23-7832-13).
2022-07-26 00:54:30 -07:00

82 lines
4.0 KiB
C

/* FACILITY.H (C) Copyright "Fish" (David B. Trout), 2018-2019 */
/* Facility bit structures and functions */
/* */
/* Released under "The Q Public License Version 1" */
/* (http://www.hercules-390.org/herclic.html) as modifications to */
/* Hercules. */
#ifndef _FACILITY_H_
#define _FACILITY_H_
/*-------------------------------------------------------------------*/
/* Facility Table typedefs */
/*-------------------------------------------------------------------*/
typedef bool FACMODCHK( bool enable,
int bitno,
int archnum,
const char* action,
const char* actioning,
const char* opp_actioning,
const char* target_facname );
typedef void FACUPDINS( int hdl_arch, bool enable );
/*-------------------------------------------------------------------*/
/* Facility Table structure */
/*-------------------------------------------------------------------*/
struct FACTAB
{
FACMODCHK* modokfunc; /* Modification Check function */
FACUPDINS* updinstrs; /* Update Opcode Table function */
const char* name; /* Short facility name */
const char* long_name; /* Long name = Description */
int bitno; /* Bit number */
int supmask; /* Which archs support it */
int defmask; /* Default for which archs */
int reqmask; /* Which archs require it */
};
typedef struct FACTAB FACTAB;
/*-------------------------------------------------------------------*/
/* Facility Table macros */
/*-------------------------------------------------------------------*/
#define FT( _sup, _def, _req, _name ) \
{ \
NULL, \
NULL, \
QSTR( _name ), \
NULL, \
STFL_ ## _name, /* stfl.h 'STFL_XXX' bit number #define */ \
_sup, \
_def, \
_req \
},
/*-------------------------------------------------------------------*/
#define FT2( _modokfunc, _updinstrs, _name, _desc ) \
{ \
_modokfunc, \
_updinstrs, \
QSTR( _name ), \
_desc, \
STFL_ ## _name, /* stfl.h 'STFL_XXX' bit number #define */ \
0, \
0, \
0, \
},
/*-------------------------------------------------------------------*/
/* Facility Table functions */
/*-------------------------------------------------------------------*/
extern bool init_facilities_lists();
extern void init_cpu_facilities( REGS* regs );
extern bool facility_query( int argc, char* argv[] );
extern int facility_enable_disable( int argc, char* argv[] );
#endif // _FACILITY_H_