lkml.org 
[lkml]   [2006]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH for review] [26/145] x86_64: Add initalization of the RDTSCP auxilliary values
Date

> > +static int __cpuinit
> > +time_cpu_notifier(struct notifier_block *nb, unsigned long action, void *hcpu)
> > {
> > - char *timename;
> > - char *gtod;
> > + unsigned cpu = (unsigned long) hcpu;
>
> Is this some kind of "endian magic" ? I mean getting high or low word of 64
> pointer to 32 variable ? Why cast just with (unsigned) doesn't work ?

This is just to avoid a warning from gcc that a pointer is converted
to a 32bit integer -- which is ok here since it uses a "void *" callback argument
to pass an integer.

Arguably there should be a standard macro for this construct, but there
isn't currently.

>
> > + if (action == CPU_ONLINE &&
> > + cpu_has(&cpu_data[cpu], X86_FEATURE_RDTSCP)) {
> > + unsigned p;
> > + p = smp_processor_id() | (cpu_to_node(smp_processor_id())<<12);
>
> Is this code runs under SMP ? I couldn't figure that out.

Yes it is. It handles additional CPUs.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-11 06:15    [W:0.042 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site