Skip to contentSkip to conversation

Simple question about powerpc kernel source.

DISCUSSION HongWoo Lee 2 participants 4 messages Jul 20, 2009 – Jul 21, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

I have something to ask for the ppc kernel source.

#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

Is ## used for concatenation. I'm not sure because it is just meaningless. If so what on earth is the result of concatenating ?

And is there a good reference to understand powerpc asm ? I'm reading Power ISA, but I can't find @highest, @higher and ##. It would be good to know the reference book.

Thanks in advance.

Regards,
HongWoo.

#1 lore raw
Quoted 9 lines · HongWoo Lee

Hi all,

I have something to ask for the ppc kernel source.

#define LOADADDR(rn,name)           \
    lis     rn,name##@highest;      \
    ori     rn,rn,name##@higher;    \
    rldicr  rn,rn,32,31;            \
    oris    rn,rn,name##@h;         \
Quoted 8 lines

ori rn,rn,name##@l

Is ## used for concatenation. I'm not sure because it is just meaningless. If so what on earth is the result of concatenating ?

And is there a good reference to understand powerpc asm ? I'm reading Power ISA, but I can't find @highest, @higher and ##. It would be good to know the reference book.

You already asked pretty much the same question with the subject "Simple question about powerpc asm" and it was already replied to.

Cheers,
Ben.

#2 lore raw

-------- Original Message --------
Subject: Re: Simple question about powerpc kernel source.
From: Benjamin Herrenschmidt <[email protected]>
To: HongWoo Lee <[email protected]>
Cc: [email protected]
Date: Mon Jul 20 2009 19:02:38 GMT+0900

Quoted 21 lines · HongWoo Lee
Quoted 10 lines

Hi all,

I have something to ask for the ppc kernel source.

#define LOADADDR(rn,name)           \
    lis     rn,name##@highest;      \
    ori     rn,rn,name##@higher;    \
    rldicr  rn,rn,32,31;            \
    oris    rn,rn,name##@h;         \
Quoted 9 lines

ori rn,rn,name##@l

Is ## used for concatenation. I'm not sure because it is just meaningless. If so what on earth is the result of concatenating ?

And is there a good reference to understand powerpc asm ? I'm reading Power ISA, but I can't find @highest, @higher and ##. It would be good to know the reference book.

Quoted 8 lines

You already asked pretty much the same question with the subject "Simple question about powerpc asm" and it was already replied to.

Cheers,
Ben.

Thank you, Ben.

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.

Regards,
HongWoo.

#3 lore raw
Quoted 8 lines · HongWoo Lee

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;         \
Quoted 4 lines

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
Quoted 1 line

Which means putting the address of .myfunction into register rn.

Cheers,
Ben.