summaryrefslogtreecommitdiffstats
path: root/libs/wpewebkit/patches/301-ppc-current-stack-pointer.patch
blob: dc66d995908405783fffa78ea67450e2e63c52ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 7931bf3de0c93ca3782a9483ca30b3061356b167 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Wed, 23 Sep 2026 14:33:27 +0100
Subject: [PATCH] currentStackPointer for Linux/PPC, Linux/PPC64

Reviewed by NOBODY (OOPS!).

Add inline assembly implementation to return the current stack
pointer on Linux running on PowerPC and PowerPC64 archtecture.

* Source/WTF/wtf/StackPointer.cpp:
---
 Source/WTF/wtf/StackPointer.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

--- a/Source/WTF/wtf/StackPointer.cpp
+++ b/Source/WTF/wtf/StackPointer.cpp
@@ -171,6 +171,17 @@ __asm__(
      ".previous" "\n"
 );
 
+#elif CPU(PPC) || CPU(PPC64)
+asm (
+    ".text" "\n"
+    ".globl " SYMBOL_STRING(currentStackPointer) "\n"
+    SYMBOL_STRING(currentStackPointer) ":" "\n"
+
+    "mr 3, 1" "\n" // Move stack pointer (r1) to return register (r3)
+    "blr" "\n"     // Branch to link register (return)
+    ".previous" "\n"
+);
+
 #else
 #error "Unsupported platform: need implementation of currentStackPointer."
 #endif