From: MERC::"uunet!WKUVX1.BITNET!goathunter" 11-FEB-1993 19:36:32.19 To: Alpha-IDS@WKUVX1.BITNET CC: Subj: Summary: PCB address in UWSS rundown handler Greetings all, Two weeks I sent an inquiry about how to obtain the PCB address in the rundown handler in a User Written System Service in OpenVMS AXP. This was needed in order to get to the AST listhead in order to remove pending inner mode ASTs. Here is a summary of the replies received with my additional comments. Reply #1 From: Ehud Gavron 602-570-2546 >Well seeing as it's called in process context, how about > movl g^ctl$gl_pcb,r4 >Works for me. This is certainly the easiest and may or may not be necessary according to reply #3 from Digital below. Since it doesn't hurt then the safest thing to do is go ahead and use this. Reply #2 From: mahan@TGV.COM (Patrick L. Mahan) >Well the entry point to rundown handlers are JSB entry points on the Alpha. >You should be using the following to define your entry points to the PLV >vector. >KERNL_RNDWN:: > .JSB_ENTRY Input=R4 > [rundown handler code] > Rsb >This will allow you to access the PCB via R4. This appears to be in disagreement with reply #3 from Digital below which I've been assured is a 'definitive' answer from the actual developer. Reply #3 From: dtn 471-5411 02-Feb-1993 1732 > The rundown routines are invoked with a CALLS instruction on Alpha. > R4 does contain a pointer to the PCB, as it did on VAX, but... I haven't > found any documentation that user written system services can depend on > this. I'm looking into that further. At any rate, it IS loaded from > CTL$GL_PCB shortly before the calls. Reply #4 From: "Jeff Needle, VAXworks, DTN 223-8389, MSO1/M21 (pole E1)" >There's been a change for OpenVMS AXP whereby the image rundown handlers >automatically delete all ASTs with P0 addresses. According to the image >activator maintainer, "It seems like the polite thing to do and made life a lot >easier for some layered products." >This is done for all modes including kernel and exec. The goal was to prevent >crashes due to pending inner mode ASTs. >By the way, this is an Alpha AXP change and is not present on the VAX. So I may not even need the whole rundown handler at all! Oh well... Reply #5 From: ISVNET::ASCI_BEN > I believe R4 still points to the PCB, but in any event, you can > issue the FIND_CPU_DATA macro which requires an output register, > followed with a move of CPU$L_CURPCB. > FIND_CPU_DATA R0 > MOVL CPU$L_CURPCB(R0),R4 ;R4 -> PCB Beware of using this in future AXP SMP environments. To quote from the VAX/VMS IDS pg 1016: "Note that use of this macro is restricted to code that executes in kernel mode with memory management enabled. Furthermore, the code must run at an IPL above 2 between invoking the macro and using the returned address. Code running in process context at IPL 2 or below is subject to rescheduling and subsequent execution on another processor whose per-CPU data area is at a different address." So I reckon what we'll end up using (if we use the rundown handler at all) is something like: .ENTRY RUNDOWN_HANDLER, ^M MOVL G^CTL$GL_PCB, R4 | RET Thank you all for your help. I hope I can return the favor someday. Cheers, Bill Law :-) Law@UCBeh.San.UC.Edu