git: e5b099765058 - main - freebsd32: add a union semun_old32
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 17 Nov 2021 20:22:22 UTC
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e5b0997650582504139835fdaad07d166127e5fc commit e5b0997650582504139835fdaad07d166127e5fc Author: Brooks Davis <brooks@FreeBSD.org> AuthorDate: 2021-11-17 20:12:23 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> CommitDate: 2021-11-17 20:12:23 +0000 freebsd32: add a union semun_old32 Use this for COMPAT7 support. In practice it's the same as union semun32 since the pointers become uint32_t's the it's more symetric and is the logical thing to generate from semun_old. Reviewed by: kevans --- sys/compat/freebsd32/freebsd32_ipc.h | 6 ++++++ sys/compat/freebsd32/freebsd32_proto.h | 2 +- sys/compat/freebsd32/syscalls.master | 2 +- sys/kern/sysv_sem.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_ipc.h b/sys/compat/freebsd32/freebsd32_ipc.h index ac469585cafe..d1fa7f1cf8ca 100644 --- a/sys/compat/freebsd32/freebsd32_ipc.h +++ b/sys/compat/freebsd32/freebsd32_ipc.h @@ -181,6 +181,12 @@ struct shmid_ds32_old { uint32_t shm_internal; }; +union semun_old32 { + int val; + uint32_t buf; + uint32_t array; +}; + void freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip); void freebsd32_ipcperm_old_out(struct ipc_perm *ip, diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index 34ba0974c9b9..c3a7dd241c47 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -1171,7 +1171,7 @@ struct freebsd7_freebsd32_semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char arg_l_[PADL_(union semun32 *)]; union semun32 * arg; char arg_r_[PADR_(union semun32 *)]; + char arg_l_[PADL_(union semun_old32 *)]; union semun_old32 * arg; char arg_r_[PADR_(union semun_old32 *)]; }; struct freebsd7_freebsd32_msgctl_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 81ed039a4195..d9feba7aef0e 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -420,7 +420,7 @@ 220 AUE_SEMCTL COMPAT7|NOSTD { int freebsd32_semctl( \ int semid, int semnum, \ - int cmd, union semun32 *arg); } + int cmd, union semun_old32 *arg); } 221 AUE_SEMGET NOSTD|NOPROTO { int semget(key_t key, int nsems, \ int semflg); } 222 AUE_SEMOP NOSTD|NOPROTO { int semop(int semid, \ diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index dd8925246d1e..274226481fa7 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1870,7 +1870,7 @@ freebsd7_freebsd32_semctl(struct thread *td, struct semid_ds32_old dsbuf32; struct semid_ds dsbuf; union semun semun; - union semun32 arg; + union semun_old32 arg; register_t rval; int error;