diff options
| author | Dario Gonzalez <dario.gonzalez@fortanix.com> | 2020-06-29 09:07:33 -0700 |
|---|---|---|
| committer | Dario Gonzalez <dario.gonzalez@fortanix.com> | 2020-06-29 09:07:33 -0700 |
| commit | 9448ed4c1f8b586c9c90a78c12afc4c826041d5a (patch) | |
| tree | 3e8878a4f6b10aee3b2e0da048991170cd529571 /src/libstd/sys | |
| parent | 9f3c96b869b48ecd0bb556c6ad9cd603b4dacfb9 (diff) | |
| download | rust-9448ed4c1f8b586c9c90a78c12afc4c826041d5a.tar.gz rust-9448ed4c1f8b586c9c90a78c12afc4c826041d5a.zip | |
Obviate #[allow(improper_ctypes_definitions)]
Modifies the return type for `fn entry` so that allowing improper_ctypes_definitions is no longer necessary. This change is derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs` with `UsercallReturn`.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/sgx/abi/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/sys/sgx/abi/mod.rs b/src/libstd/sys/sgx/abi/mod.rs index 5ef26d4cc4d..b0693b63a48 100644 --- a/src/libstd/sys/sgx/abi/mod.rs +++ b/src/libstd/sys/sgx/abi/mod.rs @@ -17,6 +17,9 @@ pub mod usercalls; #[cfg(not(test))] global_asm!(include_str!("entry.S")); +#[repr(C)] +struct EntryReturn(u64, u64); + #[cfg(not(test))] #[no_mangle] unsafe extern "C" fn tcs_init(secondary: bool) { @@ -56,8 +59,7 @@ unsafe extern "C" fn tcs_init(secondary: bool) { // able to specify this #[cfg(not(test))] #[no_mangle] -#[allow(improper_ctypes_definitions)] -extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> (u64, u64) { +extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> EntryReturn { // FIXME: how to support TLS in library mode? let tls = Box::new(tls::Tls::new()); let _tls_guard = unsafe { tls.activate() }; @@ -65,7 +67,7 @@ extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64 if secondary { super::thread::Thread::entry(); - (0, 0) + EntryReturn(0, 0) } else { extern "C" { fn main(argc: isize, argv: *const *const u8) -> isize; |
