[PATCH 05/14] MIPS: SGI-IP27: move IP27 specific macro to IP27 specific header file

Thomas Bogendoerfer
2020-01-09T12:34:40Z

Extracting node id from HUB register is specific to IP27 alias SN0.
Move the macro definition to a SN0 header file.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
arch/mips/include/asm/mach-ip27/kernel-entry-init.h | 10 ----------
arch/mips/include/asm/sn/sn0/hub.h | 12 ++++++++++++
2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/mips/include/asm/mach-ip27/kernel-entry-init.h b/arch/mips/include/asm/mach-ip27/kernel-entry-init.h
index ef31d9fcf806..3e54f605a70b 100644
--- a/arch/mips/include/asm/mach-ip27/kernel-entry-init.h
+++ b/arch/mips/include/asm/mach-ip27/kernel-entry-init.h
@@ -13,16 +13,6 @@
#include <asm/sn/agent.h>
#include <asm/sn/klkernvars.h>

-/*
- * Returns the local nasid into res.
- */
- .macro GET_NASID_ASM res
- dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
- ld \res, (\res)
- and \res, NSRI_NODEID_MASK
- dsrl \res, NSRI_NODEID_SHFT
- .endm
-
/*
* TLB bits
*/
diff --git a/arch/mips/include/asm/sn/sn0/hub.h b/arch/mips/include/asm/sn/sn0/hub.h
index d78dd76d5dcf..82cadd785b9c 100644
--- a/arch/mips/include/asm/sn/sn0/hub.h
+++ b/arch/mips/include/asm/sn/sn0/hub.h
@@ -37,4 +37,16 @@
#define UATTR_MSPEC 2
#define UATTR_UNCAC 3

+#ifdef __ASSEMBLY__
+/*
+ * Returns the local nasid into res.
+ */
+ .macro GET_NASID_ASM res
+ dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
+ ld \res, (\res)
+ and \res, NSRI_NODEID_MASK
+ dsrl \res, NSRI_NODEID_SHFT
+ .endm
+#endif
+
#endif /* _ASM_SN_SN0_HUB_H */
--
2.24.1