diff options
Diffstat (limited to 'drivers/misc/sgi-xp/xp_sn2.c')
-rw-r--r-- | drivers/misc/sgi-xp/xp_sn2.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/misc/sgi-xp/xp_sn2.c b/drivers/misc/sgi-xp/xp_sn2.c index 1440134caf31..fb3ec9d735a9 100644 --- a/drivers/misc/sgi-xp/xp_sn2.c +++ b/drivers/misc/sgi-xp/xp_sn2.c | |||
@@ -120,6 +120,38 @@ xp_cpu_to_nasid_sn2(int cpuid) | |||
120 | return cpuid_to_nasid(cpuid); | 120 | return cpuid_to_nasid(cpuid); |
121 | } | 121 | } |
122 | 122 | ||
123 | static enum xp_retval | ||
124 | xp_expand_memprotect_sn2(unsigned long phys_addr, unsigned long size) | ||
125 | { | ||
126 | u64 nasid_array = 0; | ||
127 | int ret; | ||
128 | |||
129 | ret = sn_change_memprotect(phys_addr, size, SN_MEMPROT_ACCESS_CLASS_1, | ||
130 | &nasid_array); | ||
131 | if (ret != 0) { | ||
132 | dev_err(xp, "sn_change_memprotect(,, " | ||
133 | "SN_MEMPROT_ACCESS_CLASS_1,) failed ret=%d\n", ret); | ||
134 | return xpSalError; | ||
135 | } | ||
136 | return xpSuccess; | ||
137 | } | ||
138 | |||
139 | static enum xp_retval | ||
140 | xp_restrict_memprotect_sn2(unsigned long phys_addr, unsigned long size) | ||
141 | { | ||
142 | u64 nasid_array = 0; | ||
143 | int ret; | ||
144 | |||
145 | ret = sn_change_memprotect(phys_addr, size, SN_MEMPROT_ACCESS_CLASS_0, | ||
146 | &nasid_array); | ||
147 | if (ret != 0) { | ||
148 | dev_err(xp, "sn_change_memprotect(,, " | ||
149 | "SN_MEMPROT_ACCESS_CLASS_0,) failed ret=%d\n", ret); | ||
150 | return xpSalError; | ||
151 | } | ||
152 | return xpSuccess; | ||
153 | } | ||
154 | |||
123 | enum xp_retval | 155 | enum xp_retval |
124 | xp_init_sn2(void) | 156 | xp_init_sn2(void) |
125 | { | 157 | { |
@@ -132,6 +164,8 @@ xp_init_sn2(void) | |||
132 | xp_pa = xp_pa_sn2; | 164 | xp_pa = xp_pa_sn2; |
133 | xp_remote_memcpy = xp_remote_memcpy_sn2; | 165 | xp_remote_memcpy = xp_remote_memcpy_sn2; |
134 | xp_cpu_to_nasid = xp_cpu_to_nasid_sn2; | 166 | xp_cpu_to_nasid = xp_cpu_to_nasid_sn2; |
167 | xp_expand_memprotect = xp_expand_memprotect_sn2; | ||
168 | xp_restrict_memprotect = xp_restrict_memprotect_sn2; | ||
135 | 169 | ||
136 | return xp_register_nofault_code_sn2(); | 170 | return xp_register_nofault_code_sn2(); |
137 | } | 171 | } |