summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2/ibcs2_ipc.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-12-13 22:41:47 +0000
committeralfred <alfred@FreeBSD.org>2002-12-13 22:41:47 +0000
commit4f48184fb2c8948c406b21c3f802b5b281cef957 (patch)
treea1ef524330ea7e253fb665abea3ddb594cde69fc /sys/i386/ibcs2/ibcs2_ipc.c
parentd19b4e039d47537b44233aae83d03b974d29d771 (diff)
downloadFreeBSD-src-4f48184fb2c8948c406b21c3f802b5b281cef957.zip
FreeBSD-src-4f48184fb2c8948c406b21c3f802b5b281cef957.tar.gz
Backout removal SCARGS, the code freeze is only "selectively" over.
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_ipc.c')
-rw-r--r--sys/i386/ibcs2/ibcs2_ipc.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/sys/i386/ibcs2/ibcs2_ipc.c b/sys/i386/ibcs2/ibcs2_ipc.c
index 943658e..cdf8e87 100644
--- a/sys/i386/ibcs2/ibcs2_ipc.c
+++ b/sys/i386/ibcs2/ibcs2_ipc.c
@@ -106,31 +106,32 @@ ibcs2_msgsys(td, uap)
struct thread *td;
struct ibcs2_msgsys_args *uap;
{
- switch (uap->which) {
+ switch (SCARG(uap, which)) {
case 0: /* msgget */
- uap->which = 1;
+ SCARG(uap, which) = 1;
return msgsys(td, (struct msgsys_args *)uap);
case 1: { /* msgctl */
int error;
struct msgsys_args margs;
caddr_t sg = stackgap_init();
- margs.which = 0;
- margs.a2 = uap->a2;
- margs.a4 =
+ SCARG(&margs, which) = 0;
+ SCARG(&margs, a2) = SCARG(uap, a2);
+ SCARG(&margs, a4) =
(int)stackgap_alloc(&sg, sizeof(struct msqid_ds));
- margs.a3 = uap->a3;
- switch (margs.a3) {
+ SCARG(&margs, a3) = SCARG(uap, a3);
+ switch (SCARG(&margs, a3)) {
case IBCS2_IPC_STAT:
error = msgsys(td, &margs);
if (!error)
cvt_msqid2imsqid(
- (struct msqid_ds *)margs.a4,
- (struct ibcs2_msqid_ds *)uap->a4);
+ (struct msqid_ds *)SCARG(&margs, a4),
+ (struct ibcs2_msqid_ds *)SCARG(uap, a4));
return error;
case IBCS2_IPC_SET:
- cvt_imsqid2msqid((struct ibcs2_msqid_ds *)uap->a4,
- (struct msqid_ds *)margs.a4);
+ cvt_imsqid2msqid((struct ibcs2_msqid_ds *)SCARG(uap,
+ a4),
+ (struct msqid_ds *)SCARG(&margs, a4));
return msgsys(td, &margs);
case IBCS2_IPC_RMID:
return msgsys(td, &margs);
@@ -138,10 +139,10 @@ ibcs2_msgsys(td, uap)
return EINVAL;
}
case 2: /* msgrcv */
- uap->which = 3;
+ SCARG(uap, which) = 3;
return msgsys(td, (struct msgsys_args *)uap);
case 3: /* msgsnd */
- uap->which = 2;
+ SCARG(uap, which) = 2;
return msgsys(td, (struct msgsys_args *)uap);
default:
return EINVAL;
@@ -238,9 +239,9 @@ ibcs2_semsys(td, uap)
{
int error;
- switch (uap->which) {
+ switch (SCARG(uap, which)) {
case 0: /* semctl */
- switch(uap->a4) {
+ switch(SCARG(uap, a4)) {
case IBCS2_IPC_STAT:
{
struct ibcs2_semid_ds *isp;
@@ -249,14 +250,14 @@ ibcs2_semsys(td, uap)
caddr_t sg = stackgap_init();
- ssu = (union semun) uap->a5;
+ ssu = (union semun) SCARG(uap, a5);
sp = stackgap_alloc(&sg, sizeof(struct semid_ds));
sup = stackgap_alloc(&sg, sizeof(union semun));
sup->buf = sp;
- uap->a5 = (int)sup;
+ SCARG(uap, a5) = (int)sup;
error = semsys(td, (struct semsys_args *)uap);
if (!error) {
- uap->a5 = (int)ssu.buf;
+ SCARG(uap, a5) = (int)ssu.buf;
isp = stackgap_alloc(&sg, sizeof(*isp));
cvt_semid2isemid(sp, isp);
error = copyout((caddr_t)isp,
@@ -273,12 +274,12 @@ ibcs2_semsys(td, uap)
isp = stackgap_alloc(&sg, sizeof(*isp));
sp = stackgap_alloc(&sg, sizeof(*sp));
- error = copyin((caddr_t)uap->a5, (caddr_t)isp,
+ error = copyin((caddr_t)SCARG(uap, a5), (caddr_t)isp,
sizeof(*isp));
if (error)
return error;
cvt_isemid2semid(isp, sp);
- uap->a5 = (int)sp;
+ SCARG(uap, a5) = (int)sp;
return semsys(td, (struct semsys_args *)uap);
}
case IBCS2_SETVAL:
@@ -287,8 +288,8 @@ ibcs2_semsys(td, uap)
caddr_t sg = stackgap_init();
sp = stackgap_alloc(&sg, sizeof(*sp));
- sp->val = (int) uap->a5;
- uap->a5 = (int)sp;
+ sp->val = (int) SCARG(uap, a5);
+ SCARG(uap, a5) = (int)sp;
return semsys(td, (struct semsys_args *)uap);
}
}
@@ -350,28 +351,28 @@ ibcs2_shmsys(td, uap)
{
int error;
- switch (uap->which) {
+ switch (SCARG(uap, which)) {
case 0: /* shmat */
return shmsys(td, (struct shmsys_args *)uap);
case 1: /* shmctl */
- switch(uap->a3) {
+ switch(SCARG(uap, a3)) {
case IBCS2_IPC_STAT:
{
struct ibcs2_shmid_ds *isp;
struct shmid_ds *sp;
caddr_t sg = stackgap_init();
- isp = (struct ibcs2_shmid_ds *)uap->a4;
+ isp = (struct ibcs2_shmid_ds *)SCARG(uap, a4);
sp = stackgap_alloc(&sg, sizeof(*sp));
- uap->a4 = (int)sp;
+ SCARG(uap, a4) = (int)sp;
error = shmsys(td, (struct shmsys_args *)uap);
if (!error) {
- uap->a4 = (int)isp;
+ SCARG(uap, a4) = (int)isp;
isp = stackgap_alloc(&sg, sizeof(*isp));
cvt_shmid2ishmid(sp, isp);
error = copyout((caddr_t)isp,
- (caddr_t)uap->a4,
+ (caddr_t)SCARG(uap, a4),
sizeof(*isp));
}
return error;
@@ -384,12 +385,12 @@ ibcs2_shmsys(td, uap)
isp = stackgap_alloc(&sg, sizeof(*isp));
sp = stackgap_alloc(&sg, sizeof(*sp));
- error = copyin((caddr_t)uap->a4, (caddr_t)isp,
+ error = copyin((caddr_t)SCARG(uap, a4), (caddr_t)isp,
sizeof(*isp));
if (error)
return error;
cvt_ishmid2shmid(isp, sp);
- uap->a4 = (int)sp;
+ SCARG(uap, a4) = (int)sp;
return shmsys(td, (struct shmsys_args *)uap);
}
}
OpenPOWER on IntegriCloud