These are the requirements:
- The calling program must be in 31-bit addressing mode.
- Before you use the CSRL16J service, you must build a parameter
list, L16J, to pass to the service. The parameter list includes the
entry characteristics and environment for the target.
If you are
coding in C/370™, you can include the CSRLJC macro to
provide declarations in the calling program for the L16J parameter
area and return codes.
If you are coding in
PL/I, you can include the CSRLJPLI macro to provide declarations for
the return codes only. See Figure 1 for
the CSRLJPLI macro. Use the data area, mapped by the CSRYL16J mapping
macro, as a model for the structure of your parameter list when coding
in PL/I.
CSRLJC provides the following declarations for use in your C/370 program:
/*********************************************************************
* Type Definitions for User Specified Parameters *
*********************************************************************/
/* Type for user supplied L16J */
typedef struct ??<
int Version; /* Must be 0 */
int Length; /* Initialize to CSRL16J_LENGTH */
int SubPool; /* Subpool of storage to be freed */
union ??<
char GRs??(64??); /* General registers */
int GR??(16??); /* General register 0-15 */
??> u1;
union ??<
char ARs??(64??); /* Access registers */
int AR??(16??); /* Access register 0-15 */
??> u2;
union ??<
char PSW??(8??); /* PSW: the processing will use the address,
AMODE, ASC mode, CC, and program mask. For a
supervisor state or PKM 0-7 or key 0-7
caller, it will use the state and key from
the PSW. Otherwise, it will set to caller
key and state. */
struct ??<
int PSWByte0to3 : 32; /* First 4 bytes */
union ??<
void *PSWAddr; /* Address and AMODE */
struct ??<
int PSWAmode : 1; /* AMODE */
int Rsvd0 : 31;
??> s2;
??> u4;
??> s1;
??> u3;
union ??<
struct ??<
int Flags : 8; /* Flags */
int Rsvd0 : 24; /* Reserved */
??> s3;
struct ??<
int ProcessARs : 1; /* If on, ARs will be processed. Otherwise
not. If not processed, ARs 0, 1, 14, and 15 are
unpredictable. ARs 2-13 are taken from the values
present when the service is entered. */
int Rsvd0 : 31; /* Reserved */
??> s4;
??> u5;
void *AreaToFree; /* Address of area to free. If this is non-0
then the area will be freed using the subpool
specified in L16J.Subpool. This can be used
to free the caller’s entire dynamic area if
so desired. When this option is specified, it
is necessary that the area begin on a
doubleword boundary. */
int LengthToFree; /* Length of area to free, in bytes. */
char Rsvd??(8??); /* Reserved */
??> L16J;
/*********************************************************************
* Fixed Service Parameter and Return Code Defines *
*********************************************************************/
#define CSRL16J_LENGTH 168 /* Length of L16J */
/* Service Return Codes */
#define CSRL16J_OK 0
#define CSRL16J_BAD_VERSION 4
#define CSRL16J_BAD_AMODE 8
#define CSRL16J_BAD_RESERVED 12
#define CSRL16J_BAD_LENGTH 16
#define CSRL16J_BAD_PSW 24
/*********************************************************************
* Function Prototypes for Service Routines *
*********************************************************************/
extern void csrl16j(
L16J *__L16J, /* Input - User supplied L16J block */
int *__RC); /* Output - Return code */
/*********************************************************************
#endif
CSRLJPLI provides the following declarations for use in your PL/I
program:
Figure 1. CSRLJPLI declarations for return
codes for PL/I /********************************************************************
* Constants for Fixed Return Codes *
********************************************************************/
/* Load 16 and Jump Service Return Codes */
%DCL CSRL16J_OK FIXED;
%CSRL16J_OK = 0;
%DCL CSRL16J_BAD_VERSION FIXED;
%CSRL16J_BAD_VERSION = 4;
%DCL CSRL16J_BAD_AMODE FIXED;
%CSRL16J_BAD_AMODE = 8;
%DCL CSRL16J_BAD_RESERVED FIXED;
%CSRL16J_BAD_RESERVED = 12;
%DCL CSRL16J_BAD_LENGTH FIXED;
%CSRL16J_BAD_LENGTH = 16;
%DCL CSRL16J_BAD_PSW FIXED;
%CSRL16J_BAD_PSW = 24;
/********************************************************************
* Service Entry Declarations *
********************************************************************/
DCL CSRL16J ENTRY
(CHAR(168), /* Input - L16J */
FIXED BIN(31)) /* Output - Return code */
OPTIONS(INTER ASSEMBLER);
/* End of Load 16 and Jump Service Declares */