shepmaster / cupid

Get information about the x86 and x86_64 processor
MIT License
34 stars 9 forks source link

Add support for compiling on stable Rust #3

Closed alexcrichton closed 7 years ago

alexcrichton commented 7 years ago

Use the gcc crate with some assembly stubs for the various platforms to compile in the support for calling out to the native cpuid instruction. A Cargo feature is used to enable the use of asm!.

shepmaster commented 7 years ago

Oh, wow, thank you! I'll give this a thorough read this evening and wrap my head around the new hotness.

I suppose I should also take the time to set up Appveyor tests in the near future, too!

shepmaster commented 7 years ago

One quick question: why the decision to go all assembly, instead of having a C shim with its own inline assembly?

alexcrichton commented 7 years ago

Oh no reason in particular, I just mostly had an example of this in stacker and copied most of it! I also know very little about inline assembly in C...

shepmaster commented 7 years ago

Ok, this all seems reasonable to me. I'm going to:

  1. merge this
  2. release a new version
  3. probably get AppVeyor running
  4. maybe try some C w/ inline asm (having to deal with the function prologues and epilogues by hand just scares me for maintainability)
alexcrichton commented 7 years ago

👍

Lemme know if you need any help!