From: system@SendSpamHere.ORG Sent: Friday, March 03, 2000 9:43 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: UWSS ALPHA Arg list homing and read access In article <004aa0e3.c0dc768b@usw-ex0109-069.remarq.com>, Richard writes: >Is everyone else really struggling with C to do this? > >All I want to know is "Has everyone else stopped probing >the arg list on Alpha?" > >In the test code below you can see the probe commented out. > >A pointer to a manual would be great. I couldn't find it. > >Cheers Richard Maher. > >;++ >; (c) Copyright Tier3 Software >;-- > .TITLE Test Alpha User Written System Services > > .LIBRARY "SYS$LIBRARY:LIB.MLB" > > .MACRO >DEFINE_SERVICE,NAME,NARG=0,MODE=EXEC,EACCVIO,?CHKCNT,? ^^^^^^^-------------> ?EACCVIO >ENDMACRO > > 'MODE'_ROUTINE_COUNT='MODE'_ROUTINE_COUNT+1 > > .CALL_ENTRY MAX_ARGS=NARG, - > HOME_ARGS=TRUE, - > LABEL=NAME > > .SAVE_PSECT LOCAL_BLOCK > > .PSECT 'MODE'_LIST,LONG,WRT,NOEXE,PIC,CON > > .ADDRESS NAME > > .RESTORE_PSECT > > .IF NOT_EQUAL NARG > >; IFNORD #<+4>,(AP),EACCVIO >; BRB CHKCNT >;EACCVIO: >; MOVZWL #SS$_ABORT,R0 >; RET >;CHKCNT: > CMPB (AP),#NARG > BGEQ ENDMACRO > MOVZWL #SS$_INSFARG,R0 > RET > >ENDMACRO: > .ENDC > .ENDM > > $PLVDEF > $SSDEF > >KERNEL_ROUTINE_COUNT=0 >EXEC_ROUTINE_COUNT=0 > > .PSECT EXEC_LIST,LONG,WRT,NOEXE,PIC,CON >EXEC_TABLE: > > .PSECT KERNEL_LIST,LONG,WRT,NOEXE,PIC,CON >KERNEL_TABLE: > > .PSECT USER_CODE,BYTE,NOWRT,EXE,PIC > > DEFINE_SERVICE USER_GET_TODR,1 > > MOVL 4(AP),R5 ; Get address to >store time of day >register > IFNOWRT #4,(R5),10$ ; Branch if not >writable > MOVL #SS$_NORMAL,R0 ; Set normal >completion status > RET ; and return > >10$: MOVZWL #SS$_ACCVIO,R0 ; Indicate access >violation > RET ; > > DEFINE_SERVICE USER_SET_PFC,2 > > MOVL 8(AP),R6 ; Get address to >store previous >value > BEQL 10$ ; Branch if none > IFNOWRT #4,(R6),30$ ; Branch if not >writable >10$: MOVL #SS$_NORMAL,R0 ; Set normal >completion status > RET ; and return > >30$: MOVZWL #SS$_ACCVIO,R0 ; Indicate access >violation > RET ; > > DEFINE_SERVICE USER_NULL > > MOVZWL #SS$_NORMAL,R0 ; Set normal >completion status > RET ; and return >;+ >; Any psect with the VEC attribute will be automatically >moved to the start > of the image. >;- > .PSECT USER_SERVICES,PAGE,VEC,PIC,NOWRT,EXE > > .LONG PLV$C_TYP_CMOD ; Set type >of vector to >change mode dispatcher > .LONG 0 ; Reserved > .LONG KERNEL_ROUTINE_COUNT ; # of >Kernel mode routines > .LONG EXEC_ROUTINE_COUNT ; # of >Executive mode >routines > .ADDRESS KERNEL_TABLE ; Kernel >routine list > .ADDRESS EXEC_TABLE ; Exec >routine list > .LONG 0 ; Kernel >rundown handler > .LONG 0 ; Exec >rundown handler > .LONG 0 ; RMS >Dispatcher > .LONG 0 ; Kernel >routine flags > .LONG 0 ; Exec >routine flags > > .END Care to tell us exactly what your problem is? If it was the missing ? on the EACCVIO in the .MACRO definition well, I've already pointed that out to you. As for actually probing the argument list, it may not be necessary *IF* you are homing it. The calling standard will preserve stack space for the homed arguments on the stack and the code will place the argument register values into this reserved stack space before you get to your probe. It would seem that if the code can write to this space then you should also be able to read it. -- VAXman- OpenVMS APE certification number: AAA-0001 VAXman@TMESIS.COM