use struct pointer for args (void * may be different on some machines)
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 26 Jun 1990 05:29:45 +0000 (21:29 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 26 Jun 1990 05:29:45 +0000 (21:29 -0800)
SCCS-vsn: sys/hp300/hp300/trap.c 7.7
SCCS-vsn: sys/tahoe/tahoe/trap.c 7.10
SCCS-vsn: sys/vax/vax/trap.c 7.10

usr/src/sys/hp300/hp300/trap.c
usr/src/sys/tahoe/tahoe/trap.c
usr/src/sys/vax/vax/trap.c

index bcb725c..af9cba3 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: trap.c 1.28 89/09/25$
  *
  *
  * from: Utah $Hdr: trap.c 1.28 89/09/25$
  *
- *     @(#)trap.c      7.6 (Berkeley) %G%
+ *     @(#)trap.c      7.7 (Berkeley) %G%
  */
 
 #include "cpu.h"
  */
 
 #include "cpu.h"
@@ -526,7 +526,10 @@ syscall(code, frame)
        register struct sysent *callp;
        register struct proc *p = u.u_procp;
        int error, opc, numsys;
        register struct sysent *callp;
        register struct proc *p = u.u_procp;
        int error, opc, numsys;
-       int args[8], rval[2];
+       struct args {
+               int i[8];
+       } args;
+       int rval[2];
        struct timeval syst;
        struct sysent *systab;
 #ifdef HPUXCOMPAT
        struct timeval syst;
        struct sysent *systab;
 #ifdef HPUXCOMPAT
@@ -558,7 +561,7 @@ syscall(code, frame)
        else
                callp = &systab[code];
        if ((i = callp->sy_narg * sizeof (int)) &&
        else
                callp = &systab[code];
        if ((i = callp->sy_narg * sizeof (int)) &&
-           (error = copyin(params, (caddr_t)args, (u_int)i))) {
+           (error = copyin(params, (caddr_t)&args, (u_int)i))) {
 #ifdef HPUXCOMPAT
                if (p->p_flag & SHPUX)
                        error = bsdtohpuxerrno(error);
 #ifdef HPUXCOMPAT
                if (p->p_flag & SHPUX)
                        error = bsdtohpuxerrno(error);
@@ -567,23 +570,23 @@ syscall(code, frame)
                frame.f_sr |= PSL_C;    /* carry bit */
 #ifdef KTRACE
                if (KTRPOINT(p, KTR_SYSCALL))
                frame.f_sr |= PSL_C;    /* carry bit */
 #ifdef KTRACE
                if (KTRPOINT(p, KTR_SYSCALL))
-                       ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+                       ktrsyscall(p->p_tracep, code, callp->sy_narg, args.i);
 #endif
                goto done;
        }
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSCALL))
 #endif
                goto done;
        }
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSCALL))
-               ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+               ktrsyscall(p->p_tracep, code, callp->sy_narg, args.i);
 #endif
        rval[0] = 0;
        rval[1] = frame.f_regs[D1];
 #ifdef HPUXCOMPAT
        /* debug kludge */
        if (callp->sy_call == notimp)
 #endif
        rval[0] = 0;
        rval[1] = frame.f_regs[D1];
 #ifdef HPUXCOMPAT
        /* debug kludge */
        if (callp->sy_call == notimp)
-               error = notimp(u.u_procp, args, rval, code, callp->sy_narg);
+               error = notimp(u.u_procp, args.i, rval, code, callp->sy_narg);
        else
 #endif
        else
 #endif
