.title PCA$OBJ PCA collector activation routine .ident /OSD-V1.00/ .sbttl Documentation ; ; You know, I find it frustrating when DEC writes some utility ; that costs 2 arms and a leg and looks really nice on paper, then ; when you get it you learn the terror behind the words "Version 1.0" ; in ways you never dreamed of! Well, in one (very) small way, I'm ; fighting back! The layered product PCA falls into the category ; "It's a nice idea, but..." and probably will for the next year or ; so. I don't plan on rewriting the entire PCA product, but I did ; find the need to make my own version of PCA$OBJ. We have a non- ; homogenous cluster with PCA installed on only 1 node. It is a ; less than pretty sight to see how a program linked with PCA blows ; up when it is run on another node. The object file produced ; by this code takes the place of the SYS$SHARE:PCA$OBJ.OBJ shipped ; with PCA. If PCA is installed on the system that the image linked ; with this file is on, PCA will come up normally. If PCA is not ; installed, LIB$FIND_IMAGE_SYMBOL will give an error message and ; the program will start to run anyway. In our situation it is ; kind of handy. ; ; It may not be perfect, but it seems to work! ; ; Eric F. Richards ; 17-Jun-86 ; Gould OSD VAX/VMS V4.3, Macro V04-00, PCA V1.1-1 ; .disable traceback, debug $ssdef .sbttl Code and Data .page .psect PCA$OBJ ; psect name to match DEC text: .ascii /PCA$COLLECTOR/ ; image name, len1 = . - text ; ...image length .ascii /_MAIN/ ; suffix for sym name len2 = . - text ; ...and length .entry pca$activate_collector, 0 ; collector entry point pushal b^text ; build a descr for the pushl s^#len1 ; ...image to activate movl sp, r1 ; save a pointer to it pushal b^text ; build a descr for the pushl s^#len2 ; ...symbol to evaluate movl sp, r0 ; save a pointer to it pushl #0 ; make a buffer for start addr pushl sp ; write sym value here pushl r0 ; this is the symbol to eval pushl r1 ; this is the file to open calls #3, g^lib$find_image_symbol ; load image and get symbol popl r1 ; get starting collector addr movl fp, sp ; unwind stack blbc r0, 10$ ; on error drop out movl r1, r0 ; make sure PCA gets its env ; ; At this point, we have exactly the same environment as the ; DEC supplied PCA$OBJ leaves you with: R0 is the Collector entry ; point, no registers saved, nothing on the stack. ; jmp 2(r0) ; jump past entry mask 10$: tstb (ap) ; did we get args on stack? beql 20$ ; if not (shouldn't happen) ret movl 4(ap), r0 ; get transfer address array beql 20$ ; if no array, exit (unlikely!) movl 4(r0), r0 ; get second xfer address beql 20$ ; if no second address, exit callg (ap), (r0) ; call the main program ret ; go outta here 20$: movzwl #ss$_abort, r0 ; unrecoverable error ret ; get outta here .end pca$activate_collector ; ...that's it!