git: b7c55487ff2f - main - Regen

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 09 Dec 2021 01:27:59 UTC
The branch main has been updated by kib:

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

commit b7c55487ff2f0c33397c3ac9d95fe99d4b0367ac
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-12-08 21:25:11 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-12-09 00:49:10 +0000

    Regen
---
 sys/amd64/linux/linux_proto.h                  |  7 ++++
 sys/amd64/linux32/linux32_proto.h              |  7 ++++
 sys/arm64/linux/linux_proto.h                  |  7 ++++
 sys/compat/freebsd32/freebsd32_proto.h         |  6 ++++
 sys/compat/freebsd32/freebsd32_syscall.h       |  5 +--
 sys/compat/freebsd32/freebsd32_syscalls.c      |  3 +-
 sys/compat/freebsd32/freebsd32_sysent.c        |  9 ++++-
 sys/compat/freebsd32/freebsd32_systrace_args.c | 48 ++++++++++++++------------
 sys/i386/linux/linux_proto.h                   |  7 ++++
 sys/kern/init_sysent.c                         |  9 ++++-
 sys/kern/syscalls.c                            |  3 +-
 sys/kern/systrace_args.c                       | 48 ++++++++++++++------------
 sys/sys/syscall.h                              |  5 +--
 sys/sys/syscall.mk                             |  5 +--
 sys/sys/sysproto.h                             | 22 +++++++++---
 15 files changed, 132 insertions(+), 59 deletions(-)

diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h
index e609d3deeb31..2af541f71772 100644
--- a/sys/amd64/linux/linux_proto.h
+++ b/sys/amd64/linux/linux_proto.h
@@ -1733,6 +1733,13 @@ int	linux_mount_setattr(struct thread *, struct linux_mount_setattr_args *);
 
 #endif /* COMPAT_FREEBSD12 */
 
+
+#ifdef COMPAT_FREEBSD13
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD13 */
+
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
 #define	LINUX_SYS_AUE_linux_newstat	AUE_STAT
 #define	LINUX_SYS_AUE_linux_newfstat	AUE_FSTAT
diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h
index 819ec994d0c9..99145b357da9 100644
--- a/sys/amd64/linux32/linux32_proto.h
+++ b/sys/amd64/linux32/linux32_proto.h
@@ -2086,6 +2086,13 @@ int	linux_mount_setattr(struct thread *, struct linux_mount_setattr_args *);
 
 #endif /* COMPAT_FREEBSD12 */
 
+
+#ifdef COMPAT_FREEBSD13
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD13 */
+
 #define	LINUX32_SYS_AUE_linux_exit	AUE_EXIT
 #define	LINUX32_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX32_SYS_AUE_linux_open	AUE_OPEN_RWTC
diff --git a/sys/arm64/linux/linux_proto.h b/sys/arm64/linux/linux_proto.h
index 6b12f819c87c..fcec23492466 100644
--- a/sys/arm64/linux/linux_proto.h
+++ b/sys/arm64/linux/linux_proto.h
@@ -1494,6 +1494,13 @@ int	linux_mount_setattr(struct thread *, struct linux_mount_setattr_args *);
 
 #endif /* COMPAT_FREEBSD12 */
 
+
+#ifdef COMPAT_FREEBSD13
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD13 */
+
 #define	LINUX_SYS_AUE_linux_setxattr	AUE_NULL
 #define	LINUX_SYS_AUE_linux_lsetxattr	AUE_NULL
 #define	LINUX_SYS_AUE_linux_fsetxattr	AUE_NULL
diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h
index ce583e9ac78d..2ec3879ce981 100644
--- a/sys/compat/freebsd32/freebsd32_proto.h
+++ b/sys/compat/freebsd32/freebsd32_proto.h
@@ -1125,6 +1125,12 @@ int	freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fsta
 
 #endif /* COMPAT_FREEBSD12 */
 
