Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/racf/raclgout.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ racf_logout(ACEE **acee)
unsigned *asxb = (unsigned *)ascb[0x6C/4]; /* A(ASXB) */
ACEE **asxbsenv = (ACEE **) &asxb[0xC8/4]; /* A(ASXBSENV) */
ACEE *oldacee = *asxbsenv; /* prev ACEE */
ACEE *delacee;
RACINIT plist;

/* lock the ASXB (ENQ) address */
Expand Down Expand Up @@ -52,8 +53,9 @@ racf_logout(ACEE **acee)
" MODESET KEY=ZERO,MODE=SUP\n" : : : "1", "14", "15");
}

/* put this ACEE in ASXBSENV */
*asxbsenv = *acee;
/* put this ACEE in ASXBSENV for RACINIT DELETE */
delacee = *acee;
*asxbsenv = delacee;

__asm__("\n"
"*\n"
Expand All @@ -62,12 +64,13 @@ racf_logout(ACEE **acee)
" RACINIT ENVIR=DELETE,ACEE=(%1),MF=(E,%2)\n"
" ST\t15,%0" : "=m"(rc) : "r"(acee), "m"(plist) : "1", "14", "15");

if (oldacee != *acee) {
/* restore previous ACEE in ASXBSENV */
*asxbsenv = oldacee;
if (oldacee == delacee) {
/* ASXBSENV pointed to the ACEE we just deleted — clear it */
*asxbsenv = (ACEE*)0;
}
else {
*asxbsenv = (ACEE*)0;
/* ASXBSENV was a different ACEE — restore it */
*asxbsenv = oldacee;
}

if (sup) {
Expand Down
Loading