[PATCH 5/16] hypervisor functions for Celleb

Jimi Xenidis jimix at watson.ibm.com
Fri Nov 17 05:40:49 EST 2006


On Nov 15, 2006, at 5:04 PM, Arnd Bergmann wrote:

> On Wednesday 15 November 2006 19:37, Christoph Hellwig wrote:
>>> +static inline int64_t beat_allocate_memory(uint64_t __in0, uint64_t
>>> __in1, uint64_t __in2, uint64_t __in3,void** __out0,uint64_t*  
>>> __out1) {
>>> +     register uint64_t __reg0 __asm__("r3");
>>> +     register uint64_t __reg1 __asm__("r4");
>>> +     register uint64_t __reg2 __asm__("r5");
>>> +     register uint64_t __reg3 __asm__("r6");
>>> +     register uint64_t __sn __asm__("r11") = (0UL);
>>
>> No point in declaring this a register variable, gcc ignores the
>> specifier.
>
> Actually, this is the one place where gcc forces you to use the
> 'register' keyword, the '__asm__("r3")' specifier does not work
> for variables declared without it.
>
>> Is there any chance to not duplicate the inline assembly
>> for every single hypercall but have generic call with n arguments
>> helper, as for the phyp hvcalls?
>
> It's not easy to do it the way phyp does, because the assembly
> needs to pass the call number in %r11, which is not one of the
> argument registers.
>
Just make another one (or a set of them like the phyp calls) and  
define then in assembly.
Certainly a bl to a function will be negligible to the hcall its self.

Is it possible to give the parameters some meaningful names?
It would also be nice to use HMT_MEDIUM and HVSC

-JX



More information about the Linuxppc-dev mailing list