git: 465b80c04a77 - main - freebsd32: thread IDs are int32_t

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

URL: https://cgit.FreeBSD.org/src/commit/?id=465b80c04a7765a5ccccafddc8eec5f9444f62cf

commit 465b80c04a7765a5ccccafddc8eec5f9444f62cf
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: thread IDs are int32_t
    
    Thread IDs are of type long which means int32_t on 32-bit systems.
    While this detail is handled without compat functions, expose it
    here as code to generate prototypes from the default syscalls.master
    will do so.
    
    Reviewed by:    kevans
---
 sys/compat/freebsd32/freebsd32_systrace_args.c | 24 ++++++++++++------------
 sys/compat/freebsd32/syscalls.master           | 12 ++++++------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c
index 5532ba1b942e..0315b0b3f142 100644
--- a/sys/compat/freebsd32/freebsd32_systrace_args.c
+++ b/sys/compat/freebsd32/freebsd32_systrace_args.c
@@ -2028,21 +2028,21 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 	/* thr_exit */
 	case 431: {
 		struct thr_exit_args *p = params;
-		uarg[0] = (intptr_t)p->state; /* long * */
+		uarg[0] = (intptr_t)p->state; /* int32_t * */
 		*n_args = 1;
 		break;
 	}
 	/* thr_self */
 	case 432: {
 		struct thr_self_args *p = params;
-		uarg[0] = (intptr_t)p->id; /* long * */
+		uarg[0] = (intptr_t)p->id; /* int32_t * */
 		*n_args = 1;
 		break;
 	}
 	/* thr_kill */
 	case 433: {
 		struct thr_kill_args *p = params;
-		iarg[0] = p->id; /* long */
+		iarg[0] = p->id; /* int32_t */
 		iarg[1] = p->sig; /* int */
 		*n_args = 2;
 		break;
@@ -2102,7 +2102,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 	/* thr_wake */
 	case 443: {
 		struct thr_wake_args *p = params;
-		iarg[0] = p->id; /* long */
+		iarg[0] = p->id; /* int32_t */
 		*n_args = 1;
 		break;
 	}
@@ -2278,7 +2278,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 	/* thr_set_name */
 	case 464: {
 		struct thr_set_name_args *p = params;
-		iarg[0] = p->id; /* long */
+		iarg[0] = p->id; /* int32_t */
 		uarg[1] = (intptr_t)p->name; /* const char * */
 		*n_args = 2;
 		break;
@@ -2486,7 +2486,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 	case 481: {
 		struct thr_kill2_args *p = params;
 		iarg[0] = p->pid; /* pid_t */
-		iarg[1] = p->id; /* long */
+		iarg[1] = p->id; /* int32_t */
 		iarg[2] = p->sig; /* int */
 		*n_args = 3;
 		break;
@@ -6690,7 +6690,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	case 431:
 		switch (ndx) {
 		case 0:
-			p = "userland long *";
+			p = "userland int32_t *";
 			break;
 		default:
 			break;
@@ -6700,7 +6700,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	case 432:
 		switch (ndx) {
 		case 0:
-			p = "userland long *";
+			p = "userland int32_t *";
 			break;
 		default:
 			break;
@@ -6710,7 +6710,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	case 433:
 		switch (ndx) {
 		case 0:
-			p = "long";
+			p = "int32_t";
 			break;
 		case 1:
 			p = "int";
@@ -6813,7 +6813,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	case 443:
 		switch (ndx) {
 		case 0:
-			p = "long";
+			p = "int32_t";
 			break;
 		default:
 			break;
@@ -7110,7 +7110,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	case 464:
 		switch (ndx) {
 		case 0:
-			p = "long";
+			p = "int32_t";
 			break;
 		case 1:
 			p = "userland const char *";
@@ -7519,7 +7519,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 			p = "pid_t";
 			break;
 		case 1:
-			p = "long";
+			p = "int32_t";
 			break;
 		case 2:
 			p = "int";
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index bc836ae676c4..ac0ece71ef5b 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -786,9 +786,9 @@
 429	AUE_SIGWAIT	NOPROTO	{ int sigwait(const sigset_t *set, \
 				    int *sig); }
 430	AUE_THR_CREATE	UNIMPL	thr_create;
-431	AUE_THR_EXIT	NOPROTO	{ void thr_exit(long *state); }
-432	AUE_NULL	NOPROTO	{ int thr_self(long *id); }
-433	AUE_THR_KILL	NOPROTO	{ int thr_kill(long id, int sig); }
+431	AUE_THR_EXIT	NOPROTO	{ void thr_exit(int32_t *state); }
+432	AUE_NULL	NOPROTO	{ int thr_self(int32_t *id); }
+433	AUE_THR_KILL	NOPROTO	{ int thr_kill(int32_t id, int sig); }
 434	AUE_NULL	COMPAT10 { int freebsd32_umtx_lock( \
 				    struct umtx *umtx); }
 435	AUE_NULL	COMPAT10 { int freebsd32_umtx_unlock( \
@@ -808,7 +808,7 @@
 				    const struct timespec32 *abstime); }
 442	AUE_NULL	STD	{ int freebsd32_thr_suspend( \
 				    const struct timespec32 *timeout); }
-443	AUE_NULL	NOPROTO	{ int thr_wake(long id); }
+443	AUE_NULL	NOPROTO	{ int thr_wake(int32_t id); }
 444	AUE_MODUNLOAD	NOPROTO	{ int kldunloadf(int fileid, int flags); }
 445	AUE_AUDIT	NOPROTO	{ int audit(const void *record, \
 				    u_int length); }
@@ -851,7 +851,7 @@
 				    const struct sigevent32 *sigev); }
 462	AUE_MQ_UNLINK	NOPROTO|NOSTD	{ int kmq_unlink(const char *path); }
 463	AUE_NULL	NOPROTO	{ int abort2(const char *why, int nargs, void **args); }
-464	AUE_NULL 	NOPROTO	{ int thr_set_name(long id, const char *name); }
+464	AUE_NULL 	NOPROTO	{ int thr_set_name(int32_t id, const char *name); }
 465	AUE_AIO_FSYNC	STD	{ int freebsd32_aio_fsync(int op, \
 				    struct aiocb32 *aiocbp); }
 466	AUE_RTPRIO	NOPROTO	{ int rtprio_thread(int function, \
@@ -912,7 +912,7 @@
 480	AUE_FTRUNCATE	STD	{ int freebsd32_ftruncate(int fd, \
 				    uint32_t length1, uint32_t length2); }
 #endif
-481	AUE_THR_KILL2	NOPROTO	{ int thr_kill2(pid_t pid, long id, int sig); }
+481	AUE_THR_KILL2	NOPROTO	{ int thr_kill2(pid_t pid, int32_t id, int sig); }
 482	AUE_SHMOPEN	COMPAT12|NOPROTO	{ int shm_open( \
 				    const char *path, int flags, mode_t mode); }
 483	AUE_SHMUNLINK	NOPROTO	{ int shm_unlink(const char *path); }