summaryrefslogtreecommitdiff
path: root/patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp
diff options
context:
space:
mode:
authorLandry Breuil <landry@rhaalovely.net>2014-03-07 12:30:57 +0100
committerLandry Breuil <landry@rhaalovely.net>2014-03-07 12:30:57 +0100
commit14842b32b65c6ff3f93427d5762041acf17c77f4 (patch)
treeead979553fcc09bd0c3052188fa0e0c3f313fa03 /patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp
Initial import of webkit 2.2.4 port
Diffstat (limited to 'patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp')
-rw-r--r--patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp b/patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp
new file mode 100644
index 0000000..6cc8704
--- /dev/null
+++ b/patches/patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp
@@ -0,0 +1,29 @@
+$OpenBSD: patch-Source_JavaScriptCore_heap_MachineStackMarker_cpp,v 1.3 2013/04/13 09:11:02 landry Exp $
+--- Source/JavaScriptCore/heap/MachineStackMarker.cpp.orig Mon Oct 1 15:06:17 2012
++++ Source/JavaScriptCore/heap/MachineStackMarker.cpp Fri Mar 8 00:56:48 2013
+@@ -372,8 +372,10 @@ static size_t getPlatformThreadRegisters(const Platfor
+ #elif USE(PTHREADS)
+ pthread_attr_init(&regs);
+ #if HAVE(PTHREAD_NP_H) || OS(NETBSD)
++# ifndef __OpenBSD__
+ // e.g. on FreeBSD 5.4, neundorf@kde.org
+ pthread_attr_get_np(platformThread, &regs);
++# endif
+ #else
+ // FIXME: this function is non-portable; other POSIX systems may have different np alternatives
+ pthread_getattr_np(platformThread, &regs);
+@@ -437,7 +439,14 @@ static inline void* otherThreadStackPointer(const Plat
+ #elif USE(PTHREADS)
+ void* stackBase = 0;
+ size_t stackSize = 0;
++# if defined(__OpenBSD__)
++ stack_t ss;
++ int rc = pthread_stackseg_np(pthread_self(), &ss);
++ stackBase = (void*)((size_t) ss.ss_sp - ss.ss_size);
++ stackSize = ss.ss_size;
++#else
+ int rc = pthread_attr_getstack(&regs, &stackBase, &stackSize);
++#endif
+ (void)rc; // FIXME: Deal with error code somehow? Seems fatal.
+ ASSERT(stackBase);
+ return static_cast<char*>(stackBase) + stackSize;