-       error = (*callp->sy_call)(u.u_procp, args, rval);
+       error = (*callp->sy_call)(u.u_procp, &args, rval);
        if (error == ERESTART)
                frame.f_pc = opc;
        else if (error != EJUSTRETURN) {
        if (error == ERESTART)
                frame.f_pc = opc;
        else if (error != EJUSTRETURN) {
index bb6abd8..e0d3259 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)trap.c      7.9 (Berkeley) %G%
+ *     @(#)trap.c      7.10 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -217,7 +217,10 @@ syscall(sp, type, hfs, accmst, acclst, dbl, code, pc, psl)
        register struct proc *p = u.u_procp;
        struct timeval syst;
        int error, opc;
        register struct proc *p = u.u_procp;
        struct timeval syst;
        int error, opc;
-       int args[8], rval[2];
+       struct args {
+               int i[8];
+       } args;
+       int rval[2];
 
 #ifdef lint
        r0 = 0; r0 = r0; r1 = 0; r1 = r1;
 
 #ifdef lint
        r0 = 0; r0 = r0; r1 = 0; r1 = r1;
@@ -251,22 +254,22 @@ syscall(sp, type, hfs, accmst, acclst, dbl, code, pc, psl)
        else
                callp = &sysent[code];
        if ((i = callp->sy_narg * sizeof (int)) &&
        else
                callp = &sysent[code];
        if ((i = callp->sy_narg * sizeof (int)) &&
-           (error = copyin(params, (caddr_t)args, (u_int)i)) != 0) {
+           (error = copyin(params, (caddr_t)&args, (u_int)i)) != 0) {
                locr0[R0] = error;
                locr0[PS] |= PSL_C;     /* carry bit */
 #ifdef KTRACE
                if (KTRPOINT(p, KTR_SYSCALL))
                locr0[R0] = error;
                locr0[PS] |= PSL_C;     /* carry bit */
 #ifdef KTRACE
                if (KTRPOINT(p, KTR_SYSCALL))
-                       ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+                       ktrsyscall(p->p_tracep, code, callp->sy_narg, args.i);
 #endif
                goto done;
        }
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSCALL))
 #endif
                goto done;
        }
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSCALL))
-               ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+               ktrsyscall(p->p_tracep, code, callp->sy_narg, args.i);
 #endif
        rval[0] = 0;
        rval[1] = locr0[R1];
 #endif
        rval[0] = 0;
        rval[1] = locr0[R1];
-       error = (*callp->sy_call)(u.u_procp, args, rval);
+       error = (*callp->sy_call)(u.u_procp, &args, rval);
        if (error == ERESTART)
                pc = opc;
        else if (error != EJUSTRETURN) {
        if (error == ERESTART)
                pc = opc;
        else if (error != EJUSTRETURN) {
index 838eefa..9bed5fe 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)trap.c      7.9 (Berkeley) %G%
+ *     @(#)trap.c      7.10 (Berkeley) %G%
  */
 
 #include "psl.h"
  */
 
 #include "psl.h"
@@ -190,7 +190,10 @@ syscall(sp, type, code, pc, psl)
        register struct sysent *callp;
        register struct proc *p = u.u_procp;
        int error, opc;
        register struct sysent *callp;
        register struct proc *p = u.u_procp;
        int error, opc;
-       int args[8], rval[2];
+       struct args {
+               int i[8];
+       } args;
+       int rval[2];
        struct timeval syst;
 
        syst = u.u_ru.ru_stime;
        struct timeval syst;
 
        syst = u.u_ru.ru_stime;
@@ -210,22 +213,22 @@ syscall(sp, type, code, pc, psl)
        else
                callp = &sysent[code];
        if ((i = callp->sy_narg * sizeof (int)) &&
        else
                callp = &sysent[code];
        if ((i = callp->sy_narg * sizeof (int)) &&
-           (error = copyin(params, (caddr_t)args, (u_int)i)) != 0) {
+           (error = copyin(params, (caddr_t)&args, (u_int)i)) != 0) {
                locr0[R0] = error;
                locr0[PS] |= PSL_C;     /* carry bit */
 #ifdef KTRACE
                if (KTRPOINT(p, KTR_SYSCALL))
                locr0[R0] = error;
                locr0[PS] |= PSL_C;     /* carry bit */
 #ifdef KTRACE
                if (KTRPOINT(p, KTR_SYSCALL))
-                       ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+                       ktrsyscall(p->p_tracep, code, callp->sy_narg, args.i);
 #endif
                goto done;
        }
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSCALL))
 #endif
                goto done;
        }
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSCALL))
-               ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+               ktrsyscall(p->p_tracep, code, callp->sy_narg, args.i);
 #endif
        rval[0] = 0;
        rval[1] = locr0[R1];
 #endif
        rval[0] = 0;
        rval[1] = locr0[R1];
-       error = (*callp->sy_call)(u.u_procp, args, rval);
+       error = (*callp->sy_call)(u.u_procp, &args, rval);
        if (error == ERESTART)
                pc = opc;
        else if (error != EJUSTRETURN) {
        if (error == ERESTART)
                pc = opc;
        else if (error != EJUSTRETURN) {