Skip to content

Commit

Permalink
Zowe Suite v2.5.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Nov 30, 2022
2 parents caacd0c + 4f2732d commit 23eb4cc
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions c/le.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ RLEAnchor *makeRLEAnchor(){

#endif /* __ZOWE_OS_ZOS */

anchor->flags |= RLE_FLAGS_VERSIONED;
anchor->version = RLE_ANCHOR_VERSION;
anchor->size = sizeof(RLEAnchor);

return anchor;
}

Expand Down Expand Up @@ -282,6 +286,27 @@ void termRLEEnvironment() {
}
#endif

int setRLEApplicationAnchor(RLEAnchor *anchor, void *applicationAnchor) {
if (!(anchor->flags & RLE_FLAGS_VERSIONED)) {
return -1;
}
if (anchor->version < RLE_ANCHOR_VERSION_USER_APPL_ANCHOR_SUPPORT) {
return -1;
}
anchor->userApplicationAnchor = applicationAnchor;
return 0;
}

int getRLEApplicationAnchor(const RLEAnchor *anchor, void **applicationAnchor) {
if (!(anchor->flags & RLE_FLAGS_VERSIONED)) {
return -1;
}
if (anchor->version < RLE_ANCHOR_VERSION_USER_APPL_ANCHOR_SUPPORT) {
return -1;
}
*applicationAnchor = anchor->userApplicationAnchor;
return 0;
}

/*
This program and the accompanying materials are
Expand Down
25 changes: 25 additions & 0 deletions h/le.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ typedef struct LibraryFunction_tag{
*/
#define RLE_RTL_64 0x0001
#define RLE_RTL_XPLINK 0x0002
#define RLE_FLAGS_VERSIONED 0x0004

#define RLE_ANCHOR_EYECATCHER "RLEANCHR"

#define RLE_ANCHOR_VERSION 2
#define RLE_ANCHOR_VERSION_USER_APPL_ANCHOR_SUPPORT 2

typedef struct RLEAnchor_tag{
char eyecatcher[8]; /* RLEANCHR */
int64 flags;
Expand All @@ -193,6 +197,9 @@ typedef struct RLEAnchor_tag{
however, if applications want dynamic linking of their
services, there must be an anchor point for them, too */
PAD_LONG(0, void *metalDynamicLinkageVector);
int32_t version;
uint32_t size;
PAD_LONG(1, void *userApplicationAnchor);
} RLEAnchor;

/* An RLE Task can run in SRB mode or TCB Mode or switchably depending on run
Expand Down Expand Up @@ -261,6 +268,8 @@ ZOWE_PRAGMA_PACK_RESET
#define termRLEEnvironment LETMRLEE
#define makeFakeCAA LEMKFCAA
#define abortIfUnsupportedCAA LEARTCAA
#define setRLEApplicationAnchor LESETANC
#define getRLEApplicationAnchor LEGETANC

#endif

Expand Down Expand Up @@ -354,6 +363,22 @@ char *makeFakeCAA(char *stackArea, int stackSize);

void abortIfUnsupportedCAA();

/**
* Set the user application field
* @param[in,out] anchor the RLE anchor.
* @param[in] applicationAnchor the application anchor.
* @return 0 if success, -1 if the RLE anchor is incompatible.
*/
int setRLEApplicationAnchor(RLEAnchor *anchor, void *applicationAnchor);

/**
* Get the user application field
* @param[in] anchor the RLE anchor.
* @param[out] applicationAnchor the application anchor.
* @return 0 if success, -1 if the RLE anchor is incompatible.
*/
int getRLEApplicationAnchor(const RLEAnchor *anchor, void **applicationAnchor);

#endif /* __LE__ */

/*
Expand Down

0 comments on commit 23eb4cc

Please sign in to comment.