diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-04-11 15:13:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-04-11 15:13:02 +0000 |
commit | bef26dee917b1ca6458da1eef9420d30abd219f1 (patch) | |
tree | 8d809b8f93a379b9027bcc7fd32993b9667f341d /sys/arch | |
parent | bbea701b11944be027a03b0ff429be946b532ef1 (diff) |
use MD #define to choose stackgap size per-architecture. on sparc, special
case sun4c/sun4 -- because address space is more constrained
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/amd64/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/arm/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/hppa/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/m68k/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/m88k/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/macppc/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/mips64/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/mvmeppc/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/sparc/include/vmparam.h | 5 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 9 | ||||
-rw-r--r-- | sys/arch/sparc64/include/vmparam.h | 5 | ||||
-rw-r--r-- | sys/arch/vax/include/vmparam.h | 4 |
14 files changed, 49 insertions, 14 deletions
diff --git a/sys/arch/alpha/include/vmparam.h b/sys/arch/alpha/include/vmparam.h index 9eabc6cd58f..ffe2b94cfd7 100644 --- a/sys/arch/alpha/include/vmparam.h +++ b/sys/arch/alpha/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.13 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.14 2005/04/11 15:12:59 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.18 2000/05/22 17:13:54 thorpej Exp $ */ /* @@ -79,6 +79,8 @@ #define MAXSSIZ (1<<25) /* max stack size (32M) */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * PTEs for mapping user space into the kernel for phyio operations. * 64 pte's are enough to cover 8 disks * MAXBSIZE. diff --git a/sys/arch/amd64/include/vmparam.h b/sys/arch/amd64/include/vmparam.h index a9219c22d4e..b57d323f5b3 100644 --- a/sys/arch/amd64/include/vmparam.h +++ b/sys/arch/amd64/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.2 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.3 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $ */ /*- @@ -73,6 +73,8 @@ #define MAXSSIZ (32*1024*1024) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * Size of shared memory map */ diff --git a/sys/arch/arm/include/vmparam.h b/sys/arch/arm/include/vmparam.h index 48357bf4cb5..dfce524efa1 100644 --- a/sys/arch/arm/include/vmparam.h +++ b/sys/arch/arm/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.2 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.3 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.18 2003/05/21 18:04:44 thorpej Exp $ */ /* @@ -71,6 +71,8 @@ #define MAXSSIZ (8*1024*1024) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * Size of SysV shared memory map */ diff --git a/sys/arch/hppa/include/vmparam.h b/sys/arch/hppa/include/vmparam.h index e9b0e407c5d..0bae193a98e 100644 --- a/sys/arch/hppa/include/vmparam.h +++ b/sys/arch/hppa/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.31 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.32 2005/04/11 15:13:01 deraadt Exp $ */ /* * Copyright (c) 1988-1994, The University of Utah and @@ -56,6 +56,8 @@ #define MAXSSIZ (128*1024*1024UL) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + #ifndef USRIOSIZE #define USRIOSIZE ((2*HPPA_PGALIAS)/PAGE_SIZE) /* 2mb */ #endif diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h index 37cec70aee7..d3674657810 100644 --- a/sys/arch/i386/include/vmparam.h +++ b/sys/arch/i386/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.30 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.31 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */ /*- @@ -72,6 +72,8 @@ #define MAXSSIZ (32*1024*1024) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* I386 has a line where all code is executable: 0 - I386_MAX_EXE_ADDR */ #define I386_MAX_EXE_ADDR 0x20000000 /* exec line */ diff --git a/sys/arch/m68k/include/vmparam.h b/sys/arch/m68k/include/vmparam.h index df3f0460987..fcb84559ff7 100644 --- a/sys/arch/m68k/include/vmparam.h +++ b/sys/arch/m68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.3 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.4 2005/04/11 15:13:01 deraadt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -76,6 +76,8 @@ #define MAXSSIZ MAXDSIZ /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * Sizes of the system and user portions of the system page table. */ diff --git a/sys/arch/m88k/include/vmparam.h b/sys/arch/m88k/include/vmparam.h index d2e22e82192..9f1a26d19e0 100644 --- a/sys/arch/m88k/include/vmparam.h +++ b/sys/arch/m88k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.2 2004/11/28 01:36:38 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.3 2005/04/11 15:13:01 deraadt Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -59,6 +59,8 @@ #define MAXSSIZ MAXDSIZ /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * Size of shared memory map */ diff --git a/sys/arch/macppc/include/vmparam.h b/sys/arch/macppc/include/vmparam.h index 9948205b482..61d7274a860 100644 --- a/sys/arch/macppc/include/vmparam.h +++ b/sys/arch/macppc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.14 2004/11/28 01:36:39 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.15 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $ */ /*- @@ -58,6 +58,8 @@ #define MAXSSIZ (32*1024*1024) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * Size of shared memory map */ diff --git a/sys/arch/mips64/include/vmparam.h b/sys/arch/mips64/include/vmparam.h index b21fe75dda7..9f7daa07036 100644 --- a/sys/arch/mips64/include/vmparam.h +++ b/sys/arch/mips64/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.8 2004/11/28 01:36:39 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.9 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */ /* @@ -74,6 +74,8 @@ #define MAXSSIZ (32*1024*1024) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * PTEs for mapping user space into the kernel for phyio operations. * 16 pte's are enough to cover 8 disks * MAXBSIZE. diff --git a/sys/arch/mvmeppc/include/vmparam.h b/sys/arch/mvmeppc/include/vmparam.h index fcc493b687a..0304094be49 100644 --- a/sys/arch/mvmeppc/include/vmparam.h +++ b/sys/arch/mvmeppc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.13 2004/11/28 01:36:39 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.14 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $ */ /*- @@ -58,6 +58,8 @@ #define MAXSSIZ (32*1024*1024) /* max stack size */ #endif +#define STACKGAP_RANDOM 256*1024 + /* * Size of shared memory map */ diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h index a8ab4d3540d..dc35ede11e3 100644 --- a/sys/arch/sparc/include/vmparam.h +++ b/sys/arch/sparc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.29 2004/11/28 01:36:39 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.30 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */ /* @@ -74,6 +74,9 @@ #define MAXSSIZ MAXDSIZ /* max stack size */ #endif +#define STACKGAP_RANDOM 64*1024 +#define STACKGAP_RANDOM_SUN4M 256*1024 + /* * Size of shared memory map */ diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 693e6725b00..ec45d7fad67 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.104 2005/03/23 17:14:46 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -73,6 +73,7 @@ #include <machine/frame.h> #include <machine/cpu.h> #include <machine/pmap.h> +#include <machine/vmparam.h> #include <machine/oldmon.h> #include <machine/bsd_openprom.h> @@ -169,6 +170,12 @@ cpu_startup() pmapdebug = 0; #endif + if (CPU_ISSUN4M) { + extern int stackgap_random; + + stackgap_random = STACKGAP_RANDOM_SUN4M; + } + /* * fix message buffer mapping, note phys addr of msgbuf is 0 */ diff --git a/sys/arch/sparc64/include/vmparam.h b/sys/arch/sparc64/include/vmparam.h index 6541896174f..d7ffda068dc 100644 --- a/sys/arch/sparc64/include/vmparam.h +++ b/sys/arch/sparc64/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.13 2004/11/28 01:36:39 mickey Exp $ */ +/* $OpenBSD: vmparam.h,v 1.14 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.18 2001/05/01 02:19:19 thorpej Exp $ */ /* @@ -110,6 +110,9 @@ #define MAXSSIZ (8*1024*1024) /* max stack size */ #endif #endif + +#define STACKGAP_RANDOM 256*1024 + /* * Size of shared memory map */ diff --git a/sys/arch/vax/include/vmparam.h b/sys/arch/vax/include/vmparam.h index 6ff14542f85..69c8ac0bc78 100644 --- a/sys/arch/vax/include/vmparam.h +++ b/sys/arch/vax/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.21 2005/03/31 21:30:25 tdeval Exp $ */ +/* $OpenBSD: vmparam.h,v 1.22 2005/04/11 15:13:01 deraadt Exp $ */ /* $NetBSD: vmparam.h,v 1.32 2000/03/07 00:05:59 matt Exp $ */ /*- @@ -73,6 +73,8 @@ #define DFLSSIZ (512*1024) /* initial stack size limit */ #endif +#define STACKGAP_RANDOM 32*1024 + /* * All mmap()'ed data will be mapped above MAXDSIZ. This means that * pte space must be allocated for (possible) mmap()'ed data. |