diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -326,6 +326,7 @@ #define FREEBSD32_SYS_lchflags 391 #define FREEBSD32_SYS_uuidgen 392 #define FREEBSD32_SYS_freebsd32_sendfile 393 +#define FREEBSD32_SYS_mac_syscall 394 #define FREEBSD32_SYS_freebsd11_freebsd32_getfsstat 395 #define FREEBSD32_SYS_freebsd11_statfs 396 #define FREEBSD32_SYS_freebsd11_fstatfs 397 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -399,7 +399,7 @@ "lchflags", /* 391 = lchflags */ "uuidgen", /* 392 = uuidgen */ "freebsd32_sendfile", /* 393 = freebsd32_sendfile */ - "#394", /* 394 = mac_syscall */ + "mac_syscall", /* 394 = mac_syscall */ "compat11.freebsd32_getfsstat", /* 395 = freebsd11 freebsd32_getfsstat */ "compat11.statfs", /* 396 = freebsd11 statfs */ "compat11.fstatfs", /* 397 = freebsd11 fstatfs */ diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -455,7 +455,7 @@ { .sy_narg = AS(lchflags_args), .sy_call = (sy_call_t *)sys_lchflags, .sy_auevent = AUE_LCHFLAGS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 391 = lchflags */ { .sy_narg = AS(uuidgen_args), .sy_call = (sy_call_t *)sys_uuidgen, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 392 = uuidgen */ { .sy_narg = AS(freebsd32_sendfile_args), .sy_call = (sy_call_t *)freebsd32_sendfile, .sy_auevent = AUE_SENDFILE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 393 = freebsd32_sendfile */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 394 = mac_syscall */ + { .sy_narg = AS(mac_syscall_args), .sy_call = (sy_call_t *)sys_mac_syscall, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 394 = mac_syscall */ { compat11(AS(freebsd11_freebsd32_getfsstat_args),freebsd32_getfsstat), .sy_auevent = AUE_GETFSSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 395 = freebsd11 freebsd32_getfsstat */ { compat11(AS(freebsd11_statfs_args),statfs), .sy_auevent = AUE_STATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 396 = freebsd11 statfs */ { compat11(AS(freebsd11_fstatfs_args),fstatfs), .sy_auevent = AUE_FSTATFS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 397 = freebsd11 fstatfs */ diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -1848,6 +1848,15 @@ *n_args = 8; break; } + /* mac_syscall */ + case 394: { + struct mac_syscall_args *p = params; + uarg[a++] = (intptr_t)p->policy; /* const char * */ + iarg[a++] = p->call; /* int */ + uarg[a++] = (intptr_t)p->arg; /* void * */ + *n_args = 3; + break; + } /* ksem_close */ case 400: { struct ksem_close_args *p = params; @@ -6293,6 +6302,22 @@ break; }; break; + /* mac_syscall */ + case 394: + switch (ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "int"; + break; + case 2: + p = "userland void *"; + break; + default: + break; + }; + break; /* ksem_close */ case 400: switch (ndx) { @@ -10049,6 +10074,11 @@ if (ndx == 0 || ndx == 1) p = "int"; break; + /* mac_syscall */ + case 394: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* ksem_close */ case 400: if (ndx == 0 || ndx == 1) diff --git a/sys/compat/freebsd32/syscalls.conf b/sys/compat/freebsd32/syscalls.conf --- a/sys/compat/freebsd32/syscalls.conf +++ b/sys/compat/freebsd32/syscalls.conf @@ -47,7 +47,7 @@ obsol="getkerninfo" # Syscalls without implementations: -# *mac_* - should be implemented +# __mac_* - should be implemented # afs3_syscall - requires significant porting, probably doesn't make sense # kldsym - can't be implemented (kernel virtual addresses can't fit in 32-bits) # lgetfh - should be implemented @@ -55,4 +55,4 @@ # nnpfs_syscall - requires significant porting, probably doesn't make sense # ntp_gettime - should be implemented # thr_create - was unimplemented and appears to be unnecessicary -unimpl="afs3_syscall kldsym __mac_get_proc __mac_set_proc __mac_get_fd __mac_get_file __mac_set_fd __mac_set_file __mac_get_pid __mac_get_link __mac_set_link __mac_execve mac_syscall nfssvc nlm_syscall ntp_gettime lgetfh nnpfs_syscall thr_create" +unimpl="afs3_syscall kldsym __mac_get_proc __mac_set_proc __mac_get_fd __mac_get_file __mac_set_fd __mac_set_file __mac_get_pid __mac_get_link __mac_set_link __mac_execve nfssvc nlm_syscall ntp_gettime lgetfh nnpfs_syscall thr_create"