linux-mips
[Top] [All Lists]

[PATCH] MIPS: fix tc_id calculation

To: linux-mips@linux-mips.org
Subject: [PATCH] MIPS: fix tc_id calculation
From: roy.qing.li@gmail.com
Date: Mon, 2 Jul 2012 12:34:30 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=nQwYUgQd5HVDNRB1k3UgWX84MrCbzHT5HBbCA2c9wUw=; b=VdE0DlgUn6XtOYBrDu6xmoRncFAkC4nIUKTbdNCur6sDpLoiyDrvCpmsTN1BjIP8gO smV17Lc2HFCBdjBiaC5/IkK0yU7kO3gUs5RbCMGmeOcyYQXIvaR1AGUDZuR/DD0D+ZPD 1MhiI4RPD0JC18uvjzbfk4CTTbAFKuWLv31jYw5GcU/8hya0JxPzgFgUXrRyhqF8rk86 c7rgGv+fle01bvhvYz4jWOtZWwmYFBxcM15/xyXEcBg4H6iQblVaosz9CGNNB+u/NJx6 eJkroOQHW+M1XTl0O1FbX5eGo0VRbmOUzAQQT+RZuPSCKhDWXZIU+TJ564Evd0BqAV91 ddSA==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Sender: linux-mips-bounce@linux-mips.org
From: RongQing.Li <roy.qing.li@gmail.com>

Now the tc_id is:
  (read_c0_tcbind() >> TCBIND_CURTC_SHIFT) & TCBIND_CURTC;
After substitute macro:
  (read_c0_tcbind() >> 21) & ((0xff) << 21)
It should be:
  (read_c0_tcbind() & ((0xff)<< 21)) >>21

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
 arch/mips/kernel/smp-cmp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index e7e03ec..afc379c 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -102,7 +102,7 @@ static void cmp_init_secondary(void)
        c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE;
 #endif
 #ifdef CONFIG_MIPS_MT_SMTC
-       c->tc_id  = (read_c0_tcbind() >> TCBIND_CURTC_SHIFT) & TCBIND_CURTC;
+       c->tc_id  = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT;
 #endif
 }
 
-- 
1.7.1


<Prev in Thread] Current Thread [Next in Thread>