@@ -127,20 +127,21 @@ impl fmt::Debug for Frame {
127
127
128
128
#[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" , not( feature = "std" ) ) ) ]
129
129
mod sgx_no_std_image_base {
130
- use core:: sync:: atomic:: { AtomicU64 , Ordering :: SeqCst } ;
130
+ use core:: ffi:: c_void;
131
+ use core:: sync:: atomic:: { AtomicUsize , Ordering :: SeqCst } ;
131
132
132
- static IMAGE_BASE : AtomicU64 = AtomicU64 :: new ( 0 ) ;
133
+ static IMAGE_BASE : AtomicUsize = AtomicUsize :: new ( 0 ) ;
133
134
134
135
/// Set the image base address. This is only available for Fortanix SGX
135
136
/// target when the `std` feature is not enabled. This can be used in the
136
137
/// standard library to set the correct base address.
137
138
#[ doc( hidden) ]
138
- pub fn set_image_base ( base_addr : u64 ) {
139
- IMAGE_BASE . store ( base_addr, SeqCst ) ;
139
+ pub fn set_image_base ( base_addr : * mut c_void ) {
140
+ IMAGE_BASE . store ( base_addr as _ , SeqCst ) ;
140
141
}
141
142
142
- pub ( crate ) fn get_image_base ( ) -> u64 {
143
- IMAGE_BASE . load ( SeqCst )
143
+ pub ( crate ) fn get_image_base ( ) -> * mut c_void {
144
+ IMAGE_BASE . load ( SeqCst ) as _
144
145
}
145
146
}
146
147
@@ -153,8 +154,8 @@ pub(crate) use self::sgx_no_std_image_base::get_image_base;
153
154
154
155
#[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" , feature = "std" ) ) ]
155
156
#[ deny( unused) ]
156
- pub ( crate ) fn get_image_base ( ) -> u64 {
157
- std:: os:: fortanix_sgx:: mem:: image_base ( )
157
+ pub ( crate ) fn get_image_base ( ) -> * mut c_void {
158
+ std:: os:: fortanix_sgx:: mem:: image_base ( ) as _
158
159
}
159
160
160
161
cfg_if:: cfg_if! {
0 commit comments