This commit is contained in:
Konstantin Belousov 2021-12-08 23:25:11 +02:00
parent b49b6e0f95
commit b7c55487ff
15 changed files with 132 additions and 59 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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;
};

View File

@ -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

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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;
};

View File

@ -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

View File

@ -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

View File

@ -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_