Subject: Re: Simple question about powerpc kernel source.

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 21 Jul 2009 10:23:46 +1000

On Tue, 2009-07-21 at 09:15 +0900, HongWoo Lee wrote:
> First, I aleady understood about @highest, @higher, @h and @l. 
> For now, what I want to know is about "##" in the below code. 
> 
> #define LOADADDR(rn,name)           \
>     lis     rn,name##@highest;      \
>     ori     rn,rn,name##@higher;    \
>     rldicr  rn,rn,32,31;            \
>     oris    rn,rn,name##@h;         \
>     ori     rn,rn,name##@l
> 
> And I don't want to ask every detail. 
> So I want to know the manual or document which describes the detail. 

Well, it's just concatenation...

Ie, if you do LOADADDR(rn, .myfunction) it will turn to

   lis     rn,.myfunction@highest;
   ori     rn,rn,.myfunction@higher;
   rldicr  rn,rn,32,31;
   oris    rn,rn,.myfunction@h;
   ori     rn,rn,.myfunction@l
Which means putting the address of .myfunction into register rn.

Cheers,
Ben.