Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160394657
D13753.id37480.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D13753.id37480.diff
View Options
Index: head/sys/powerpc/include/vmparam.h
===================================================================
--- head/sys/powerpc/include/vmparam.h
+++ head/sys/powerpc/include/vmparam.h
@@ -60,7 +60,11 @@
#endif
#ifndef MAXSSIZ
+#ifdef __powerpc64__
+#define MAXSSIZ (512*1024*1024) /* max stack size */
+#else
#define MAXSSIZ (64*1024*1024) /* max stack size */
+#endif
#endif
#ifdef AIM
Index: head/sys/powerpc/powerpc/elf32_machdep.c
===================================================================
--- head/sys/powerpc/powerpc/elf32_machdep.c
+++ head/sys/powerpc/powerpc/elf32_machdep.c
@@ -42,6 +42,7 @@
#include <sys/sysent.h>
#include <sys/imgact_elf.h>
#include <sys/syscall.h>
+#include <sys/sysctl.h>
#include <sys/signalvar.h>
#include <sys/vnode.h>
#include <sys/linker.h>
@@ -60,6 +61,18 @@
#include <compat/freebsd32/freebsd32_util.h>
extern const char *freebsd32_syscallnames[];
+static void ppc32_fixlimit(struct rlimit *rl, int which);
+
+static SYSCTL_NODE(_compat, OID_AUTO, ppc32, CTLFLAG_RW, 0, "32-bit mode");
+
+#define PPC32_MAXDSIZ (1024*1024*1024)
+static u_long ppc32_maxdsiz = PPC32_MAXDSIZ;
+SYSCTL_ULONG(_compat_ppc32, OID_AUTO, maxdsiz, CTLFLAG_RWTUN, &ppc32_maxdsiz,
+ 0, "");
+#define PPC32_MAXSSIZ (64*1024*1024)
+u_long ppc32_maxssiz = PPC32_MAXSSIZ;
+SYSCTL_ULONG(_compat_ppc32, OID_AUTO, maxssiz, CTLFLAG_RWTUN, &ppc32_maxssiz,
+ 0, "");
#endif
struct sysentvec elf32_freebsd_sysvec = {
@@ -91,6 +104,7 @@
.sv_copyout_strings = freebsd32_copyout_strings,
.sv_setregs = ppc32_setregs,
.sv_syscallnames = freebsd32_syscallnames,
+ .sv_fixlimit = ppc32_fixlimit,
#else
.sv_maxuser = VM_MAXUSER_ADDRESS,
.sv_usrstack = USRSTACK,
@@ -98,8 +112,8 @@
.sv_copyout_strings = exec_copyout_strings,
.sv_setregs = exec_setregs,
.sv_syscallnames = syscallnames,
-#endif
.sv_fixlimit = NULL,
+#endif
.sv_maxssiz = NULL,
.sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP,
.sv_set_syscall_retval = cpu_set_syscall_retval,
@@ -319,5 +333,30 @@
{
return (0);
+}
+#endif
+
+#ifdef __powerpc64__
+static void
+ppc32_fixlimit(struct rlimit *rl, int which)
+{
+ switch (which) {
+ case RLIMIT_DATA:
+ if (ppc32_maxdsiz != 0) {
+ if (rl->rlim_cur > ppc32_maxdsiz)
+ rl->rlim_cur = ppc32_maxdsiz;
+ if (rl->rlim_max > ppc32_maxdsiz)
+ rl->rlim_max = ppc32_maxdsiz;
+ }
+ break;
+ case RLIMIT_STACK:
+ if (ppc32_maxssiz != 0) {
+ if (rl->rlim_cur > ppc32_maxssiz)
+ rl->rlim_cur = ppc32_maxssiz;
+ if (rl->rlim_max > ppc32_maxssiz)
+ rl->rlim_max = ppc32_maxssiz;
+ }
+ break;
+ }
}
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 25, 2:03 AM (12 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34300237
Default Alt Text
D13753.id37480.diff (2 KB)
Attached To
Mode
D13753: Bump MAXSSIZ and create a proper fix-up for MAXDSIZ/MAXSSIZ on powerpc64 running 32-bit binaries
Attached
Detach File
Event Timeline
Log In to Comment