+
+#ifdef COMPAT_FREEBSD13
+
+
+#endif /* COMPAT_FREEBSD13 */
+
 #define	FREEBSD32_SYS_AUE_freebsd32_wait4	AUE_WAIT4
 #define	FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat	AUE_GETFSSTAT
 #define	FREEBSD32_SYS_AUE_ofreebsd32_lseek	AUE_LSEEK
diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h
index a79331c931f9..4e055a27f3c6 100644
--- a/sys/compat/freebsd32/freebsd32_syscall.h
+++ b/sys/compat/freebsd32/freebsd32_syscall.h
@@ -348,7 +348,7 @@
 #define	FREEBSD32_SYS_freebsd32_getcontext	421
 #define	FREEBSD32_SYS_freebsd32_setcontext	422
 #define	FREEBSD32_SYS_freebsd32_swapcontext	423
-#define	FREEBSD32_SYS_swapoff	424
+#define	FREEBSD32_SYS_freebsd13_swapoff	424
 #define	FREEBSD32_SYS___acl_get_link	425
 #define	FREEBSD32_SYS___acl_set_link	426
 #define	FREEBSD32_SYS___acl_delete_link	427
@@ -500,4 +500,5 @@
 #define	FREEBSD32_SYS_freebsd32_aio_readv	579
 #define	FREEBSD32_SYS_fspacectl	580
 #define	FREEBSD32_SYS_sched_getcpu	581
