Re: gcc inline assembler - filling a structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincent De Groote <list.encelade@xxxxxxxxx> writes:

> I would like to execute the cpuid instruction on a x86
>
> So I declared
>
> typedef unsigned long int register_t;
>
> struct response_t {
>   register_t eax;
>   register_t ebx;
>    register_t ecx;
>    register_t edx;
> };
>
> void cpuid ( register_t command, struct response_t * response )  {
>
> ...
>
> }
>
> How can I, in assembler, assign the value of a register (for example
> ebx) to the response->ebx field ?

The gcc sources call cpuid themselves.  Look at gcc/config/i386/cpuid.h
for examples.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux