99 __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
100 return (address) ((char*)esp + sizeof(long)*2);
101 #elif defined(__clang__)
102 void* esp;
103 __asm__ __volatile__ ("mov %%" SPELL_REG_SP ", %0":"=r"(esp):);
104 return (address) esp;
105 #else
106 register void *esp __asm__ (SPELL_REG_SP);
107 return (address) esp;
108 #endif
109 }
110
111 char* os::non_memory_address_word() {
112 // Must never look like an address returned by reserve_memory,
113 // even in its subfields (as defined by the CPU immediate fields,
114 // if the CPU splits constants across multiple instructions).
115
116 return (char*) -1;
117 }
118
119 void os::initialize_thread(Thread* thr) {
120 // Nothing to do.
121 }
122
123 address os::Linux::ucontext_get_pc(const ucontext_t * uc) {
124 return (address)uc->uc_mcontext.gregs[REG_PC];
125 }
126
127 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
128 uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc;
129 }
130
131 intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
132 return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
133 }
134
135 intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
136 return (intptr_t*)uc->uc_mcontext.gregs[REG_FP];
137 }
138
139 // For Forte Analyzer AsyncGetCallTrace profiling support - thread
140 // is currently interrupted by SIGPROF.
141 // os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal
142 // frames. Currently we don't do that on Linux, so it's the same as
|
99 __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
100 return (address) ((char*)esp + sizeof(long)*2);
101 #elif defined(__clang__)
102 void* esp;
103 __asm__ __volatile__ ("mov %%" SPELL_REG_SP ", %0":"=r"(esp):);
104 return (address) esp;
105 #else
106 register void *esp __asm__ (SPELL_REG_SP);
107 return (address) esp;
108 #endif
109 }
110
111 char* os::non_memory_address_word() {
112 // Must never look like an address returned by reserve_memory,
113 // even in its subfields (as defined by the CPU immediate fields,
114 // if the CPU splits constants across multiple instructions).
115
116 return (char*) -1;
117 }
118
119 address os::Linux::ucontext_get_pc(const ucontext_t * uc) {
120 return (address)uc->uc_mcontext.gregs[REG_PC];
121 }
122
123 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
124 uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc;
125 }
126
127 intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
128 return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
129 }
130
131 intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
132 return (intptr_t*)uc->uc_mcontext.gregs[REG_FP];
133 }
134
135 // For Forte Analyzer AsyncGetCallTrace profiling support - thread
136 // is currently interrupted by SIGPROF.
137 // os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal
138 // frames. Currently we don't do that on Linux, so it's the same as
|