@@ -127,20 +127,21 @@ impl fmt::Debug for Frame {
127127
128128#[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" , not( feature = "std" ) ) ) ]
129129mod 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 } ;
131132
132- static IMAGE_BASE : AtomicU64 = AtomicU64 :: new ( 0 ) ;
133+ static IMAGE_BASE : AtomicUsize = AtomicUsize :: new ( 0 ) ;
133134
134135 /// Set the image base address. This is only available for Fortanix SGX
135136 /// target when the `std` feature is not enabled. This can be used in the
136137 /// standard library to set the correct base address.
137138 #[ 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 ) ;
140141 }
141142
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 _
144145 }
145146}
146147
@@ -153,8 +154,8 @@ pub(crate) use self::sgx_no_std_image_base::get_image_base;
153154
154155#[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" , feature = "std" ) ) ]
155156#[ 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 _
158159}
159160
160161cfg_if:: cfg_if! {
0 commit comments