|
67 | 67 | # include <stdio.h> |
68 | 68 | # include <unistd.h> |
69 | 69 | # include <sys/resource.h> |
70 | | -# include <pthread.h> |
71 | 70 | # include <sys/stat.h> |
72 | 71 | # include <sys/time.h> |
73 | 72 | # include <sys/utsname.h> |
|
83 | 82 | # include <pthread_np.h> |
84 | 83 | #endif |
85 | 84 |
|
86 | | -// needed by current_stack_region() workaround for Mavericks |
87 | | -#if defined(__APPLE__) |
88 | | -# include <errno.h> |
89 | | -# include <sys/types.h> |
90 | | -# include <sys/sysctl.h> |
91 | | -# define DEFAULT_MAIN_THREAD_STACK_PAGES 2048 |
92 | | -# define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13 |
93 | | -#endif |
94 | | - |
95 | 85 | #define SPELL_REG_SP "sp" |
96 | 86 | #define SPELL_REG_FP "fp" |
97 | 87 |
|
98 | 88 | #ifdef __APPLE__ |
99 | 89 | // see darwin-xnu/osfmk/mach/arm/_structs.h |
100 | 90 |
|
101 | | -# if __DARWIN_UNIX03 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) |
102 | | - // 10.5 UNIX03 member name prefixes |
103 | | - #define DU3_PREFIX(s, m) __ ## s.__ ## m |
104 | | -# else |
105 | | - #define DU3_PREFIX(s, m) s ## . ## m |
106 | | -# endif |
| 91 | +// 10.5 UNIX03 member name prefixes |
| 92 | +#define DU3_PREFIX(s, m) __ ## s.__ ## m |
107 | 93 | #endif |
108 | 94 |
|
109 | 95 | #define context_x uc_mcontext->DU3_PREFIX(ss,x) |
@@ -213,15 +199,6 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, |
213 | 199 | // point of execution. |
214 | 200 | ThreadWXEnable wx(WXWrite, thread); |
215 | 201 |
|
216 | | -/* |
217 | | - NOTE: does not seem to work on bsd. |
218 | | - if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) { |
219 | | - // can't decode this kind of signal |
220 | | - info = NULL; |
221 | | - } else { |
222 | | - assert(sig == info->si_signo, "bad siginfo"); |
223 | | - } |
224 | | -*/ |
225 | 202 | // decide if this trap can be handled by a stub |
226 | 203 | address stub = NULL; |
227 | 204 |
|
@@ -379,27 +356,6 @@ static void current_stack_region(address * bottom, size_t * size) { |
379 | 356 | pthread_t self = pthread_self(); |
380 | 357 | void *stacktop = pthread_get_stackaddr_np(self); |
381 | 358 | *size = pthread_get_stacksize_np(self); |
382 | | - // workaround for OS X 10.9.0 (Mavericks) |
383 | | - // pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages |
384 | | - if (pthread_main_np() == 1) { |
385 | | - // At least on Mac OS 10.12 we have observed stack sizes not aligned |
386 | | - // to pages boundaries. This can be provoked by e.g. setrlimit() (ulimit -s xxxx in the |
387 | | - // shell). Apparently Mac OS actually rounds upwards to next multiple of page size, |
388 | | - // however, we round downwards here to be on the safe side. |
389 | | - *size = align_down(*size, getpagesize()); |
390 | | - |
391 | | - if ((*size) < (DEFAULT_MAIN_THREAD_STACK_PAGES * (size_t)getpagesize())) { |
392 | | - char kern_osrelease[256]; |
393 | | - size_t kern_osrelease_size = sizeof(kern_osrelease); |
394 | | - int ret = sysctlbyname("kern.osrelease", kern_osrelease, &kern_osrelease_size, NULL, 0); |
395 | | - if (ret == 0) { |
396 | | - // get the major number, atoi will ignore the minor amd micro portions of the version string |
397 | | - if (atoi(kern_osrelease) >= OS_X_10_9_0_KERNEL_MAJOR_VERSION) { |
398 | | - *size = (DEFAULT_MAIN_THREAD_STACK_PAGES*getpagesize()); |
399 | | - } |
400 | | - } |
401 | | - } |
402 | | - } |
403 | 359 | *bottom = (address) stacktop - *size; |
404 | 360 | #elif defined(__OpenBSD__) |
405 | 361 | stack_t ss; |
|
0 commit comments