File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,16 @@ macro_rules! define_rust_probestack {
109
109
//
110
110
// The ABI here is that the stack frame size is located in `%rax`. Upon
111
111
// return we're not supposed to modify `%rsp` or `%rax`.
112
+ #[ cfg( all( target_arch = "x86_64" , not( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ) ) ]
113
+ macro_rules! ret ( ( ) => ( "ret" ) ) ;
114
+ #[ cfg( all( target_arch = "x86_64" , all( target_env = "sgx" , target_vendor = "fortanix" ) ) ) ]
115
+ macro_rules! ret ( ( ) => ( "
116
+ pop %r11
117
+ lfence
118
+ jmp *%r11
119
+ " ) ) ;
112
120
#[ cfg( target_arch = "x86_64" ) ]
113
- global_asm ! ( define_rust_probestack!(
121
+ global_asm ! ( define_rust_probestack!( concat! (
114
122
"
115
123
.cfi_startproc
116
124
pushq %rbp
@@ -158,10 +166,12 @@ global_asm!(define_rust_probestack!(
158
166
leave
159
167
.cfi_def_cfa_register %rsp
160
168
.cfi_adjust_cfa_offset -8
161
- ret
169
+ " ,
170
+ ret!( ) ,
171
+ "
162
172
.cfi_endproc
163
173
"
164
- ) ) ;
174
+ ) ) ) ;
165
175
166
176
#[ cfg( target_arch = "x86" ) ]
167
177
// This is the same as x86_64 above, only translated for 32-bit sizes. Note
You can’t perform that action at this time.
0 commit comments