From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Herrmann Subject: [PATCH 07/15] MIPS: Add mips_cpunum() function. Date: Tue, 20 May 2014 16:47:08 +0200 Message-ID: <1400597236-11352-8-git-send-email-andreas.herrmann@caviumnetworks.com> References: <1400597236-11352-1-git-send-email-andreas.herrmann@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: David Daney , Andreas Herrmann , Ralf Baechle , James Hogan , , David Daney To: Return-path: Received: from mail-bl2lp0211.outbound.protection.outlook.com ([207.46.163.211]:33468 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752976AbaETOtN (ORCPT ); Tue, 20 May 2014 10:49:13 -0400 In-Reply-To: <1400597236-11352-1-git-send-email-andreas.herrmann@caviumnetworks.com> Sender: kvm-owner@vger.kernel.org List-ID: From: David Daney This returns the CPUNum from the low order Ebase bits. Signed-off-by: David Daney Signed-off-by: Andreas Herrmann --- arch/mips/include/asm/mipsregs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 3e025b5..f110d48 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -1916,6 +1916,11 @@ __BUILD_SET_C0(brcm_cmt_ctrl) __BUILD_SET_C0(brcm_config) __BUILD_SET_C0(brcm_mode) +static inline unsigned int mips_cpunum(void) +{ + return read_c0_ebase() & 0x3ff; /* Low 10 bits of ebase. */ +} + #endif /* !__ASSEMBLY__ */ #endif /* _ASM_MIPSREGS_H */ -- 1.7.9.5