hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/mips/sgi-ip27/ip27-klnuma.c
....@@ -16,11 +16,11 @@
1616 #include <asm/sn/types.h>
1717 #include <asm/sn/arch.h>
1818 #include <asm/sn/gda.h>
19
-#include <asm/sn/hub.h>
2019 #include <asm/sn/mapped_kernel.h>
21
-#include <asm/sn/sn_private.h>
2220
23
-static cpumask_t ktext_repmask;
21
+#include "ip27-common.h"
22
+
23
+static nodemask_t ktext_repmask;
2424
2525 /*
2626 * XXX - This needs to be much smarter about where it puts copies of the
....@@ -30,21 +30,21 @@
3030 void __init setup_replication_mask(void)
3131 {
3232 /* Set only the master cnode's bit. The master cnode is always 0. */
33
- cpumask_clear(&ktext_repmask);
34
- cpumask_set_cpu(0, &ktext_repmask);
33
+ nodes_clear(ktext_repmask);
34
+ node_set(0, ktext_repmask);
3535
3636 #ifdef CONFIG_REPLICATE_KTEXT
3737 #ifndef CONFIG_MAPPED_KERNEL
3838 #error Kernel replication works with mapped kernel support. No calias support.
3939 #endif
4040 {
41
- cnodeid_t cnode;
41
+ nasid_t nasid;
4242
43
- for_each_online_node(cnode) {
44
- if (cnode == 0)
43
+ for_each_online_node(nasid) {
44
+ if (nasid == 0)
4545 continue;
4646 /* Advertise that we have a copy of the kernel */
47
- cpumask_set_cpu(cnode, &ktext_repmask);
47
+ node_set(nasid, ktext_repmask);
4848 }
4949 }
5050 #endif
....@@ -85,7 +85,6 @@
8585
8686 void __init replicate_kernel_text(void)
8787 {
88
- cnodeid_t cnode;
8988 nasid_t client_nasid;
9089 nasid_t server_nasid;
9190
....@@ -94,13 +93,12 @@
9493 /* Record where the master node should get its kernel text */
9594 set_ktext_source(master_nasid, master_nasid);
9695
97
- for_each_online_node(cnode) {
98
- if (cnode == 0)
96
+ for_each_online_node(client_nasid) {
97
+ if (client_nasid == 0)
9998 continue;
100
- client_nasid = COMPACT_TO_NASID_NODEID(cnode);
10199
102100 /* Check if this node should get a copy of the kernel */
103
- if (cpumask_test_cpu(cnode, &ktext_repmask)) {
101
+ if (node_isset(client_nasid, ktext_repmask)) {
104102 server_nasid = client_nasid;
105103 copy_kernel(server_nasid);
106104 }
....@@ -115,17 +113,16 @@
115113 * data structures on the first couple of pages of the first slot of each
116114 * node. If this is the case, getfirstfree(node) > getslotstart(node, 0).
117115 */
118
-unsigned long node_getfirstfree(cnodeid_t cnode)
116
+unsigned long node_getfirstfree(nasid_t nasid)
119117 {
120118 unsigned long loadbase = REP_BASE;
121
- nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
122119 unsigned long offset;
123120
124121 #ifdef CONFIG_MAPPED_KERNEL
125122 loadbase += 16777216;
126123 #endif
127124 offset = PAGE_ALIGN((unsigned long)(&_end)) - loadbase;
128
- if ((cnode == 0) || (cpumask_test_cpu(cnode, &ktext_repmask)))
125
+ if ((nasid == 0) || (node_isset(nasid, ktext_repmask)))
129126 return TO_NODE(nasid, offset) >> PAGE_SHIFT;
130127 else
131128 return KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> PAGE_SHIFT;