Would you mind explain the get_current() for Power?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
%0 means the first operand used, and this starts counting at the output operands
in this example only one output operand is available so this is %0
only one input operand is used so this gets %1
when there would have been two output operands these would get %0 %1 as index
and the only input operand would get %2 as index
"=r" this modifier says that it is the output operand and is write-only ("="), and use an "r" register for this value
"i" means use an i type register for this value
(don't exactly know the internals of power-pc so correct me if i'm wrong)
Hope this explanation is clear, this is also mentioned in the GCC howto.
Registers, Register names etc., And how the compiler uses them is architecture specific and you should try to search for technical reference manuals of your architecture.
In the howto posted by nini09, "i" means:
"i" : An immediate integer operand (one with constant value) is allowed. This includes symbolic constants whose values will be known only at assembly time.
I think this has the same meaning for Power.
So there is no specific gcc inline asm syntax for Power architecture, at least it is not popular?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.