74 # include <fpu_control.h>
75 # include <asm/ptrace.h>
76
77 #define SPELL_REG_SP "sp"
78
79 // Don't #define SPELL_REG_FP for thumb because it is not safe to use, so this makes sure we never fetch it.
80 #ifndef __thumb__
81 #define SPELL_REG_FP AARCH64_ONLY("x29") NOT_AARCH64("fp")
82 #endif
83
84 address os::current_stack_pointer() {
85 register address sp __asm__ (SPELL_REG_SP);
86 return sp;
87 }
88
89 char* os::non_memory_address_word() {
90 // Must never look like an address returned by reserve_memory
91 return (char*) -1;
92 }
93
94 void os::initialize_thread(Thread* thr) {
95 // Nothing to do
96 }
97
98 #ifdef AARCH64
99
100 #define arm_pc pc
101 #define arm_sp sp
102 #define arm_fp regs[29]
103 #define arm_r0 regs[0]
104 #define ARM_REGS_IN_CONTEXT 31
105
106 #else
107
108 #if NGREG == 16
109 // These definitions are based on the observation that until
110 // the certain version of GCC mcontext_t was defined as
111 // a structure containing gregs[NGREG] array with 16 elements.
112 // In later GCC versions mcontext_t was redefined as struct sigcontext,
113 // along with NGREG constant changed to 18.
114 #define arm_pc gregs[15]
115 #define arm_sp gregs[13]
116 #define arm_fp gregs[11]
117 #define arm_r0 gregs[0]
|
74 # include <fpu_control.h>
75 # include <asm/ptrace.h>
76
77 #define SPELL_REG_SP "sp"
78
79 // Don't #define SPELL_REG_FP for thumb because it is not safe to use, so this makes sure we never fetch it.
80 #ifndef __thumb__
81 #define SPELL_REG_FP AARCH64_ONLY("x29") NOT_AARCH64("fp")
82 #endif
83
84 address os::current_stack_pointer() {
85 register address sp __asm__ (SPELL_REG_SP);
86 return sp;
87 }
88
89 char* os::non_memory_address_word() {
90 // Must never look like an address returned by reserve_memory
91 return (char*) -1;
92 }
93
94 #ifdef AARCH64
95
96 #define arm_pc pc
97 #define arm_sp sp
98 #define arm_fp regs[29]
99 #define arm_r0 regs[0]
100 #define ARM_REGS_IN_CONTEXT 31
101
102 #else
103
104 #if NGREG == 16
105 // These definitions are based on the observation that until
106 // the certain version of GCC mcontext_t was defined as
107 // a structure containing gregs[NGREG] array with 16 elements.
108 // In later GCC versions mcontext_t was redefined as struct sigcontext,
109 // along with NGREG constant changed to 18.
110 #define arm_pc gregs[15]
111 #define arm_sp gregs[13]
112 #define arm_fp gregs[11]
113 #define arm_r0 gregs[0]
|