For a C programmer, include file CSRSIC provides equates for return
codes and data constants, such as Register service request types.
To use CSRSIC, copy the file from SYS1.SAMPLIB to the appropriate
local C library. The contents of the file are:
#ifndef __CSRSI
#define __CSRSI
/*********************************************************************
* Type Definitions for User Specified Parameters *
*********************************************************************/
/* Type for Request operand of CSRSI */
typedef int CSRSIRequest;
/* Type for InfoAreaLen operand of CSRSI */
typedef int CSRSIInfoAreaLen;
/* Type for Return Code */
typedef int CSRSIReturnCode;
/*********************************************************************
* Function Prototypes for Service Routines *
*********************************************************************/
#ifdef __cplusplus
extern "OS" ??&>
#else
#pragma linkage(CSRSI_calltype,OS)
#endif
typedef void CSRSI_calltype(
CSRSIRequest __REQUEST, /* Input - request type */
CSRSIInfoAreaLen __INFOAREALEN, /* Input - length of infoarea */
void *__INFOAREA, /* Input - info area */
CSRSIReturnCode *__RC); /* Output - return code */
extern CSRSI_calltype csrsi;
#ifdef __cplusplus
??>
#endif
#ifndef __cplusplus
#define csrsi_byaddr(Request, Flen, Fptr, Rcptr) \
??&> \
struct CSRSI_PSA* CSRSI_pagezero = 0; \
CSRSI_pagezero->CSRSI_cvt->CSRSI_cvtcsrt->CSRSI_addr \
(Request,Flen,Fptr,Rcptr); \
??>;
#endif
??>;
struct CSRSI_CSRT ??&>
unsigned char CSRSI_csrt_filler1 ??(48??);
CSRSI_calltype* CSRSI_addr;
struct CSRSI_CVT ??&>
unsigned char CSRSI_cvt_filler1 ??(116??);
struct ??&>
int CSRSI_cvtdcb_rsvd1 : 4; /* Not needed */
int CSRSI_cvtosext : 1; /* If on, indicates that the
CVTOSLVL fields are valid */
int CSRSI_cvtdcb_rsvd2 : 3; /* Not needed */
??> CSRSI_cvtdcb;
unsigned char CSRSI_cvt_filler2 ??(427??);
struct CSRSI_CSRT * CSRSI_cvtcsrt;
unsigned char CSRSI_cvt_filler3 ??(716??);
unsigned char CSRSI_cvtoslv0;
unsigned char CSRSI_cvtoslv1;
unsigned char CSRSI_cvtoslv2;
unsigned char CSRSI_cvtoslv3;
struct ??&>
int CSRSI_cvtcsrsi : 1; /* If on, indicates that the
CSRSI service is available */
int CSRSI_cvtoslv1_rsvd1 : 7; /* Not needed */
??> CSRSI_cvtoslv4;
unsigned char CSRSI_cvt_filler4 ??(11??); /* */
??>;
struct CSRSI_PSA ??&>
char CSRSI_psa_filler??(16??);
struct CSRSI_CVT* CSRSI_cvt;
??>;
/* End of CSRSI Header */
#endif
/*********************************************************************/
/* si11v1 represents the output for a V1 CPC when general CPC */
/* information is requested */
/*********************************************************************/
typedef struct ??&>
unsigned char _filler1??(32??); /* Reserved */
unsigned char si11v1cpcmanufacturer??(16??); /*
The 16-character (0-9
or uppercase A-Z) EBCDIC name
of the manufacturer of the V1
CPC. The name is
left-justified with trailing
blank characters if necessary.
*/
unsigned char si11v1cpctype??(4??); /* The 4-character (0-9) EBCDIC
type identifier of the V1 CPC.
*/
unsigned char _filler2??(12??); /* Reserved */
unsigned char si11v1cpcmodel??(16??); /* The 16-character (0-9 or
uppercase A-Z) EBCDIC model
identifier of the V1 CPC. The
identifier is left-justified
with trailing blank characters
if necessary. */
unsigned char si11v1cpcsequencecode??(16??); /*
The 16-character (0-9
or uppercase A-Z) EBCDIC
sequence code of the V1 CPC.
The sequence code is
right-justified with leading
EBCDIC zeroes if necessary.
*/
unsigned char si11v1cpcplantofmanufacture??(4??); /* The 4-character
(0-9 or uppercase A-Z) EBCDIC
plant code that identifies the
plant of manufacture for the
V1 CPC. The plant code is
left-justified with trailing
blank characters if necessary.
*/
unsigned char _filler3??(3996??); /* Reserved */
??> si11v1;
/*********************************************************************/
/* si22v1 represents the output for a V1 CPC when information */
/* is requested about the set of CPUs */
/*********************************************************************/
typedef struct ??&>
unsigned char _filler1??(32??); /* Reserved */
unsigned char si22v1cpucapability??(4??); /*
An unsigned binary integer
that specifies the capability
of one of the CPUs contained
in the V1 CPC. It is used as
an indication of the
capability of the CPU relative
to the capability of other CPU
models. */
unsigned int si22v1totalcpucount : 16; /* A 2-byte
unsigned integer
that specifies the
total number of CPUs contained
in the V1 CPC. This number
includes all CPUs in the
configured state, the standby
state, and the reserved state.
*/
unsigned int si22v1configuredcpucount : 16; /* A 2-byte
unsigned binary
integer that specifies
the total number of CPUs that
are in the configured state. A
CPU is in the configured state
when it is described in the
V1-CPC configuration
definition and is available to
be used to execute programs.
*/
unsigned int si22v1standbycpucount : 16; /* A 2-byte
unsigned integer
that specifies the
total number of CPUs that are
in the standby state. A CPU is
in the standby state when it
is described in the V1-CPC
configuration definition, is
not available to be used to
execute programs, but can be
used to execute programs by
issuing instructions to place
it in the configured state.
*/
unsigned int si22v1reservedcpucount : 16; /* A 2-byte
unsigned binary
integer that specifies
the total number of CPUs that
are in the reserved state. A
CPU is in the reserved state
when it is described in the
V1-CPC configuration
definition, is not available
to be used to execute
programs, and cannot be made
available to be used to
execute programs by issuing
instructions to place it in
the configured state, but it
may be possible to place it in
the standby or configured
state through manually
initiated actions */
struct ??&>
unsigned char _si22v1mpcpucapaf??(2??); /* Each individual
adjustment factor. */
unsigned char _filler2??(4050??);
??> si22v1mpcpucapafs;
??> si22v1;
#define si22v1mpcpucapaf si22v1mpcpucapafs._si22v1mpcpucapaf
/*********************************************************************/
/* si22v2 represents the output for a V2 CPC when information */
/* is requested about the set of CPUs */
/*********************************************************************/
typedef struct ??&>
unsigned char _filler1??(32??); /* Reserved */
unsigned int si22v2cpcnumber : 16; /* A 2-byte
unsigned integer
which is the number of
this V2 CPC. This number
distinguishes this V2 CPC from
all other V2 CPCs provided by
the same logical-partition
hypervisor */
unsigned char _filler2; /* Reserved */
struct ??&>
unsigned int _si22v2lcpudedicated : 1; /*
When one, indicates that
one or more of the logical
CPUs for this V2 CPC are
provided using V1 CPUs that
are dedicated to this V2 CPC
and are not used to provide
logical CPUs for any other V2
CPCs. The number of logical
CPUs that are provided using
dedicated V1 CPUs is specified
by the dedicated-LCPU-count
value. When zero, bit 0
indicates that none of the
logical CPUs for this V2 CPC
are provided using V1 CPUs
that are dedicated to this V2
CPC. */
unsigned int _si22v2lcpushared : 1; /*
When one, indicates that
or more of the logical CPUs
for this V2 CPC are provided
using V1 CPUs that can be used
to provide logical CPUs for
other V2 CPCs. The number of
logical CPUs that are provided
using shared V1 CPUs is
specified by the
shared-LCPU-count value. When
zero, it indicates that none
of the logical CPUs for this
V2 CPC are provided using
shared V1 CPUs. */
unsigned int _si22v2lcpuulimit : 1; /*
Utilization limit. When one,
indicates that the amount of
use of the V1-CPC CPUs that
are used to provide the
logical CPUs for this V2 CPC
is limited. When zero, it
indicates that the amount of
use of the V1-CPC CPUs that
are used to provide the
logical CPUs for this V2 CPC
is unlimited. */
unsigned int _filler3 : 5; /* Reserved
*/
??> si22v2lcpuc; /* Characteristics */
unsigned int si22v2totallcpucount : 16; /*
A 2-byte unsigned
integer that specifies the
total number of logical CPUs
that are provided for this V2
CPC. This number includes all
of the logical CPUs that are
in the configured state, the
standby state, and the
reserved state. */
unsigned int si22v2configuredlcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the total number of logical
CPUs for this V2 CPC that are
in the configured state. A
logical CPU is in the
configured state when it is
described in the V2-CPC
configuration definition and
is available to be used to
execute programs. */
unsigned int si22v2standbylcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the total number of logical
CPUs that are in the standby
state. A logical CPU is in the
standby state when it is
described in the V2-CPC
configuration definition, is
not available to be used to
execute programs, but can be
used to execute programs by
issuing instructions to place
it in the configured state.
*/
unsigned int si22v2reservedlcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the total number of logical
CPUs that are in the reserved
state. A logical CPU is in the
reserved state when it is
described in the V2-CPC
configuration definition, is
not available to be used to
execute programs, and cannot
be made available to be used
to execute programs by issuing
instructions to place it in
the configured state, but it
may be possible to place it in
the standby or configured
state through manually
initiated actions */
unsigned char si22v2cpcname??(16??); /*
The 8-character EBCDIC name of
this V2 CPC. The name is
left-justified with trailing
blank characters if necessary.
*/
unsigned char si22v2cpccapabilityaf??(4??); /* Capability Adjustment
Factor (CAF). An unsigned
binary integer of 1000 or
less. The adjustment factor
specifies the amount of the
V1-CPC capability that is
allowed to be used for this V2
CPC by the logical-partition
hypervisor. The fraction of
V1-CPC capability is
determined by dividing the CAF
value by 1000. */
unsigned char _filler4??(16??); /* Reserved */
unsigned int si22v2dedicatedlcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the number of configured-state
logical CPUs for this V2 CPC
that are provided using
dedicated V1 CPUs. (See the
description of bit
si22v2lcpudedicated.) */
unsigned int si22v2sharedlcpucount : 16; /*
A 2-byte unsigned
integer that specifies the
number of configured-state
logical CPUs for this V2 CPC
that are provided using shared
V1 CPUs. (See the description
of bit si22v2lcpushared.)
*/
unsigned char _filler5??(4012??); /* Reserved */
??> si22v2;
#define si22v2lcpudedicated si22v2lcpuc._si22v2lcpudedicated
#define si22v2lcpushared si22v2lcpuc._si22v2lcpushared
#define si22v2lcpuulimit si22v2lcpuc._si22v2lcpuulimit
/*********************************************************************/
/* si22v3db is a description block that comprises part of the */
/* si22v3 data. */
/*********************************************************************/
typedef struct ??&>
unsigned char _filler1??(4??); /* Reserved */
unsigned int si22v3dbtotallcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the total number of logical
CPUs that are provided for
this V3 CPC. This number
includes all of the logical
CPUs that are in the
configured state, the standby
state, and the reserved state.
*/
unsigned int si22v3dbconfiguredlcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the number of logical CPUs for
this V3 CPC that are in the
configured state. A logical
CPU is in the configured state
when it is described in the
V3-CPC configuration
definition and is available to
be used to execute programs.
*/
unsigned int si22v3dbstandbylcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the number of logical CPUs for
this V3 CPC that are in the
standby state. A logical CPU
is in the standby state when
it is described in the V3-CPC
configuration definition, is
not available to be used to
execute programs, but can be
used to execute programs by
issuing instructions to place
it in the configured state.
*/
unsigned int si22v3dbreservedlcpucount : 16; /*
A 2-byte unsigned
binary integer that specifies
the number of logical CPUs for
this V3 CPC that are in the
reserved state. A logical CPU
is in the reserved state when
it is described in the V2-CPC
configuration definition, is
not available to be used to
execute programs, and cannot
be made available to be used
to execute programs by issuing
instructions to place it in
the configured state, but it
may be possible to place it in
the standby or configured
state through manually
initiated actions */
unsigned char si22v3dbcpcname??(8??); /* The 8-character EBCDIC name
of this V3 CPC. The name is
left-justified with trailing
blank characters if necessary.
*/
unsigned char si22v3dbcpccaf??(4??); /* A 4-byte unsigned binary
integer that specifies an
adjustment factor. The
adjustment factor specifies
the amount of the V1-CPC or
V2-CPC capability that is
allowed to be used for this V3
CPC by the
virtual-machine-hypervisor
program. */
unsigned char si22v3dbvmhpidentifier??(16??); /* The 16-character
EBCDIC identifier of the
virtual-machine-hypervisor
program that provides this V3
CPC. (This identifier may
include qualifiers such as
version number and release
level). The identifier is
left-justified with trailing
blank characters if necessary.
*/
unsigned char _filler2??(24??); /* Reserved */
??> si22v3db;
/*********************************************************************/
/* si22v3 represents the output for a V3 CPC when information */
/* is requested about the set of CPUs */
/*********************************************************************/
typedef struct ??&>
unsigned char _filler1??(28??); /* Reserved */
unsigned char _filler2??(3??); /* Reserved */
struct ??&>
unsigned int _filler3 : 4; /* Reserved
*/
unsigned int _si22v3dbcount : 4; /*
Description Block Count. A
4-bit unsigned binary integer
that indicates the number (up
to 8) of V3-CPC description
blocks that are stored in the
si22v3dbe array. */
??> si22v3dbcountfield; /* */
si22v3db si22v3dbe??(8??); /* Array of entries. Only the number
indicated by si22v3dbcount
are valid */
unsigned char _filler5??(3552??); /* Reserved */
??> si22v3;
#define si22v3dbcount si22v3dbcountfield._si22v3dbcount
/*********************************************************************/
/* SI00 represents the "starter" information. This structure is */
/* part of the information returned on every CSRSI request. */
/*********************************************************************/
typedef struct ??&>
char si00cpcvariety; /* SI00CPCVariety_V1CPC_MACHINE,
SI00CPCVariety_V2CPC_LPAR, or
SI00CPCVariety_V3CPC_VM */
struct ??&>
int _si00validsi11v1 : 1; /* si11v1 was requested and
the information returned is valid
*/
int _si00validsi22v1 : 1; /* si22v2 was requested and
the information returned is valid
*/
int _si00validsi22v2 : 1; /* si22v2 was requested and
the information returned is valid
*/
int _si00validsi22v3 : 1; /* si22v3 was requested and
the information returned is valid
*/
int _filler1 : 4; /* Reserved */
??> si00validityflags;
unsigned char _filler2??(2??); /* Reserved */
unsigned char si00pccacpid??(12??); /* PCCACPID value for this CPU
*/
unsigned char si00pccacpua??(2??); /* PCCACPUA value for this CPU
*/
unsigned char si00pccacafm??(2??); /* PCCACAFM value for this CPU
*/
unsigned char _filler3??(4??); /* Reserved */
unsigned char si00lastupdatetimestamp??(8??); /* Time of last STSI
update, via STCK */
unsigned char _filler4??(32??); /* Reserved */
??> si00;
#define si00validsi11v1 si00validityflags._si00validsi11v1
#define si00validsi22v1 si00validityflags._si00validsi22v1
#define si00validsi22v2 si00validityflags._si00validsi22v2
#define si00validsi22v3 si00validityflags._si00validsi22v3
/*********************************************************************/
/* siv1 represents the information returned when V1CPC_MACHINE */
/* data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv1si00; /* Area mapped by
struct si00 */
si11v1 siv1si11v1; /* Area
mapped by struct si11v1 */
si22v1 siv1si22v1; /* Area
mapped by struct si22v1 */
??> siv1;
/*********************************************************************/
/* siv1v2 represents the information returned when V1CPC_MACHINE */
/* data and V2CPC_LPAR data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv1v2si00; /* Area mapped by
by struct si00 */
si11v1 siv1v2si11v1; /* Area
mapped by struct si11v1 */
si22v1 siv1v2si22v1; /* Area
mapped by struct si22v2 */
si22v2 siv1v2si22v2; /* Area
mapped by struct si22v2 */
??> siv1v2;
/*********************************************************************/
/* siv1v2v3 represents the information returned when V1CPC_MACHINE */
/* data, V2CPC_LPAR data and V3CPC_VM data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv1v2v3si00; /* Area
mapped by struct si00 */
si11v1 siv1v2v3si11v1; /* Area
mapped by struct si11v1 */
si22v1 siv1v2v3si22v1; /* Area
mapped by struct si22v1 */
si22v2 siv1v2v3si22v2; /* Area
mapped by struct si22v2 */
si22v3 siv1v2v3si22v3; /* Area
mapped by struct si22v3 */
??> siv1v2v3;
/*********************************************************************/
/* siv1v3 represents the information returned when V1CPC_MACHINE */
/* data and V3CPC_VM data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv1v3si00; /* Area mapped
by struct si00 */
si11v1 siv1v3si11v1; /* Area
mapped by struct si11v1 */
si22v1 siv1v3si22v1; /* Area
mapped by struct si22v1 */
si22v3 siv1v3si22v3; /* Area
mapped by struct si22v3 */
??> siv1v3;
/*********************************************************************/
/* siv2 represents the information returned when V2CPC_LPAR */
/* data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv2si00; /* Area mapped by
struct si00 */
si22v2 siv2si22v2; /* Area
mapped by struct si22v2 */
??> siv2;
/*********************************************************************/
/* siv2v3 represents the information returned when V2CPC_LPAR */
/* and V3CPC_VM data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv2v3si00; /* Area mapped
by struct si00 */
si22v2 siv2v3si22v2; /* Area
mapped by struct si22v2 */
si22v3 siv2v3si22v3; /* Area
mapped by struct si22v3 */
??> siv2v3;
/*********************************************************************/
/* siv3 represents the information returned when V3CPC_VM */
/* data is requested */
/*********************************************************************/
typedef struct ??&>
si00 siv3si00; /* Area mapped by
struct si00 */
si22v3 siv3si22v3; /* Area
mapped by struct si22v3 */
??> siv3;
/*********************************************************************/
/* Fixed Service Parameter and Return Code Defines */
/*********************************************************************/
/* SI00 Constants */
#define SI00CPCVARIETY_V1CPC_MACHINE 1
#define SI00CPCVARIETY_V2CPC_LPAR 2
#define SI00CPCVARIETY_V3CPC_VM 3
/* CSRSI Constants */
#define CSRSI_REQUEST_V1CPC_MACHINE 1
#define CSRSI_REQUEST_V2CPC_LPAR 2
#define CSRSI_REQUEST_V3CPC_VM 4
/* CSRSI Return codes */
#define CSRSI_SUCCESS 0
#define CSRSI_STSINOTAVAILABLE 4
#define CSRSI_SERVICENOTAVAILABLE 8
#define CSRSI_BADREQUEST 12
#define CSRSI_BADINFOAREALEN 16
#define CSRSI_BADLOCK 20