-#define	FREEBSD32_SYS_MAXSYSCALL	582
+#define	FREEBSD32_SYS_swapoff	582
+#define	FREEBSD32_SYS_MAXSYSCALL	583
diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c
index 1f949cd90b19..d52c197b8f26 100644
--- a/sys/compat/freebsd32/freebsd32_syscalls.c
+++ b/sys/compat/freebsd32/freebsd32_syscalls.c
@@ -430,7 +430,7 @@ const char *freebsd32_syscallnames[] = {
 	"freebsd32_getcontext",			/* 421 = freebsd32_getcontext */
 	"freebsd32_setcontext",			/* 422 = freebsd32_setcontext */
 	"freebsd32_swapcontext",			/* 423 = freebsd32_swapcontext */
-	"swapoff",			/* 424 = swapoff */
+	"compat13.swapoff",		/* 424 = freebsd13 swapoff */
 	"__acl_get_link",			/* 425 = __acl_get_link */
 	"__acl_set_link",			/* 426 = __acl_set_link */
 	"__acl_delete_link",			/* 427 = __acl_delete_link */
@@ -588,4 +588,5 @@ const char *freebsd32_syscallnames[] = {
 	"freebsd32_aio_readv",			/* 579 = freebsd32_aio_readv */
 	"fspacectl",			/* 580 = fspacectl */
 	"sched_getcpu",			/* 581 = sched_getcpu */
+	"swapoff",			/* 582 = swapoff */
 };
diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c
index 29dd2892da05..c5a2e9b4daea 100644
--- a/sys/compat/freebsd32/freebsd32_sysent.c
+++ b/sys/compat/freebsd32/freebsd32_sysent.c
@@ -54,6 +54,12 @@
 #define compat12(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys
 #endif
 
+#ifdef COMPAT_FREEBSD13
+#define compat13(n, name) .sy_narg = n, .sy_call = (sy_call_t *)__CONCAT(freebsd13_, name)
+#else
+#define compat13(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys
+#endif
+
 /* The casts are bogus but will do for now. */
 struct sysent freebsd32_sysent[] = {
 	{ .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },		/* 0 = syscall */
@@ -480,7 +486,7 @@ struct sysent freebsd32_sysent[] = {
 	{ .sy_narg = AS(freebsd32_getcontext_args), .sy_call = (sy_call_t *)freebsd32_getcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 421 = freebsd32_getcontext */
 	{ .sy_narg = AS(freebsd32_setcontext_args), .sy_call = (sy_call_t *)freebsd32_setcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 422 = freebsd32_setcontext */
 	{ .sy_narg = AS(freebsd32_swapcontext_args), .sy_call = (sy_call_t *)freebsd32_swapcontext, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 423 = freebsd32_swapcontext */
-	{ .sy_narg = AS(swapoff_args), .sy_call = (sy_call_t *)sys_swapoff, .sy_auevent = AUE_SWAPOFF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 424 = swapoff */
+	{ compat13(AS(freebsd13_swapoff_args),swapoff), .sy_auevent = AUE_SWAPOFF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 424 = freebsd13 swapoff */
 	{ .sy_narg = AS(__acl_get_link_args), .sy_call = (sy_call_t *)sys___acl_get_link, .sy_auevent = AUE_ACL_GET_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 425 = __acl_get_link */
 	{ .sy_narg = AS(__acl_set_link_args), .sy_call = (sy_call_t *)sys___acl_set_link, .sy_auevent = AUE_ACL_SET_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 426 = __acl_set_link */
 	{ .sy_narg = AS(__acl_delete_link_args), .sy_call = (sy_call_t *)sys___acl_delete_link, .sy_auevent = AUE_ACL_DELETE_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 427 = __acl_delete_link */
@@ -638,4 +644,5 @@ struct sysent freebsd32_sysent[] = {
 	{ .sy_narg = AS(freebsd32_aio_readv_args), .sy_call = (sy_call_t *)freebsd32_aio_readv, .sy_auevent = AUE_AIO_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 579 = freebsd32_aio_readv */
 	{ .sy_narg = AS(fspacectl_args), .sy_call = (sy_call_t *)sys_fspacectl, .sy_auevent = AUE_FSPACECTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 580 = fspacectl */
 	{ .sy_narg = 0, .sy_call = (sy_call_t *)sys_sched_getcpu, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 581 = sched_getcpu */
+	{ .sy_narg = AS(swapoff_args), .sy_call = (sy_call_t *)sys_swapoff, .sy_auevent = AUE_SWAPOFF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 582 = swapoff */
 };
diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c
index 4d075ca7470e..92ea09104a26 100644
--- a/sys/compat/freebsd32/freebsd32_systrace_args.c
+++ b/sys/compat/freebsd32/freebsd32_systrace_args.c
@@ -1987,13 +1987,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 		*n_args = 2;
 		break;
 	}
-	/* swapoff */
-	case 424: {
-		struct swapoff_args *p = params;
-		uarg[a++] = (intptr_t)p->name; /* const char * */
-		*n_args = 1;
-		break;
-	}
 	/* __acl_get_link */
 	case 425: {
 		struct __acl_get_link_args *p = params;
@@ -3320,6 +3313,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 		*n_args = 0;
 		break;
 	}
+	/* swapoff */
+	case 582: {
+		struct swapoff_args *p = params;
+		uarg[a++] = (intptr_t)p->name; /* const char * */
+		uarg[a++] = p->flags; /* u_int */
+		*n_args = 2;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -6513,16 +6514,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 			break;
 		};
 		break;
-	/* swapoff */
-	case 424:
-		switch (ndx) {
-		case 0:
-			p = "userland const char *";
-			break;
-		default:
-			break;
-		};
-		break;
 	/* __acl_get_link */
 	case 425:
 		switch (ndx) {
@@ -8960,6 +8951,19 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	/* sched_getcpu */
 	case 581:
 		break;
+	/* swapoff */
+	case 582:
+		switch (ndx) {
+		case 0:
+			p = "userland const char *";
+			break;
+		case 1:
+			p = "u_int";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};
@@ -10114,11 +10118,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 		if (ndx == 0 || ndx == 1)
 			p = "int";
 		break;
-	/* swapoff */
-	case 424:
-		if (ndx == 0 || ndx == 1)
-			p = "int";
-		break;
 	/* __acl_get_link */
 	case 425:
 		if (ndx == 0 || ndx == 1)
@@ -10818,6 +10817,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 		break;
 	/* sched_getcpu */
 	case 581:
+	/* swapoff */
+	case 582:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
 	default:
 		break;
 	};
diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h
index d6e87072a89a..15dcc75593c2 100644
--- a/sys/i386/linux/linux_proto.h
+++ b/sys/i386/linux/linux_proto.h
@@ -2081,6 +2081,13 @@ int	linux_mount_setattr(struct thread *, struct linux_mount_setattr_args *);
 
 #endif /* COMPAT_FREEBSD12 */
 
+
+#ifdef COMPAT_FREEBSD13
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD13 */
+
 #define	LINUX_SYS_AUE_linux_exit	AUE_EXIT
 #define	LINUX_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index 05c15d7b7afc..4a548c45e8a2 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -53,6 +53,12 @@
 #define compat12(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys
 #endif
 
+#ifdef COMPAT_FREEBSD13
+#define compat13(n, name) .sy_narg = n, .sy_call = (sy_call_t *)__CONCAT(freebsd13_, name)
+#else
+#define compat13(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys
+#endif
+
 /* The casts are bogus but will do for now. */
 struct sysent sysent[] = {
 	{ .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },		/* 0 = syscall */
@@ -479,7 +485,7 @@ struct sysent sysent[] = {
 	{ .sy_narg = AS(getcontext_args), .sy_call = (sy_call_t *)sys_getcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 421 = getcontext */
 	{ .sy_narg = AS(setcontext_args), .sy_call = (sy_call_t *)sys_setcontext, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 422 = setcontext */
 	{ .sy_narg = AS(swapcontext_args), .sy_call = (sy_call_t *)sys_swapcontext, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 423 = swapcontext */
-	{ .sy_narg = AS(swapoff_args), .sy_call = (sy_call_t *)sys_swapoff, .sy_auevent = AUE_SWAPOFF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 424 = swapoff */
+	{ compat13(AS(freebsd13_swapoff_args),swapoff), .sy_auevent = AUE_SWAPOFF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 424 = freebsd13 swapoff */
 	{ .sy_narg = AS(__acl_get_link_args), .sy_call = (sy_call_t *)sys___acl_get_link, .sy_auevent = AUE_ACL_GET_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 425 = __acl_get_link */
 	{ .sy_narg = AS(__acl_set_link_args), .sy_call = (sy_call_t *)sys___acl_set_link, .sy_auevent = AUE_ACL_SET_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 426 = __acl_set_link */
 	{ .sy_narg = AS(__acl_delete_link_args), .sy_call = (sy_call_t *)sys___acl_delete_link, .sy_auevent = AUE_ACL_DELETE_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 427 = __acl_delete_link */
@@ -637,4 +643,5 @@ struct sysent sysent[] = {
 	{ .sy_narg = AS(aio_readv_args), .sy_call = (sy_call_t *)sys_aio_readv, .sy_auevent = AUE_AIO_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 579 = aio_readv */
 	{ .sy_narg = AS(fspacectl_args), .sy_call = (sy_call_t *)sys_fspacectl, .sy_auevent = AUE_FSPACECTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 580 = fspacectl */
 	{ .sy_narg = 0, .sy_call = (sy_call_t *)sys_sched_getcpu, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC },	/* 581 = sched_getcpu */
+	{ .sy_narg = AS(swapoff_args), .sy_call = (sy_call_t *)sys_swapoff, .sy_auevent = AUE_SWAPOFF, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 582 = swapoff */
 };
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index efbac3185746..aa4792ccff8a 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -430,7 +430,7 @@ const char *syscallnames[] = {
 	"getcontext",			/* 421 = getcontext */
 	"setcontext",			/* 422 = setcontext */
 	"swapcontext",			/* 423 = swapcontext */
-	"swapoff",			/* 424 = swapoff */
+	"compat13.swapoff",		/* 424 = freebsd13 swapoff */
 	"__acl_get_link",			/* 425 = __acl_get_link */
 	"__acl_set_link",			/* 426 = __acl_set_link */
 	"__acl_delete_link",			/* 427 = __acl_delete_link */
@@ -588,4 +588,5 @@ const char *syscallnames[] = {
 	"aio_readv",			/* 579 = aio_readv */
 	"fspacectl",			/* 580 = fspacectl */
 	"sched_getcpu",			/* 581 = sched_getcpu */
+	"swapoff",			/* 582 = swapoff */
 };
diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c
index cb7b2ee503b9..8464a214548c 100644
--- a/sys/kern/systrace_args.c
+++ b/sys/kern/systrace_args.c
@@ -2129,13 +2129,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 		*n_args = 2;
 		break;
 	}
-	/* swapoff */
-	case 424: {
-		struct swapoff_args *p = params;
-		uarg[a++] = (intptr_t)p->name; /* const char * */
-		*n_args = 1;
-		break;
-	}
 	/* __acl_get_link */
 	case 425: {
 		struct __acl_get_link_args *p = params;
@@ -3416,6 +3409,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 		*n_args = 0;
 		break;
 	}
+	/* swapoff */
+	case 582: {
+		struct swapoff_args *p = params;
+		uarg[a++] = (intptr_t)p->name; /* const char * */
+		uarg[a++] = p->flags; /* u_int */
+		*n_args = 2;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -6844,16 +6845,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 			break;
 		};
 		break;
-	/* swapoff */
-	case 424:
-		switch (ndx) {
-		case 0:
-			p = "userland const char *";
-			break;
-		default:
-			break;
-		};
-		break;
 	/* __acl_get_link */
 	case 425:
 		switch (ndx) {
@@ -9130,6 +9121,19 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 	/* sched_getcpu */
 	case 581:
 		break;
+	/* swapoff */
+	case 582:
+		switch (ndx) {
+		case 0:
+			p = "userland const char *";
+			break;
+		case 1:
+			p = "u_int";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};
@@ -10374,11 +10378,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 		if (ndx == 0 || ndx == 1)
 			p = "int";
 		break;
-	/* swapoff */
-	case 424:
-		if (ndx == 0 || ndx == 1)
-			p = "int";
-		break;
 	/* __acl_get_link */
 	case 425:
 		if (ndx == 0 || ndx == 1)
@@ -11083,6 +11082,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 		break;
 	/* sched_getcpu */
 	case 581:
+	/* swapoff */
+	case 582:
+		if (ndx == 0 || ndx == 1)
+			p = "int";
+		break;
 	default:
 		break;
 	};
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index 051a0f64390e..081437449b70 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -366,7 +366,7 @@
 #define	SYS_getcontext	421
 #define	SYS_setcontext	422
 #define	SYS_swapcontext	423
-#define	SYS_swapoff	424
+#define	SYS_freebsd13_swapoff	424
 #define	SYS___acl_get_link	425
 #define	SYS___acl_set_link	426
 #define	SYS___acl_delete_link	427
@@ -519,4 +519,5 @@
 #define	SYS_aio_readv	579
 #define	SYS_fspacectl	580
 #define	SYS_sched_getcpu	581
-#define	SYS_MAXSYSCALL	582
+#define	SYS_swapoff	582
+#define	SYS_MAXSYSCALL	583
diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk
index 5760a2574a84..56518e94d30d 100644
--- a/sys/sys/syscall.mk
+++ b/sys/sys/syscall.mk
@@ -276,7 +276,7 @@ MIASM =  \
 	getcontext.o \
 	setcontext.o \
 	swapcontext.o \
-	swapoff.o \
+	freebsd13_swapoff.o \
 	__acl_get_link.o \
 	__acl_set_link.o \
 	__acl_delete_link.o \
@@ -424,4 +424,5 @@ MIASM =  \
 	aio_writev.o \
 	aio_readv.o \
 	fspacectl.o \
-	sched_getcpu.o
+	sched_getcpu.o \
+	swapoff.o
diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h
index 5d8d3321680c..6c96d64dedb0 100644
--- a/sys/sys/sysproto.h
+++ b/sys/sys/sysproto.h
@@ -1135,9 +1135,6 @@ struct swapcontext_args {
 	char oucp_l_[PADL_(struct __ucontext *)]; struct __ucontext * oucp; char oucp_r_[PADR_(struct __ucontext *)];
 	char ucp_l_[PADL_(const struct __ucontext *)]; const struct __ucontext * ucp; char ucp_r_[PADR_(const struct __ucontext *)];
 };
-struct swapoff_args {
-	char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)];
-};
 struct __acl_get_link_args {
 	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
 	char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)];
@@ -1854,6 +1851,10 @@ struct fspacectl_args {
 struct sched_getcpu_args {
 	register_t dummy;
 };
+struct swapoff_args {
+	char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)];
+	char flags_l_[PADL_(u_int)]; u_int flags; char flags_r_[PADR_(u_int)];
+};
 int	sys_exit(struct thread *, struct exit_args *);
 int	sys_fork(struct thread *, struct fork_args *);
 int	sys_read(struct thread *, struct read_args *);
@@ -2106,7 +2107,6 @@ int	sys_sigreturn(struct thread *, struct sigreturn_args *);
 int	sys_getcontext(struct thread *, struct getcontext_args *);
 int	sys_setcontext(struct thread *, struct setcontext_args *);
 int	sys_swapcontext(struct thread *, struct swapcontext_args *);
-int	sys_swapoff(struct thread *, struct swapoff_args *);
 int	sys___acl_get_link(struct thread *, struct __acl_get_link_args *);
 int	sys___acl_set_link(struct thread *, struct __acl_set_link_args *);
 int	sys___acl_delete_link(struct thread *, struct __acl_delete_link_args *);
@@ -2249,6 +2249,7 @@ int	sys_aio_writev(struct thread *, struct aio_writev_args *);
 int	sys_aio_readv(struct thread *, struct aio_readv_args *);
 int	sys_fspacectl(struct thread *, struct fspacectl_args *);
 int	sys_sched_getcpu(struct thread *, struct sched_getcpu_args *);
+int	sys_swapoff(struct thread *, struct swapoff_args *);
 
 #ifdef COMPAT_43
 
@@ -2730,6 +2731,16 @@ int	freebsd12_closefrom(struct thread *, struct freebsd12_closefrom_args *);
 
 #endif /* COMPAT_FREEBSD12 */
 
+
+#ifdef COMPAT_FREEBSD13
+
+struct freebsd13_swapoff_args {
+	char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)];
+};
+int	freebsd13_swapoff(struct thread *, struct freebsd13_swapoff_args *);
+
+#endif /* COMPAT_FREEBSD13 */
+
 #define	SYS_AUE_exit	AUE_EXIT
 #define	SYS_AUE_fork	AUE_FORK
 #define	SYS_AUE_read	AUE_READ
@@ -3058,7 +3069,7 @@ int	freebsd12_closefrom(struct thread *, struct freebsd12_closefrom_args *);
 #define	SYS_AUE_getcontext	AUE_NULL
 #define	SYS_AUE_setcontext	AUE_NULL
 #define	SYS_AUE_swapcontext	AUE_NULL
-#define	SYS_AUE_swapoff	AUE_SWAPOFF
+#define	SYS_AUE_freebsd13_swapoff	AUE_SWAPOFF
 #define	SYS_AUE___acl_get_link	AUE_ACL_GET_LINK
 #define	SYS_AUE___acl_set_link	AUE_ACL_SET_LINK
 #define	SYS_AUE___acl_delete_link	AUE_ACL_DELETE_LINK
@@ -3207,6 +3218,7 @@ int	freebsd12_closefrom(struct thread *, struct freebsd12_closefrom_args *);
 #define	SYS_AUE_aio_readv	AUE_AIO_READV
 #define	SYS_AUE_fspacectl	AUE_FSPACECTL
 #define	SYS_AUE_sched_getcpu	AUE_NULL
+#define	SYS_AUE_swapoff	AUE_SWAPOFF
 
 #undef PAD_
 #undef PADL_