Date: Wed, 17 Nov 2021 20:22:52 GMT From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 265a4b8341ab - main - freebsd32: semid_t -> int32_t Message-ID: <202111172022.1AHKMqra060290@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=265a4b8341abbabd43b3a293c76dc5209fa9f7da commit 265a4b8341abbabd43b3a293c76dc5209fa9f7da 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: semid_t -> int32_t semid_t is historically an intptr_t so it should be an int32_t. Reviewed by: kevans --- sys/compat/freebsd32/freebsd32_proto.h | 6 ++--- sys/compat/freebsd32/freebsd32_systrace_args.c | 36 +++++++++++++------------- sys/compat/freebsd32/syscalls.master | 18 ++++++------- sys/kern/uipc_sem.c | 4 +-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index a7a38e39dccc..50a71a28c607 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -335,11 +335,11 @@ struct freebsd32_sendfile_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct freebsd32_ksem_init_args { - char idp_l_[PADL_(semid_t *)]; semid_t * idp; char idp_r_[PADR_(semid_t *)]; + char idp_l_[PADL_(int32_t *)]; int32_t * idp; char idp_r_[PADR_(int32_t *)]; char value_l_[PADL_(unsigned int)]; unsigned int value; char value_r_[PADR_(unsigned int)]; }; struct freebsd32_ksem_open_args { - char idp_l_[PADL_(semid_t *)]; semid_t * idp; char idp_r_[PADR_(semid_t *)]; + char idp_l_[PADL_(int32_t *)]; int32_t * idp; char idp_r_[PADR_(int32_t *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; char oflag_l_[PADL_(int)]; int oflag; char oflag_r_[PADR_(int)]; char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; @@ -364,7 +364,7 @@ struct freebsd32_swapcontext_args { char ucp_l_[PADL_(const struct __ucontext32 *)]; const struct __ucontext32 * ucp; char ucp_r_[PADR_(const struct __ucontext32 *)]; }; struct freebsd32_ksem_timedwait_args { - char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)]; + char id_l_[PADL_(int32_t)]; int32_t id; char id_r_[PADR_(int32_t)]; char abstime_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abstime; char abstime_r_[PADR_(const struct timespec32 *)]; }; struct freebsd32_thr_suspend_args { diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 1d39fc026802..c7221993837a 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -1872,35 +1872,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_close */ case 400: { struct ksem_close_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ *n_args = 1; break; } /* ksem_post */ case 401: { struct ksem_post_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ *n_args = 1; break; } /* ksem_wait */ case 402: { struct ksem_wait_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ *n_args = 1; break; } /* ksem_trywait */ case 403: { struct ksem_trywait_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ *n_args = 1; break; } /* freebsd32_ksem_init */ case 404: { struct freebsd32_ksem_init_args *p = params; - uarg[0] = (intptr_t)p->idp; /* semid_t * */ + uarg[0] = (intptr_t)p->idp; /* int32_t * */ uarg[1] = p->value; /* unsigned int */ *n_args = 2; break; @@ -1908,7 +1908,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_ksem_open */ case 405: { struct freebsd32_ksem_open_args *p = params; - uarg[0] = (intptr_t)p->idp; /* semid_t * */ + uarg[0] = (intptr_t)p->idp; /* int32_t * */ uarg[1] = (intptr_t)p->name; /* const char * */ iarg[2] = p->oflag; /* int */ iarg[3] = p->mode; /* mode_t */ @@ -1926,7 +1926,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_getvalue */ case 407: { struct ksem_getvalue_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ uarg[1] = (intptr_t)p->val; /* int * */ *n_args = 2; break; @@ -1934,7 +1934,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_destroy */ case 408: { struct ksem_destroy_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ *n_args = 1; break; } @@ -2119,7 +2119,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_ksem_timedwait */ case 441: { struct freebsd32_ksem_timedwait_args *p = params; - iarg[0] = p->id; /* semid_t */ + iarg[0] = p->id; /* int32_t */ uarg[1] = (intptr_t)p->abstime; /* const struct timespec32 * */ *n_args = 2; break; @@ -6468,7 +6468,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 400: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; default: break; @@ -6478,7 +6478,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 401: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; default: break; @@ -6488,7 +6488,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 402: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; default: break; @@ -6498,7 +6498,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 403: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; default: break; @@ -6508,7 +6508,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 404: switch (ndx) { case 0: - p = "userland semid_t *"; + p = "userland int32_t *"; break; case 1: p = "unsigned int"; @@ -6521,7 +6521,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 405: switch (ndx) { case 0: - p = "userland semid_t *"; + p = "userland int32_t *"; break; case 1: p = "userland const char *"; @@ -6553,7 +6553,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 407: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; case 1: p = "userland int *"; @@ -6566,7 +6566,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 408: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; default: break; @@ -6879,7 +6879,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 441: switch (ndx) { case 0: - p = "semid_t"; + p = "int32_t"; break; case 1: p = "userland const struct timespec32 *"; diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index f4b71ab1f3c4..b5b63b37bfbc 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -753,19 +753,19 @@ const struct fhandle *u_fhp, \ struct freebsd11_statfs *buf); } 399 AUE_NULL RESERVED -400 AUE_SEMCLOSE NOSTD|NOPROTO { int ksem_close(semid_t id); } -401 AUE_SEMPOST NOSTD|NOPROTO { int ksem_post(semid_t id); } -402 AUE_SEMWAIT NOSTD|NOPROTO { int ksem_wait(semid_t id); } -403 AUE_SEMTRYWAIT NOSTD|NOPROTO { int ksem_trywait(semid_t id); } -404 AUE_SEMINIT NOSTD { int freebsd32_ksem_init(semid_t *idp, \ +400 AUE_SEMCLOSE NOSTD|NOPROTO { int ksem_close(int32_t id); } +401 AUE_SEMPOST NOSTD|NOPROTO { int ksem_post(int32_t id); } +402 AUE_SEMWAIT NOSTD|NOPROTO { int ksem_wait(int32_t id); } +403 AUE_SEMTRYWAIT NOSTD|NOPROTO { int ksem_trywait(int32_t id); } +404 AUE_SEMINIT NOSTD { int freebsd32_ksem_init(int32_t *idp, \ unsigned int value); } -405 AUE_SEMOPEN NOSTD { int freebsd32_ksem_open(semid_t *idp, \ +405 AUE_SEMOPEN NOSTD { int freebsd32_ksem_open(int32_t *idp, \ const char *name, int oflag, \ mode_t mode, unsigned int value); } 406 AUE_SEMUNLINK NOSTD|NOPROTO { int ksem_unlink(const char *name); } -407 AUE_SEMGETVALUE NOSTD|NOPROTO { int ksem_getvalue(semid_t id, \ +407 AUE_SEMGETVALUE NOSTD|NOPROTO { int ksem_getvalue(int32_t id, \ int *val); } -408 AUE_SEMDESTROY NOSTD|NOPROTO { int ksem_destroy(semid_t id); } +408 AUE_SEMDESTROY NOSTD|NOPROTO { int ksem_destroy(int32_t id); } 409 AUE_NULL UNIMPL __mac_get_pid 410 AUE_NULL UNIMPL __mac_get_link 411 AUE_NULL UNIMPL __mac_set_link @@ -826,7 +826,7 @@ const char *path, int attrnamespace, \ void *data, size_t nbytes); } 440 AUE_NULL OBSOL kse_switchin -441 AUE_SEMWAIT NOSTD { int freebsd32_ksem_timedwait(semid_t id, \ +441 AUE_SEMWAIT NOSTD { int freebsd32_ksem_timedwait(int32_t id, \ const struct timespec32 *abstime); } 442 AUE_NULL STD { int freebsd32_thr_suspend( \ const struct timespec32 *timeout); } diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index e7c7a04f5c54..22930834f330 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -970,7 +970,7 @@ int freebsd32_ksem_init(struct thread *td, struct freebsd32_ksem_init_args *uap) { - return (ksem_create(td, NULL, uap->idp, S_IRWXU | S_IRWXG, uap->value, + return (ksem_create(td, NULL, (semid_t *)uap->idp, S_IRWXU | S_IRWXG, uap->value, 0, 1)); } @@ -980,7 +980,7 @@ freebsd32_ksem_open(struct thread *td, struct freebsd32_ksem_open_args *uap) if ((uap->oflag & ~(O_CREAT | O_EXCL)) != 0) return (EINVAL); - return (ksem_create(td, uap->name, uap->idp, uap->mode, uap->value, + return (ksem_create(td, uap->name, (semid_t *)uap->idp, uap->mode, uap->value, uap->oflag, 1)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111172022.1AHKMqra060290>