If you are in a Type 2, 3 or 4 SVC, the PSW at the time of the SVC
instruction is in the SVRB whose address is in R5 upon entry, that is the
RBOPSW you would want to interrogate. Your code is looking at the PSW at
the time the callers RB was created, mostly via a LINK or ATTACH SVC, since
it was a problem program.
Wayne Driscoll
Note: all opinions are strictly my own.

On Tue, Apr 30, 2024 at 4:02 AM Erik Janssen <
0000062c999269e8-dmarc-requ...@listserv.ua.edu> wrote:

> <snip>
> >
> >As to the initial question, as pointed out, it depends on the type of the
> SVC. The SVC owner knows what type it is (because they defined it) and can
> look in the right place for that type of SVC, just as they look in the
> right place for the caller's regs (for which the answer is different than
> the psw/key, but similarly depends on the type of the SVC.
> >
> </snip>
>
> I had the idea that this code in the SVC would give me the key the SVC
> caller was executing in:
>
>         USING RBBASIC,R5          POINT TO REQUEST BLOCK
>         L     R7,RBLINK           LOAD CALLER RB IN REG 7
>         DROP  R5                  DROP SVC RB MAPPING
>         USING RBBASIC,R7          AND NOW MAP CALLER RB
>         L     R1,RBOPSW           GET CALLER PSW AND PUT IN REG 1
>         N     R1,=X'00F00000'     ONLY PSW KEY
>         SRL   R1,16               SHIFT TO 000000K0
>         ST    R1,KEY              STORE CALLER KEY
>         DC    H'0'                    FORCE ABEND
>
> However, when I call this SVC from an problem program the switches to key
> 9 before the call:
>
>          SPKA  X'90'(0)                      SWITCH TO KEY 9
>          SVC   255
>
> I see that R1 has a value of x'00000080' (key 8) at the time of the abend,
> where I was expecting x'00000090'.
> Is see that it is possible that there are more request blocks. I'm I not
> looking at the right one, and if so, how do you know if you reached the top
> RB, or is my approach really wrong?
>
> Kind regards,
>
> Erik Janssen.
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Wayne Driscoll
Software Engineer | Mainframe Software Division
Broadcom Software

*Office: *630-300-1931* Mobile:* 630-247-1632
wayne.drisc...@broadcom.com

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to