diff --git a/include/unistd.h b/include/unistd.h --- a/include/unistd.h +++ b/include/unistd.h @@ -463,12 +463,10 @@ #endif /* __XSI_VISIBLE */ #if (__XSI_VISIBLE && __XSI_VISIBLE <= 500) || __BSD_VISIBLE -int brk(const void *); int chroot(const char *); int getdtablesize(void); int getpagesize(void) __pure2; char *getpass(const char *); -void *sbrk(intptr_t); #endif #if (__XSI_VISIBLE && __XSI_VISIBLE <= 600) || __BSD_VISIBLE diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc --- a/lib/libc/aarch64/sys/Makefile.inc +++ b/lib/libc/aarch64/sys/Makefile.inc @@ -8,5 +8,5 @@ vfork.S # Don't generate default code for these syscalls: -NOASM+= sbrk.o \ +NOASM+= freebsd14_sbrk.o \ vfork.o diff --git a/lib/libc/amd64/sys/Makefile.inc b/lib/libc/amd64/sys/Makefile.inc --- a/lib/libc/amd64/sys/Makefile.inc +++ b/lib/libc/amd64/sys/Makefile.inc @@ -7,4 +7,4 @@ MDASM= vfork.S cerror.S getcontext.S # Don't generate default code for these syscalls: -NOASM+= sbrk.o vfork.o +NOASM+= freebsd14_sbrk.o vfork.o diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc --- a/lib/libc/arm/sys/Makefile.inc +++ b/lib/libc/arm/sys/Makefile.inc @@ -4,4 +4,4 @@ MDASM= Ovfork.S cerror.S syscall.S # Don't generate default code for these syscalls: -NOASM+= sbrk.o vfork.o +NOASM+= freebsd14_sbrk.o vfork.o diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc --- a/lib/libc/i386/sys/Makefile.inc +++ b/lib/libc/i386/sys/Makefile.inc @@ -4,7 +4,7 @@ MDASM= Ovfork.S cerror.S getcontext.S syscall.S -NOASM+= sbrk.o vfork.o +NOASM+= freebsd14_sbrk.o vfork.o MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2 MAN+= i386_set_watch.3 diff --git a/lib/libc/include/compat.h b/lib/libc/include/compat.h --- a/lib/libc/include/compat.h +++ b/lib/libc/include/compat.h @@ -69,6 +69,10 @@ __sym_compat(swapoff, freebsd13_swapoff, FBSD_1.0); +#if defined(__amd64__) || defined(__arm__) || defined(__i386__) || defined(__powerpc__) +__sym_compat(break, freebsd14_break, FBSD_1.0); +#endif + #undef __sym_compat #define __weak_reference(sym,alias) \ diff --git a/lib/libc/riscv/sys/Makefile.inc b/lib/libc/riscv/sys/Makefile.inc --- a/lib/libc/riscv/sys/Makefile.inc +++ b/lib/libc/riscv/sys/Makefile.inc @@ -6,4 +6,4 @@ vfork.S # Don't generate default code for these syscalls: -NOASM+= sbrk.o vfork.o +NOASM+= freebsd14_sbrk.o vfork.o diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -17,7 +17,7 @@ # NOASM= exit.o \ getlogin.o \ - sstk.o \ + freebsd14_sstk.o \ yield.o PSEUDO= _exit.o \ _getlogin.o diff --git a/lib/libc/sys/brk.c b/lib/libc/sys/brk.c --- a/lib/libc/sys/brk.c +++ b/lib/libc/sys/brk.c @@ -31,7 +31,7 @@ #include #include -void *__sys_break(char *nsize); +void *freebsd14_break(char *nsize); static uintptr_t curbrk, minbrk; static int curbrk_initted; @@ -42,7 +42,7 @@ void *newbrk; if (!curbrk_initted) { - newbrk = __sys_break(NULL); + newbrk = freebsd14_break(NULL); if (newbrk == (void *)-1) return (-1); curbrk = minbrk = (uintptr_t)newbrk; @@ -61,7 +61,7 @@ errno = EINVAL; return ((void *)-1); } - if (__sys_break(addr) == (void *)-1) + if (freebsd14_break(addr) == (void *)-1) return ((void *)-1); oldbrk = curbrk; curbrk = (uintptr_t)addr; diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -1142,6 +1142,12 @@ #endif /* COMPAT_FREEBSD13 */ + +#ifdef COMPAT_FREEBSD14 + + +#endif /* COMPAT_FREEBSD14 */ + #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 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -21,7 +21,7 @@ #define FREEBSD32_SYS_freebsd11_mknod 14 #define FREEBSD32_SYS_chmod 15 #define FREEBSD32_SYS_chown 16 -#define FREEBSD32_SYS_break 17 +#define FREEBSD32_SYS_freebsd14_break 17 /* 18 is freebsd4 freebsd32_getfsstat */ /* 19 is old freebsd32_lseek */ #define FREEBSD32_SYS_getpid 20 @@ -73,8 +73,8 @@ #define FREEBSD32_SYS_vfork 66 /* 67 is obsolete vread */ /* 68 is obsolete vwrite */ -#define FREEBSD32_SYS_sbrk 69 -#define FREEBSD32_SYS_sstk 70 +#define FREEBSD32_SYS_freebsd14_sbrk 69 +#define FREEBSD32_SYS_freebsd14_sstk 70 /* 71 is old freebsd32_mmap */ #define FREEBSD32_SYS_freebsd11_vadvise 72 #define FREEBSD32_SYS_munmap 73 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 @@ -22,7 +22,7 @@ "compat11.mknod", /* 14 = freebsd11 mknod */ "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ - "break", /* 17 = break */ + "compat14.break", /* 17 = freebsd14 break */ "compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */ "compat.freebsd32_lseek", /* 19 = old freebsd32_lseek */ "getpid", /* 20 = getpid */ @@ -74,8 +74,8 @@ "vfork", /* 66 = vfork */ "obs_vread", /* 67 = obsolete vread */ "obs_vwrite", /* 68 = obsolete vwrite */ - "sbrk", /* 69 = sbrk */ - "sstk", /* 70 = sstk */ + "compat14.sbrk", /* 69 = freebsd14 sbrk */ + "compat14.sstk", /* 70 = freebsd14 sstk */ "compat.freebsd32_mmap", /* 71 = old freebsd32_mmap */ "compat11.vadvise", /* 72 = freebsd11 vadvise */ "munmap", /* 73 = munmap */ 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 @@ -59,6 +59,12 @@ #define compat13(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD14 +#define compat14(n, name) .sy_narg = n, .sy_call = (sy_call_t *)__CONCAT(freebsd14_, name) +#else +#define compat14(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 */ @@ -78,7 +84,7 @@ { compat11(AS(freebsd11_mknod_args),mknod), .sy_auevent = AUE_MKNOD, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 14 = freebsd11 mknod */ { .sy_narg = AS(chmod_args), .sy_call = (sy_call_t *)sys_chmod, .sy_auevent = AUE_CHMOD, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 15 = chmod */ { .sy_narg = AS(chown_args), .sy_call = (sy_call_t *)sys_chown, .sy_auevent = AUE_CHOWN, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 16 = chown */ - { .sy_narg = AS(break_args), .sy_call = (sy_call_t *)sys_break, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 17 = break */ + { compat14(AS(freebsd14_break_args),break), .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 17 = freebsd14 break */ { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), .sy_auevent = AUE_GETFSSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */ { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), .sy_auevent = AUE_LSEEK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 19 = old freebsd32_lseek */ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_getpid, .sy_auevent = AUE_GETPID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 20 = getpid */ @@ -130,8 +136,8 @@ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 67 = obsolete vread */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 68 = obsolete vwrite */ - { .sy_narg = AS(sbrk_args), .sy_call = (sy_call_t *)sys_sbrk, .sy_auevent = AUE_SBRK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 69 = sbrk */ - { .sy_narg = AS(sstk_args), .sy_call = (sy_call_t *)sys_sstk, .sy_auevent = AUE_SSTK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 70 = sstk */ + { compat14(AS(freebsd14_sbrk_args),sbrk), .sy_auevent = AUE_SBRK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 69 = freebsd14 sbrk */ + { compat14(AS(freebsd14_sstk_args),sstk), .sy_auevent = AUE_SSTK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 70 = freebsd14 sstk */ { compat(AS(ofreebsd32_mmap_args),freebsd32_mmap), .sy_auevent = AUE_MMAP, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 71 = old freebsd32_mmap */ { compat11(AS(freebsd11_vadvise_args),vadvise), .sy_auevent = AUE_O_VADVISE, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 72 = freebsd11 vadvise */ { .sy_narg = AS(munmap_args), .sy_call = (sy_call_t *)sys_munmap, .sy_auevent = AUE_MUNMAP, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 73 = munmap */ 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 @@ -121,13 +121,6 @@ *n_args = 3; break; } - /* break */ - case 17: { - struct break_args *p = params; - uarg[a++] = (intptr_t)p->nsize; /* char * */ - *n_args = 1; - break; - } /* getpid */ case 20: { *n_args = 0; @@ -421,20 +414,6 @@ *n_args = 0; break; } - /* sbrk */ - case 69: { - struct sbrk_args *p = params; - iarg[a++] = p->incr; /* int */ - *n_args = 1; - break; - } - /* sstk */ - case 70: { - struct sstk_args *p = params; - iarg[a++] = p->incr; /* int */ - *n_args = 1; - break; - } /* munmap */ case 73: { struct munmap_args *p = params; @@ -3546,16 +3525,6 @@ break; }; break; - /* break */ - case 17: - switch (ndx) { - case 0: - p = "userland char *"; - break; - default: - break; - }; - break; /* getpid */ case 20: break; @@ -4009,26 +3978,6 @@ /* vfork */ case 66: break; - /* sbrk */ - case 69: - switch (ndx) { - case 0: - p = "int"; - break; - default: - break; - }; - break; - /* sstk */ - case 70: - switch (ndx) { - case 0: - p = "int"; - break; - default: - break; - }; - break; /* munmap */ case 73: switch (ndx) { @@ -9176,11 +9125,6 @@ if (ndx == 0 || ndx == 1) p = "int"; break; - /* break */ - case 17: - if (ndx == 0 || ndx == 1) - p = "void *"; - break; /* getpid */ case 20: /* mount */ @@ -9347,16 +9291,6 @@ break; /* vfork */ case 66: - /* sbrk */ - case 69: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* sstk */ - case 70: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* munmap */ case 73: if (ndx == 0 || ndx == 1) diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -58,6 +58,12 @@ #define compat13(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD14 +#define compat14(n, name) .sy_narg = n, .sy_call = (sy_call_t *)__CONCAT(freebsd14_, name) +#else +#define compat14(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 */ @@ -77,7 +83,7 @@ { compat11(AS(freebsd11_mknod_args),mknod), .sy_auevent = AUE_MKNOD, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 14 = freebsd11 mknod */ { .sy_narg = AS(chmod_args), .sy_call = (sy_call_t *)sys_chmod, .sy_auevent = AUE_CHMOD, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 15 = chmod */ { .sy_narg = AS(chown_args), .sy_call = (sy_call_t *)sys_chown, .sy_auevent = AUE_CHOWN, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 16 = chown */ - { .sy_narg = AS(break_args), .sy_call = (sy_call_t *)sys_break, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 17 = break */ + { compat14(AS(freebsd14_break_args),break), .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 17 = freebsd14 break */ { compat4(AS(freebsd4_getfsstat_args),getfsstat), .sy_auevent = AUE_GETFSSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 18 = freebsd4 getfsstat */ { compat(AS(olseek_args),lseek), .sy_auevent = AUE_LSEEK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 19 = old lseek */ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_getpid, .sy_auevent = AUE_GETPID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 20 = getpid */ @@ -129,8 +135,8 @@ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 67 = obsolete vread */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 68 = obsolete vwrite */ - { .sy_narg = AS(sbrk_args), .sy_call = (sy_call_t *)sys_sbrk, .sy_auevent = AUE_SBRK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 69 = sbrk */ - { .sy_narg = AS(sstk_args), .sy_call = (sy_call_t *)sys_sstk, .sy_auevent = AUE_SSTK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 70 = sstk */ + { compat14(AS(freebsd14_sbrk_args),sbrk), .sy_auevent = AUE_SBRK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 69 = freebsd14 sbrk */ + { compat14(AS(freebsd14_sstk_args),sstk), .sy_auevent = AUE_SSTK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 70 = freebsd14 sstk */ { compat(AS(ommap_args),mmap), .sy_auevent = AUE_MMAP, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 71 = old mmap */ { compat11(AS(freebsd11_vadvise_args),vadvise), .sy_auevent = AUE_O_VADVISE, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 72 = freebsd11 vadvise */ { .sy_narg = AS(munmap_args), .sy_call = (sy_call_t *)sys_munmap, .sy_auevent = AUE_MUNMAP, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 73 = munmap */ diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -22,7 +22,7 @@ "compat11.mknod", /* 14 = freebsd11 mknod */ "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ - "break", /* 17 = break */ + "compat14.break", /* 17 = freebsd14 break */ "compat4.getfsstat", /* 18 = freebsd4 getfsstat */ "compat.lseek", /* 19 = old lseek */ "getpid", /* 20 = getpid */ @@ -74,8 +74,8 @@ "vfork", /* 66 = vfork */ "obs_vread", /* 67 = obsolete vread */ "obs_vwrite", /* 68 = obsolete vwrite */ - "sbrk", /* 69 = sbrk */ - "sstk", /* 70 = sstk */ + "compat14.sbrk", /* 69 = freebsd14 sbrk */ + "compat14.sstk", /* 70 = freebsd14 sstk */ "compat.mmap", /* 71 = old mmap */ "compat11.vadvise", /* 72 = freebsd11 vadvise */ "munmap", /* 73 = munmap */ diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -213,7 +213,7 @@ int gid ); } -17 AUE_NULL STD|CAPENABLED { +17 AUE_NULL COMPAT14|CAPENABLED { void *break( _In_ char *nsize ); @@ -502,12 +502,12 @@ } 67 AUE_NULL OBSOL vread 68 AUE_NULL OBSOL vwrite -69 AUE_SBRK STD|CAPENABLED { +69 AUE_SBRK COMPAT14|CAPENABLED { int sbrk( int incr ); } -70 AUE_SSTK STD|CAPENABLED { +70 AUE_SSTK COMPAT14|CAPENABLED { int sstk( int incr ); diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -118,13 +118,6 @@ *n_args = 3; break; } - /* break */ - case 17: { - struct break_args *p = params; - uarg[a++] = (intptr_t)p->nsize; /* char * */ - *n_args = 1; - break; - } /* getpid */ case 20: { *n_args = 0; @@ -418,20 +411,6 @@ *n_args = 0; break; } - /* sbrk */ - case 69: { - struct sbrk_args *p = params; - iarg[a++] = p->incr; /* int */ - *n_args = 1; - break; - } - /* sstk */ - case 70: { - struct sstk_args *p = params; - iarg[a++] = p->incr; /* int */ - *n_args = 1; - break; - } /* munmap */ case 73: { struct munmap_args *p = params; @@ -3633,16 +3612,6 @@ break; }; break; - /* break */ - case 17: - switch (ndx) { - case 0: - p = "userland char *"; - break; - default: - break; - }; - break; /* getpid */ case 20: break; @@ -4096,26 +4065,6 @@ /* vfork */ case 66: break; - /* sbrk */ - case 69: - switch (ndx) { - case 0: - p = "int"; - break; - default: - break; - }; - break; - /* sstk */ - case 70: - switch (ndx) { - case 0: - p = "int"; - break; - default: - break; - }; - break; /* munmap */ case 73: switch (ndx) { @@ -9321,11 +9270,6 @@ if (ndx == 0 || ndx == 1) p = "int"; break; - /* break */ - case 17: - if (ndx == 0 || ndx == 1) - p = "void *"; - break; /* getpid */ case 20: /* mount */ @@ -9492,16 +9436,6 @@ break; /* vfork */ case 66: - /* sbrk */ - case 69: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* sstk */ - case 70: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* munmap */ case 73: if (ndx == 0 || ndx == 1) diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -21,7 +21,7 @@ #define SYS_freebsd11_mknod 14 #define SYS_chmod 15 #define SYS_chown 16 -#define SYS_break 17 +#define SYS_freebsd14_break 17 /* 18 is freebsd4 getfsstat */ /* 19 is old lseek */ #define SYS_getpid 20 @@ -73,8 +73,8 @@ #define SYS_vfork 66 /* 67 is obsolete vread */ /* 68 is obsolete vwrite */ -#define SYS_sbrk 69 -#define SYS_sstk 70 +#define SYS_freebsd14_sbrk 69 +#define SYS_freebsd14_sstk 70 /* 71 is old mmap */ #define SYS_freebsd11_vadvise 72 #define SYS_munmap 73 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -16,7 +16,7 @@ freebsd11_mknod.o \ chmod.o \ chown.o \ - break.o \ + freebsd14_break.o \ getpid.o \ mount.o \ unmount.o \ @@ -56,8 +56,8 @@ chroot.o \ msync.o \ vfork.o \ - sbrk.o \ - sstk.o \ + freebsd14_sbrk.o \ + freebsd14_sstk.o \ freebsd11_vadvise.o \ munmap.o \ mprotect.o \ diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -85,9 +85,6 @@ char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; }; -struct break_args { - char nsize_l_[PADL_(char *)]; char * nsize; char nsize_r_[PADR_(char *)]; -}; struct getpid_args { syscallarg_t dummy; }; @@ -254,12 +251,6 @@ struct vfork_args { syscallarg_t dummy; }; -struct sbrk_args { - char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; -}; -struct sstk_args { - char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; -}; struct munmap_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; @@ -1889,7 +1880,6 @@ int sys_fchdir(struct thread *, struct fchdir_args *); int sys_chmod(struct thread *, struct chmod_args *); int sys_chown(struct thread *, struct chown_args *); -int sys_break(struct thread *, struct break_args *); int sys_getpid(struct thread *, struct getpid_args *); int sys_mount(struct thread *, struct mount_args *); int sys_unmount(struct thread *, struct unmount_args *); @@ -1928,8 +1918,6 @@ int sys_chroot(struct thread *, struct chroot_args *); int sys_msync(struct thread *, struct msync_args *); int sys_vfork(struct thread *, struct vfork_args *); -int sys_sbrk(struct thread *, struct sbrk_args *); -int sys_sstk(struct thread *, struct sstk_args *); int sys_munmap(struct thread *, struct munmap_args *); int sys_mprotect(struct thread *, struct mprotect_args *); int sys_madvise(struct thread *, struct madvise_args *); @@ -2767,6 +2755,24 @@ #endif /* COMPAT_FREEBSD13 */ + +#ifdef COMPAT_FREEBSD14 + +struct freebsd14_break_args { + char nsize_l_[PADL_(char *)]; char * nsize; char nsize_r_[PADR_(char *)]; +}; +struct freebsd14_sbrk_args { + char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; +}; +struct freebsd14_sstk_args { + char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; +}; +int freebsd14_break(struct thread *, struct freebsd14_break_args *); +int freebsd14_sbrk(struct thread *, struct freebsd14_sbrk_args *); +int freebsd14_sstk(struct thread *, struct freebsd14_sstk_args *); + +#endif /* COMPAT_FREEBSD14 */ + #define SYS_AUE_exit AUE_EXIT #define SYS_AUE_fork AUE_FORK #define SYS_AUE_read AUE_READ @@ -2782,7 +2788,7 @@ #define SYS_AUE_freebsd11_mknod AUE_MKNOD #define SYS_AUE_chmod AUE_CHMOD #define SYS_AUE_chown AUE_CHOWN -#define SYS_AUE_break AUE_NULL +#define SYS_AUE_freebsd14_break AUE_NULL #define SYS_AUE_freebsd4_getfsstat AUE_GETFSSTAT #define SYS_AUE_olseek AUE_LSEEK #define SYS_AUE_getpid AUE_GETPID @@ -2832,8 +2838,8 @@ #define SYS_AUE_ogetpagesize AUE_NULL #define SYS_AUE_msync AUE_MSYNC #define SYS_AUE_vfork AUE_VFORK -#define SYS_AUE_sbrk AUE_SBRK -#define SYS_AUE_sstk AUE_SSTK +#define SYS_AUE_freebsd14_sbrk AUE_SBRK +#define SYS_AUE_freebsd14_sstk AUE_SSTK #define SYS_AUE_ommap AUE_MMAP #define SYS_AUE_freebsd11_vadvise AUE_O_VADVISE #define SYS_AUE_munmap AUE_MUNMAP diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -106,31 +106,21 @@ _Static_assert(MAXPAGESIZES <= 4, "MINCORE_SUPER too narrow"); -#ifndef _SYS_SYSPROTO_H_ -struct sbrk_args { - int incr; -}; -#endif - +#ifdef COMPAT_FREEBSD14 int -sys_sbrk(struct thread *td, struct sbrk_args *uap) +freebsd14_sbrk(struct thread *td, struct freebsd14_sbrk_args *uap) { - /* Not yet implemented */ + /* never implemented */ return (EOPNOTSUPP); } -#ifndef _SYS_SYSPROTO_H_ -struct sstk_args { - int incr; -}; -#endif - int -sys_sstk(struct thread *td, struct sstk_args *uap) +freebsd14_sstk(struct thread *td, struct freebsd14_sstk_args *uap) { - /* Not yet implemented */ + /* never implemented */ return (EOPNOTSUPP); } +#endif #if defined(COMPAT_43) int diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c --- a/sys/vm/vm_unix.c +++ b/sys/vm/vm_unix.c @@ -59,13 +59,14 @@ #include #include +#ifdef COMPAT_FREEBSD14 #ifndef _SYS_SYSPROTO_H_ -struct break_args { +struct freebsd14_break_args { char *nsize; }; #endif int -sys_break(struct thread *td, struct break_args *uap) +freebsd14_break(struct thread *td, struct freebsd14_break_args *uap) { #if !defined(__aarch64__) && !defined(__riscv) uintptr_t addr; @@ -80,6 +81,7 @@ return (ENOSYS); #endif /* defined(__aarch64__) || defined(__riscv) */ } +#endif int kern_break(struct thread *td, uintptr_t *addr)