lkml.org 
[lkml]   [2006]   [Aug]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromAndi Kleen <>
SubjectRe: [PATCH for review] [26/145] x86_64: Add initalization of the RDTSCP auxilliary values
DateFri, 11 Aug 2006 06:09:35 +0200
>  > +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 04:15    [from the cache]
©2003-2008