diff options
-rw-r--r-- | include/pthread.h | 4 | ||||
-rw-r--r-- | sys/arch/alpha/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/amd64/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/arm/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/arm64/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/hppa/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/m88k/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/mips64/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/powerpc/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/sh/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/sparc64/include/_types.h | 3 | ||||
-rw-r--r-- | sys/sys/shm.h | 9 | ||||
-rw-r--r-- | sys/sys/signal.h | 10 |
14 files changed, 33 insertions, 23 deletions
diff --git a/include/pthread.h b/include/pthread.h index ecbb76a5f22..cfb1356a1d4 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread.h,v 1.3 2017/11/04 22:53:57 jca Exp $ */ +/* $OpenBSD: pthread.h,v 1.4 2018/03/05 01:15:26 deraadt Exp $ */ /* * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu @@ -51,7 +51,7 @@ */ #define PTHREAD_DESTRUCTOR_ITERATIONS 4 #define PTHREAD_KEYS_MAX 256 -#define PTHREAD_STACK_MIN 2048 +#define PTHREAD_STACK_MIN (1U << _MAX_PAGE_SHIFT) #define PTHREAD_THREADS_MAX ULONG_MAX /* diff --git a/sys/arch/alpha/include/_types.h b/sys/arch/alpha/include/_types.h index ce8f3fa138e..875709fce9f 100644 --- a/sys/arch/alpha/include/_types.h +++ b/sys/arch/alpha/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.23 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.24 2018/03/05 01:15:24 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -55,6 +55,7 @@ typedef struct label_t { #define _STACKALIGNBYTES _ALIGNBYTES #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 13 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/arch/amd64/include/_types.h b/sys/arch/amd64/include/_types.h index 1e72f5dc77a..67c67a1472f 100644 --- a/sys/arch/amd64/include/_types.h +++ b/sys/arch/amd64/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.16 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.17 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -49,6 +49,7 @@ #define _STACKALIGNBYTES 15 #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) &~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) 1 +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ #if defined(_KERNEL) typedef struct label_t { diff --git a/sys/arch/arm/include/_types.h b/sys/arch/arm/include/_types.h index ac365930446..10703b36b4a 100644 --- a/sys/arch/arm/include/_types.h +++ b/sys/arch/arm/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.18 2018/03/01 21:00:50 kettenis Exp $ */ +/* $OpenBSD: _types.h,v 1.19 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -55,6 +55,7 @@ typedef struct label_t { #define _STACKALIGNBYTES 7 #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/arch/arm64/include/_types.h b/sys/arch/arm64/include/_types.h index 1f75e6ea0a1..e60a89fc513 100644 --- a/sys/arch/arm64/include/_types.h +++ b/sys/arch/arm64/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.3 2017/01/25 10:24:13 patrick Exp $ */ +/* $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -54,6 +54,7 @@ typedef struct label_t { #define _STACKALIGNBYTES 15 #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/arch/hppa/include/_types.h b/sys/arch/hppa/include/_types.h index 9e8f9437ca8..2cdb8923995 100644 --- a/sys/arch/hppa/include/_types.h +++ b/sys/arch/hppa/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -55,6 +55,7 @@ typedef struct label_t { #define _STACKALIGNBYTES _ALIGNBYTES #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ typedef unsigned long hppa_hpa_t; /* XXX */ typedef unsigned long hppa_spa_t; /* XXX */ diff --git a/sys/arch/i386/include/_types.h b/sys/arch/i386/include/_types.h index 73582c1d7fc..7da9a3c6ea8 100644 --- a/sys/arch/i386/include/_types.h +++ b/sys/arch/i386/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.22 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.23 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -49,6 +49,7 @@ #define _STACKALIGNBYTES 15 #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) 1 +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ #if defined(_KERNEL) typedef struct label_t { diff --git a/sys/arch/m88k/include/_types.h b/sys/arch/m88k/include/_types.h index 7b157645819..51c0b829132 100644 --- a/sys/arch/m88k/include/_types.h +++ b/sys/arch/m88k/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.17 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.18 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -59,6 +59,7 @@ typedef struct label_t { #define _STACKALIGNBYTES _ALIGNBYTES #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/arch/mips64/include/_types.h b/sys/arch/mips64/include/_types.h index 225a52bf2a0..cfdf2548edb 100644 --- a/sys/arch/mips64/include/_types.h +++ b/sys/arch/mips64/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.22 2017/01/21 14:45:29 visa Exp $ */ +/* $OpenBSD: _types.h,v 1.23 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -49,6 +49,7 @@ #define _STACKALIGNBYTES 15 #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 14 /* maximum possible PAGE_SHIFT */ /* * We need to handle the various ISA levels for sizes. diff --git a/sys/arch/powerpc/include/_types.h b/sys/arch/powerpc/include/_types.h index 88a91c134e5..d036388d798 100644 --- a/sys/arch/powerpc/include/_types.h +++ b/sys/arch/powerpc/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.22 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.23 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -55,6 +55,7 @@ typedef struct label_t { #define _STACKALIGNBYTES 15 #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/arch/sh/include/_types.h b/sys/arch/sh/include/_types.h index f96cd5586db..208b3f44152 100644 --- a/sys/arch/sh/include/_types.h +++ b/sys/arch/sh/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.19 2015/09/26 16:01:01 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.20 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -55,6 +55,7 @@ typedef struct label_t { #define _STACKALIGNBYTES _ALIGNBYTES #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 12 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/arch/sparc64/include/_types.h b/sys/arch/sparc64/include/_types.h index 9d9f1ec50ba..5d911f2c83d 100644 --- a/sys/arch/sparc64/include/_types.h +++ b/sys/arch/sparc64/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.22 2015/09/26 16:01:00 guenther Exp $ */ +/* $OpenBSD: _types.h,v 1.23 2018/03/05 01:15:25 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -55,6 +55,7 @@ typedef struct label_t { #define _STACKALIGNBYTES _ALIGNBYTES #define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #define _ALIGNED_POINTER(p,t) ((((unsigned long)(p)) & (sizeof(t) - 1)) == 0) +#define _MAX_PAGE_SHIFT 13 /* same as PAGE_SHIFT */ /* 7.18.1.1 Exact-width integer types */ typedef signed char __int8_t; diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 551eb74156c..a3f79d6c0b0 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: shm.h,v 1.27 2014/11/23 04:31:42 guenther Exp $ */ +/* $OpenBSD: shm.h,v 1.28 2018/03/05 01:15:26 deraadt Exp $ */ /* $NetBSD: shm.h,v 1.20 1996/04/09 20:55:35 cgd Exp $ */ /* @@ -86,13 +86,8 @@ /* * Segment low boundry address multiple - * Use PAGE_SIZE for kernel but for userland query the kernel for the value. */ -#if defined(_KERNEL) || defined(_STANDALONE) -#define SHMLBA PAGE_SIZE -#else -#define SHMLBA (getpagesize()) -#endif /* _KERNEL || _STANDALONE */ +#define SHMLBA (1U << _MAX_PAGE_SHIFT) typedef short shmatt_t; diff --git a/sys/sys/signal.h b/sys/sys/signal.h index f54860fb9a5..5ca8f3f6d5d 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.h,v 1.26 2013/04/29 17:06:20 matthew Exp $ */ +/* $OpenBSD: signal.h,v 1.27 2018/03/05 01:15:26 deraadt Exp $ */ /* $NetBSD: signal.h,v 1.21 1996/02/09 18:25:32 christos Exp $ */ /* @@ -180,8 +180,12 @@ typedef struct sigaltstack { } stack_t; #define SS_ONSTACK 0x0001 /* take signals on alternate stack */ #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ -#define MINSIGSTKSZ 8192 /* minimum allowable stack */ -#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ +#define MINSIGSTKSZ (1U << _MAX_PAGE_SHIFT) /* minimum allowable stack */ +#if _MAX_PAGE_SHIFT < 14 +#define SIGSTKSZ (1U << 15) /* recommended stack size */ +#else +#define SIGSTKSZ (1U << 16) /* recommended stack size */ +#endif typedef struct sigcontext ucontext_t; #endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */ |