summaryrefslogtreecommitdiff
path: root/Kernel/PerformanceEventBuffer.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2022-05-02 22:22:33 +0200
committerAndreas Kling <kling@serenityos.org>2022-05-03 21:53:36 +0200
commit442800db3e5e225bfa45c76c58bae9a5fd7de6ab (patch)
tree56fd1ee5ba29a0ef93de10abe5d5a2e4fac0a4e8 /Kernel/PerformanceEventBuffer.cpp
parentdcd76db319a59a02eb2f4092e428c8624351ecec (diff)
downloadserenity-442800db3e5e225bfa45c76c58bae9a5fd7de6ab.zip
Kernel: Fetch the frame pointer using __builtin_frame_address()
This compiler builtin abstracts away the specifics of fetching the frame pointer. This will allow the KSyms.cpp to be build for the aarch64 target. While we're here, lets also change the PerformanceEventBuffer.cpp to not rely on x86_64 specifics.
Diffstat (limited to 'Kernel/PerformanceEventBuffer.cpp')
-rw-r--r--Kernel/PerformanceEventBuffer.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/Kernel/PerformanceEventBuffer.cpp b/Kernel/PerformanceEventBuffer.cpp
index 8f930cda6b..2f9f6f8e42 100644
--- a/Kernel/PerformanceEventBuffer.cpp
+++ b/Kernel/PerformanceEventBuffer.cpp
@@ -24,14 +24,7 @@ PerformanceEventBuffer::PerformanceEventBuffer(NonnullOwnPtr<KBuffer> buffer)
NEVER_INLINE ErrorOr<void> PerformanceEventBuffer::append(int type, FlatPtr arg1, FlatPtr arg2, StringView arg3, Thread* current_thread, FlatPtr arg4, u64 arg5, ErrorOr<FlatPtr> arg6)
{
- FlatPtr base_pointer;
-#if ARCH(I386)
- asm volatile("movl %%ebp, %%eax"
- : "=a"(base_pointer));
-#else
- asm volatile("movq %%rbp, %%rax"
- : "=a"(base_pointer));
-#endif
+ FlatPtr base_pointer = (FlatPtr)__builtin_frame_address(0);
return append_with_ip_and_bp(current_thread->pid(), current_thread->tid(), 0, base_pointer, type, 0, arg1, arg2, arg3, arg4, arg5, arg6);
}