rust-cpuid icon indicating copy to clipboard operation
rust-cpuid copied to clipboard

Update rust-cpuid to support libcpuid 0.4.0

Open abronan opened this issue 9 years ago • 2 comments

Hi,

This commit updates rust-cpuid to support libcpuid version 0.4.0, mostly updating the structures and their allocation. It includes:

  • Update MAX_INTELFN4_LEVEL to usize 8
  • Update cpu_raw_data_t with new intel fields
  • Update cpu_id_t to include new fields with sgx support
  • Update CPUFeature to include new features
  • Switch back to using Default::default() instead of mem::uninitialized()

Regarding that last point, I'm not extremely familiar with undefined behavior (still fighting my way through the rustonomicon), thus I changed back to using default() instead of mem::uninitialized(). Looking at the documentation it seems that using mem::uninitialized() is considered harmful. But I can update the PR and change this back if this is the preferred way to deal with initializing the structs.

Not sure if this is going to pass through the CI but let's see! :)

Thanks for the lib!

Signed-off-by: Alexandre Beslic [email protected]

abronan avatar Dec 09 '16 14:12 abronan

Any updates on this PR?

zyluo avatar May 25 '21 00:05 zyluo

@zyluo Until this gets reviewed and merged into this repository, I have a working fork with this change merged in: https://github.com/MantissaLabs/rust-cpuid

abronan avatar Jul 08 '21 13:07 abronan