diff options
-rw-r--r-- | usr.sbin/afs/src/lwp/process.hpux.S | 235 |
1 files changed, 191 insertions, 44 deletions
diff --git a/usr.sbin/afs/src/lwp/process.hpux.S b/usr.sbin/afs/src/lwp/process.hpux.S index 873f9c45c44..c1071d22a6c 100644 --- a/usr.sbin/afs/src/lwp/process.hpux.S +++ b/usr.sbin/afs/src/lwp/process.hpux.S @@ -83,59 +83,61 @@ _returnto: /* this code is PIC */ .CODE - ; + /* ; savecontext(f, area1, newsp) ; int (*f)(); ; struct savearea *area1; ; char *newsp; - ; + */ savecontext .PROC - ; + /* ; Callinfo sets up register saves using the ENTRY_GR ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid ; for PA 1.1. (How to deal with this for 800?) - ; + */ .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 + /* ; The ENTER statement generates register saves and ; procedure setup. + */ .ENTER - LDI 1,%r1 ; Store a (char) 1 in - LDW T'PRE_Block(0,%r19),%r31 ; global variable - STB %r1,0(0,%r31) ; PRE_Block. + LDI 1,%r1 /* Store a (char) 1 in */ + LDW T%PRE_Block(0,%r19),%r31 /* global variable */ + STB %r1,0(0,%r31) /* PRE_Block. */ - COPY %arg0,%r22 ; Copy arg0 (f) to dyncall's input register. + COPY %arg0,%r22 /* Copy arg0 (f) to dyncall's input register */ - COMIB,= 0,%arg2,L$0001 ; Compare arg2 (newsp) to 0. Execute the - ; next instruction regardless of value. - STW %r30,0(0,%arg1) ; Store the stack pointer in the first - ; element (0th offset) of arg1 (area1). - COPY %arg2,%r30 ; Move arg2 (newsp) into the stack ptr. + COMIB,= 0,%arg2,L$0001 /* Compare arg2 (newsp) to 0. Execute the */ + /* next instruction regardless of value. */ + STW %r30,0(0,%arg1) /* Store the stack pointer in the first */ + /* element (0th offset) of arg1 (area1). */ + COPY %arg2,%r30 /* Move arg2 (newsp) into the stack ptr. */ L$0001 .CALL - BL $$dyncall,%r31 ; Dynamic call using pointer in r22. + BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */ COPY %r31,%r2 - COPY %r20, %r19 ; restore link table. + COPY %r20, %r19 /* restore link table. */ .CALL - BL exit,%r2 ; Can't get here, so abort. + BL exit,%r2 /* Can't get here, so abort. */ NOP .LEAVE .PROCEND - ; returnto(area2) - ; struct savearea *area2; - ; + /* returnto(area2) + * struct savearea *area2; + */ returnto .PROC .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 - ; No ENTRY is used since this is a magic routine. - LDWS 0(0,%arg0),%r30 ; Load the stack pointer from area2 + /* No ENTRY is used since this is a magic routine. */ + LDWS 0(0,%arg0),%r30 /* Load the stack pointer from area2 */ - LDW T'PRE_Block(0,%r19),%r31 ; set PRE_Block = 0; + LDW T%PRE_Block(0,%r19),%r31 /* set PRE_Block = 0; */ STB %r0,0(0,%r31) .LEAVE .PROCEND @@ -151,58 +153,59 @@ returnto /* non-pic'ified code */ .CODE - ; + /* ; savecontext(f, area1, newsp) ; int (*f)(); ; struct savearea *area1; ; char *newsp; - ; + */ savecontext .PROC - ; + /* ; Callinfo sets up register saves using the ENTRY_GR ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid ; for PA 1.1. (How to deal with this for 800?) - ; + */ .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 - ; The ENTER statement generates register saves and - ; procedure setup. + /* The ENTER statement generates register saves and */ + /* procedure setup. */ .ENTER - LDI 1,%r31 ; Store a (char) 1 in - ADDIL LR'PRE_Block-$global$,%r27 ; global variable - STB %r31,RR'PRE_Block-$global$(0,%r1) ; PRE_Block. + LDI 1,%r31 /* Store a (char) 1 in */ + ADDIL L%PRE_Block-$global$,%r27 /* global variable */ + STB %r31,R%PRE_Block-$global$(0,%r1) /* PRE_Block. */ - COPY %r26,%r22 ; Copy arg0 (f) to dyncall's input register. + COPY %r26,%r22 /* Copy arg0 (f) to dyncall's input register. */ - COMIB,= 0,%r24,L$0001 ; Compare arg2 (newsp) to 0. Execute the - ; next instruction regardless of value. - STWS %r30,0(0,%r25) ; Store the stack pointer in the first - ; element (0th offset) of arg1 (area1). - COPY %r24,%r30 ; Move arg2 (newsp) into the stack ptr. + COMIB,= 0,%r24,L$0001 /* Compare arg2 (newsp) to 0. Execute the */ + /* next instruction regardless of value. */ + STWS %r30,0(0,%r25) /* Store the stack pointer in the first */ + /* element (0th offset) of arg1 (area1). */ + COPY %r24,%r30 /* Move arg2 (newsp) into the stack ptr. */ L$0001 .CALL - BL $$dyncall,%r31 ; Dynamic call using pointer in r22. + BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */ COPY %r31,%r2 .CALL - BL abort,%r2 ; Can't get here, so abort. + BL abort,%r2 /* Can't get here, so abort. NOP .LEAVE .PROCEND + /* ; returnto(area2) ; struct savearea *area2; - ; + */ returnto .PROC .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 - ; No ENTRY is used since this is a magic routine. - ADDIL LR'PRE_Block-$global$,%r27 ; PRE_Block = 0 - STB %r0,RR'PRE_Block-$global$(0,%r1) + /* No ENTRY is used since this is a magic routine. */ + ADDIL L%PRE_Block-$global$,%r27 /* PRE_Block = 0 */ + STB %r0,R%PRE_Block-$global$(0,%r1) - LDWS 0(0,%r26),%r30 ; Load the stack pointer from area2 + LDWS 0(0,%r26),%r30 /* Load the stack pointer from area2 */ .LEAVE .PROCEND @@ -217,3 +220,147 @@ returnto #endif /* AFS_HPUX_PIC_ENV */ #endif /* hp9000s300 */ #endif /* AFS_HPUX_ENV */ + +#ifdef AFS_BSD_ENV +#ifdef AFS_BSD_PIC_ENV +/* this code is PIC */ + .CODE + + /* + ; savecontext(f, area1, newsp) + ; int (*f)(); + ; struct savearea *area1; + ; char *newsp; + */ +savecontext + .PROC + /* + ; Callinfo sets up register saves using the ENTRY_GR + ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid + ; for PA 1.1. (How to deal with this for 800?) + */ + .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 + /* + ; The ENTER statement generates register saves and + ; procedure setup. + */ + .ENTER + + LDI 1,%r1 /* Store a (char) 1 in */ + LDW T%PRE_Block(0,%r19),%r31 /* global variable */ + STB %r1,0(0,%r31) /* PRE_Block. */ + + + COPY %arg0,%r22 /* Copy arg0 (f) to dyncall's input register */ + + COMIB,= 0,%arg2,L$0001 /* Compare arg2 (newsp) to 0. Execute the */ + /* next instruction regardless of value. */ + STW %r30,0(0,%arg1) /* Store the stack pointer in the first */ + /* element (0th offset) of arg1 (area1). */ + COPY %arg2,%r30 /* Move arg2 (newsp) into the stack ptr. */ + +L$0001 + .CALL + BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */ + COPY %r31,%r2 + COPY %r20, %r19 /* restore link table. */ + + .CALL + BL exit,%r2 /* Can't get here, so abort. */ + NOP + .LEAVE + .PROCEND + + /* returnto(area2) + * struct savearea *area2; + */ +returnto + .PROC + .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 + /* No ENTRY is used since this is a magic routine. */ + LDWS 0(0,%arg0),%r30 /* Load the stack pointer from area2 */ + + LDW T%PRE_Block(0,%r19),%r31 /* set PRE_Block = 0; */ + STB %r0,0(0,%r31) + .LEAVE + .PROCEND + + .EXPORT savecontext,ENTRY + .EXPORT returnto,ENTRY + .IMPORT PRE_Block,DATA + .IMPORT $$dyncall,MILLICODE + .IMPORT exit,CODE + + .END +#else /* AFS_BSD_PIC_ENV */ +/* non-pic'ified code */ + .IMPORT $global$,DATA + .IMPORT PRE_Block,DATA + .IMPORT $$dyncall,MILLICODE + .IMPORT abort,CODE + + .text + + /* + ; savecontext(f, area1, newsp) + ; int (*f)(); + ; struct savearea *area1; + ; char *newsp; + */ + .EXPORT savecontext,ENTRY +savecontext + .PROC + /* + ; Callinfo sets up register saves using the ENTRY_GR + ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid + ; for PA 1.1. (How to deal with this for 800?) + */ + .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 + /* The ENTER statement generates register saves and */ + /* procedure setup. */ + .ENTRY + + LDI 1,%r31 /* Store a (char) 1 in */ + ADDIL L%PRE_Block-$global$,%r27 /* global variable */ + STB %r31,R%PRE_Block-$global$(0,%r1) /* PRE_Block. */ + + COPY %r26,%r22 /* Copy arg0 (f) to dyncall's input register. */ + + COMIB,= 0,%r24,L$0001 /* Compare arg2 (newsp) to 0. Execute the */ + /* next instruction regardless of value. */ + STWS %r30,0(0,%r25) /* Store the stack pointer in the first */ + /* element (0th offset) of arg1 (area1). */ + COPY %r24,%r30 /* Move arg2 (newsp) into the stack ptr. */ + +L$0001 + .CALL + BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */ + COPY %r31,%r2 + + .CALL + BL abort,%r2 /* Can't get here, so abort. */ + NOP + .EXIT + .PROCEND + + .text + + /* + ; returnto(area2) + ; struct savearea *area2; + */ + .EXPORT returnto,ENTRY +returnto + .PROC + .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21 + .ENTRY + ADDIL L%PRE_Block-$global$,%r27 /* PRE_Block = 0 */ + STB %r0,R%PRE_Block-$global$(0,%r1) + + LDWS 0(0,%r26),%r30 /* Load the stack pointer from area2 */ + .EXIT + .PROCEND + + .END +#endif /* AFS_BSD_PIC_ENV */ +#endif /* AFS_BSD_ENV */ |