aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/sn/arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/sn/arch.h')
-rw-r--r--include/asm-mips/sn/arch.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/asm-mips/sn/arch.h b/include/asm-mips/sn/arch.h
new file mode 100644
index 000000000000..d247a819de7f
--- /dev/null
+++ b/include/asm-mips/sn/arch.h
@@ -0,0 +1,66 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * SGI specific setup.
7 *
8 * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 */
11#ifndef _ASM_SN_ARCH_H
12#define _ASM_SN_ARCH_H
13
14#include <linux/config.h>
15#include <linux/types.h>
16#include <asm/sn/types.h>
17#ifdef CONFIG_SGI_IP27
18#include <asm/sn/sn0/arch.h>
19#endif
20
21typedef u64 hubreg_t;
22typedef u64 nic_t;
23
24#define cputonasid(cpu) (cpu_data[(cpu)].p_nasid)
25#define cputoslice(cpu) (cpu_data[(cpu)].p_slice)
26#define makespnum(_nasid, _slice) \
27 (((_nasid) << CPUS_PER_NODE_SHFT) | (_slice))
28
29#define INVALID_NASID (nasid_t)-1
30#define INVALID_CNODEID (cnodeid_t)-1
31#define INVALID_PNODEID (pnodeid_t)-1
32#define INVALID_MODULE (moduleid_t)-1
33#define INVALID_PARTID (partid_t)-1
34
35extern nasid_t get_nasid(void);
36extern cnodeid_t get_cpu_cnode(cpuid_t);
37extern int get_cpu_slice(cpuid_t);
38
39/*
40 * NO ONE should access these arrays directly. The only reason we refer to
41 * them here is to avoid the procedure call that would be required in the
42 * macros below. (Really want private data members here :-)
43 */
44extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
45extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
46
47/*
48 * These macros are used by various parts of the kernel to convert
49 * between the three different kinds of node numbering. At least some
50 * of them may change to procedure calls in the future, but the macros
51 * will continue to work. Don't use the arrays above directly.
52 */
53
54#define NASID_TO_REGION(nnode) \
55 ((nnode) >> \
56 (is_fine_dirmode() ? NASID_TO_FINEREG_SHFT : NASID_TO_COARSEREG_SHFT))
57
58extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
59extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
60extern cnodeid_t cpuid_to_compact_node[MAXCPUS];
61
62#define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode])
63#define COMPACT_TO_NASID_NODEID(cnode) (compact_to_nasid_node[cnode])
64#define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_compact_node[(cpu)])
65
66#endif /* _ASM_SN_ARCH_H */