blob: a13cbc24a59b95236fa2d029894beddea772bbf7 (
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
36
37
38
39
40
41
42
43
44
|
$NetBSD: patch-bi,v 1.2 2012/10/24 15:36:47 joerg Exp $
--- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp.orig 2009-10-17 16:49:37.000000000 +0200
+++ hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
@@ -60,7 +60,7 @@
#define SPELL_REG_FP "ebp"
#endif // AMD64
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
# define context_trapno uc_mcontext.mc_trapno
# ifdef AMD64
# define context_pc uc_mcontext.mc_rip
@@ -275,14 +275,7 @@
#endif
address os::current_stack_pointer() {
-#ifdef SPARC_WORKS
- register void *esp;
- __asm__("mov %%"SPELL_REG_SP", %0":"=r"(esp));
- return (address) ((char*)esp + sizeof(long)*2);
-#else
- register void *esp __asm__ (SPELL_REG_SP);
- return (address) esp;
-#endif
+ return (address)__builtin_frame_address(0);
}
char* os::non_memory_address_word() {
@@ -358,13 +351,7 @@ frame os::get_sender_for_C_frame(frame*
}
intptr_t* _get_previous_fp() {
-#ifdef SPARC_WORKS
- register intptr_t **ebp;
- __asm__("mov %%"SPELL_REG_FP", %0":"=r"(ebp));
-#else
- register intptr_t **ebp __asm__ (SPELL_REG_FP);
-#endif
- return (intptr_t*) *ebp; // we want what it points to.
+ return (intptr_t *)__builtin_frame_address(1);
}
|