lkml.org 
[lkml]   [2001]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] take 2 of the tr-based current
"David S. Miller" wrote:
>
> From: Manfred Spraul <manfred@colorfullife.com>
> Date: Fri, 09 Nov 2001 15:54:03 +0100
>
> Jakub Jelinek wrote:
> > If TR register only ever changes during cpu_init, I don't see why you
> > cannot use const.
>
> The task register is only pure, not const.
>
> As far as what the compiler can see or care about, it is
> const.
>
No. const == never changes.
get_TR changes if a task calls schedule, and return on another cpu.

<<<
+static unsigned get_TR(void) __attribute__ ((pure))
+{
+ unsigned tr;
+ __asm__("str %w0" : "=g" (tr));
+ return tr;
+}
+
+#define smp_processor_id() ( ((get_TR() >> 3) - __FIRST_TSS_ENTRY)
>> 2 )
<<<
smp_processor_id() is definitively not const.

OTHO 'current' is const.
--
Manfred
-
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: 2005-03-22 13:13    [W:0.085 / U:13.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site