| .. | .. |
|---|
| 16 | 16 | #include <asm/sn/types.h> |
|---|
| 17 | 17 | #include <asm/sn/arch.h> |
|---|
| 18 | 18 | #include <asm/sn/gda.h> |
|---|
| 19 | | -#include <asm/sn/hub.h> |
|---|
| 20 | 19 | #include <asm/sn/mapped_kernel.h> |
|---|
| 21 | | -#include <asm/sn/sn_private.h> |
|---|
| 22 | 20 | |
|---|
| 23 | | -static cpumask_t ktext_repmask; |
|---|
| 21 | +#include "ip27-common.h" |
|---|
| 22 | + |
|---|
| 23 | +static nodemask_t ktext_repmask; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | /* |
|---|
| 26 | 26 | * XXX - This needs to be much smarter about where it puts copies of the |
|---|
| .. | .. |
|---|
| 30 | 30 | void __init setup_replication_mask(void) |
|---|
| 31 | 31 | { |
|---|
| 32 | 32 | /* 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); |
|---|
| 35 | 35 | |
|---|
| 36 | 36 | #ifdef CONFIG_REPLICATE_KTEXT |
|---|
| 37 | 37 | #ifndef CONFIG_MAPPED_KERNEL |
|---|
| 38 | 38 | #error Kernel replication works with mapped kernel support. No calias support. |
|---|
| 39 | 39 | #endif |
|---|
| 40 | 40 | { |
|---|
| 41 | | - cnodeid_t cnode; |
|---|
| 41 | + nasid_t nasid; |
|---|
| 42 | 42 | |
|---|
| 43 | | - for_each_online_node(cnode) { |
|---|
| 44 | | - if (cnode == 0) |
|---|
| 43 | + for_each_online_node(nasid) { |
|---|
| 44 | + if (nasid == 0) |
|---|
| 45 | 45 | continue; |
|---|
| 46 | 46 | /* Advertise that we have a copy of the kernel */ |
|---|
| 47 | | - cpumask_set_cpu(cnode, &ktext_repmask); |
|---|
| 47 | + node_set(nasid, ktext_repmask); |
|---|
| 48 | 48 | } |
|---|
| 49 | 49 | } |
|---|
| 50 | 50 | #endif |
|---|
| .. | .. |
|---|
| 85 | 85 | |
|---|
| 86 | 86 | void __init replicate_kernel_text(void) |
|---|
| 87 | 87 | { |
|---|
| 88 | | - cnodeid_t cnode; |
|---|
| 89 | 88 | nasid_t client_nasid; |
|---|
| 90 | 89 | nasid_t server_nasid; |
|---|
| 91 | 90 | |
|---|
| .. | .. |
|---|
| 94 | 93 | /* Record where the master node should get its kernel text */ |
|---|
| 95 | 94 | set_ktext_source(master_nasid, master_nasid); |
|---|
| 96 | 95 | |
|---|
| 97 | | - for_each_online_node(cnode) { |
|---|
| 98 | | - if (cnode == 0) |
|---|
| 96 | + for_each_online_node(client_nasid) { |
|---|
| 97 | + if (client_nasid == 0) |
|---|
| 99 | 98 | continue; |
|---|
| 100 | | - client_nasid = COMPACT_TO_NASID_NODEID(cnode); |
|---|
| 101 | 99 | |
|---|
| 102 | 100 | /* 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)) { |
|---|
| 104 | 102 | server_nasid = client_nasid; |
|---|
| 105 | 103 | copy_kernel(server_nasid); |
|---|
| 106 | 104 | } |
|---|
| .. | .. |
|---|
| 115 | 113 | * data structures on the first couple of pages of the first slot of each |
|---|
| 116 | 114 | * node. If this is the case, getfirstfree(node) > getslotstart(node, 0). |
|---|
| 117 | 115 | */ |
|---|
| 118 | | -unsigned long node_getfirstfree(cnodeid_t cnode) |
|---|
| 116 | +unsigned long node_getfirstfree(nasid_t nasid) |
|---|
| 119 | 117 | { |
|---|
| 120 | 118 | unsigned long loadbase = REP_BASE; |
|---|
| 121 | | - nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); |
|---|
| 122 | 119 | unsigned long offset; |
|---|
| 123 | 120 | |
|---|
| 124 | 121 | #ifdef CONFIG_MAPPED_KERNEL |
|---|
| 125 | 122 | loadbase += 16777216; |
|---|
| 126 | 123 | #endif |
|---|
| 127 | 124 | 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))) |
|---|
| 129 | 126 | return TO_NODE(nasid, offset) >> PAGE_SHIFT; |
|---|
| 130 | 127 | else |
|---|
| 131 | 128 | return KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> PAGE_SHIFT; |
|---|