git: 158dcd7395ad - main - freebsd32: have sigqueue take a void *

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Wed, 17 Nov 2021 20:22:46 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=158dcd7395ad894ca5c62e5a66cc5c1b067a0fe6

commit 158dcd7395ad894ca5c62e5a66cc5c1b067a0fe6
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-11-17 20:12:26 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-11-17 20:12:26 +0000

    freebsd32: have sigqueue take a void *
    
    This matches the default ABI and we work around issues with
    union sigval by extracting the bottom 32-bits in a manual handler.
    
    Reviewed by:    kevans
---
 sys/compat/freebsd32/freebsd32_misc.c          | 2 +-
 sys/compat/freebsd32/freebsd32_proto.h         | 2 +-
 sys/compat/freebsd32/freebsd32_systrace_args.c | 4 ++--
 sys/compat/freebsd32/syscalls.master           | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 5bff0cea845e..eab217283197 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -3082,7 +3082,7 @@ freebsd32_sigqueue(struct thread *td, struct freebsd32_sigqueue_args *uap)
 	 * more common.
 	 */
 	bzero(&sv, sizeof(sv));
-	sv.sival_int = uap->value;
+	sv.sival_int = (uint32_t)(uint64_t)uap->value;
 
 	return (kern_sigqueue(td, uap->pid, uap->signum, &sv));
 }
diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h
index 50733c35d51b..9025871780aa 100644
--- a/sys/compat/freebsd32/freebsd32_proto.h
+++ b/sys/compat/freebsd32/freebsd32_proto.h
@@ -384,7 +384,7 @@ struct freebsd32_thr_new_args {
 struct freebsd32_sigqueue_args {
 	char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)];
 	char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)];
-	char value_l_[PADL_(int)]; int value; char value_r_[PADR_(int)];
+	char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)];
 };
 struct freebsd32_kmq_open_args {
 	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c
index 6727bd8e5c76..971a7a4ca416 100644
--- a/sys/compat/freebsd32/freebsd32_systrace_args.c
+++ b/sys/compat/freebsd32/freebsd32_systrace_args.c
@@ -2238,7 +2238,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 		struct freebsd32_sigqueue_args *p = params;
 		iarg[0] = p->pid; /* pid_t */
 		iarg[1] = p->signum; /* int */
-		iarg[2] = p->value; /* int */
+		uarg[2] = (intptr_t)p->value; /* void * */
 		*n_args = 3;
 		break;
 	}
@@ -7071,7 +7071,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 			p = "int";
 			break;
 		case 2:
-			p = "int";
+			p = "userland void *";
 			break;
 		default:
 			break;
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index 3734219fba30..8a4f9b56b7d5 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -858,7 +858,7 @@
 				    struct thr_param32 *param,	\
 				    int param_size); }
 456	AUE_NULL	STD	{ int freebsd32_sigqueue(pid_t pid, \
-				    int signum, int value); }
+				    int signum, void *value); }
 457	AUE_MQ_OPEN	NOSTD	{ int freebsd32_kmq_open( \
 				    const char *path, int flags, mode_t mode, \
 				    const struct mq_attr32 *attr); }