Skip to contentSkip to conversation

function calls from identify_cpu()

DISCUSSION Kevin Diggs 2 participants 3 messages May 2, 2008 – May 3, 2008

lore
Share & tools
lore
#0 lore raw

I added:

int __init iDoNothingUseful(struct cpu_spec *s,struct cpu_spec *t)

{
        return s-t;
}

right before the definition of identify_cpu() in cputable.c and:

//                      (void) (*PTRRELOC(&iDoNothingUseful))(s,t);
                        (void) iDoNothingUseful(s,t);

right before the return s; in the match block and it will not boot? Can someone please explain what might be going on?

Thanks!

kevin

#1 lore raw
Quoted 7 lines · Kevin Diggs

I added:

int __init iDoNothingUseful(struct cpu_spec *s,struct cpu_spec *t)

{
         return s-t;
}
Quoted 7 lines

right before the definition of identify_cpu() in cputable.c and:

//                      (void) (*PTRRELOC(&iDoNothingUseful))(s,t);
                         (void) iDoNothingUseful(s,t);

right before the return s; in the match block and it will not boot? Can someone please explain what might be going on?

Why are you trying to muck around with that code in the first place ? :-)

What are you trying to achieve ?

Cheers,
Ben.

#2 lore raw
Quoted 17 lines · Benjamin Herrenschmidt
Quoted 7 lines · Kevin Diggs

I added:

int __init iDoNothingUseful(struct cpu_spec *s,struct cpu_spec *t)

{
        return s-t;
}
Quoted 6 lines

right before the definition of identify_cpu() in cputable.c and:

//                      (void) (*PTRRELOC(&iDoNothingUseful))(s,t);
                        (void) iDoNothingUseful(s,t);

right before the return s; in the match block and it will not boot? Can someone please explain what might be going on?

Quoted 8 lines

Why are you trying to muck around with that code in the first place ? :-)

What are you trying to achieve ?

Cheers,
Ben.

The original intent was to find a way to add some of the PLL parameters (min and max core frequencies, min and max bus ratios - FX 400 - 800, 2 - 20; GX 500 - 1000, 2 - 20). Initially it seemed like the place to put them. To avoid kernel bloat I think I'll just put them in the init routine of the driver. I'll have to redo the cpu detection (FX vs GX); but I guess that is not that big of a deal.

But now it is about retaining what is left of my sanity. I took the above code and added it to a GigE running the same installation (the 8600 installation was created by installing its disk in the GigE) and it ran fine!?! ANY suggestions would be greatly appreciated. Something to do with BootX? BootX is to old (1.2.4)? System needs an exorcism? I screwed up something in the 750GX cpu_spec entry?

Both are running 2.6.24.

kevin

P.S.: I would still appreciate it if someone could explain why this line:

*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;

isn't:

*PTRRELOC((&cur_cpu_spec) = PTRRELOC(&the_cpu_spec);

Is the address &the_cpu_spec valid later in the kernel initialization? Is it ... valid now?