Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break compilation on SGX and 32-bit x86 without SSE (fixes #41) #44

Merged
merged 1 commit into from Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/lib.rs
Expand Up @@ -19,12 +19,14 @@ extern crate bitflags;
pub mod native_cpuid {
use super::CpuIdResult;

#[cfg(target_arch = "x86")]
#[cfg(all(target_arch = "x86", not(target_env = "sgx"), target_feature = "sse"))]
use core::arch::x86 as arch;
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", not(target_env = "sgx")))]
use core::arch::x86_64 as arch;

pub fn cpuid_count(a: u32, c: u32) -> CpuIdResult {
// Safety: CPUID is supported on all x86_64 CPUs and all x86 CPUs with
// SSE, but not by SGX.
let result = unsafe { self::arch::__cpuid_count(a, c) };

CpuIdResult {
Expand Down