Commit 66666e50 authored by Jack Steiner's avatar Jack Steiner Committed by Linus Torvalds

sgi-gru: add macros for using the UV hub to send interrupts

Add macros for using the UV hub to send interrupts.  Change the IPI code
to use these macros.  These macros will also be used in additional patches
that will follow.
Signed-off-by: default avatarJack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c7296700
...@@ -305,5 +305,11 @@ static inline int uv_num_possible_blades(void) ...@@ -305,5 +305,11 @@ static inline int uv_num_possible_blades(void)
return 1; return 1;
} }
static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
{
/* not currently needed on ia64 */
}
#endif /* __ASM_IA64_UV_HUB__ */ #endif /* __ASM_IA64_UV_HUB__ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <asm/types.h> #include <asm/types.h>
#include <asm/percpu.h> #include <asm/percpu.h>
#include <asm/uv/uv_mmrs.h>
/* /*
...@@ -398,6 +399,7 @@ static inline void uv_set_scir_bits(unsigned char value) ...@@ -398,6 +399,7 @@ static inline void uv_set_scir_bits(unsigned char value)
uv_write_local_mmr8(uv_hub_info->scir.offset, value); uv_write_local_mmr8(uv_hub_info->scir.offset, value);
} }
} }
static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
{ {
if (uv_cpu_hub_info(cpu)->scir.state != value) { if (uv_cpu_hub_info(cpu)->scir.state != value) {
...@@ -406,5 +408,15 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) ...@@ -406,5 +408,15 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
} }
} }
static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
{
unsigned long val;
val = (1UL << UVH_IPI_INT_SEND_SHFT) |
((apicid & 0x3f) << UVH_IPI_INT_APIC_ID_SHFT) |
(vector << UVH_IPI_INT_VECTOR_SHFT);
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
}
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
#endif /* _ASM_X86_UV_UV_HUB_H */ #endif /* _ASM_X86_UV_UV_HUB_H */
...@@ -118,17 +118,12 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) ...@@ -118,17 +118,12 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
static void uv_send_IPI_one(int cpu, int vector) static void uv_send_IPI_one(int cpu, int vector)
{ {
unsigned long val, apicid; unsigned long apicid;
int pnode; int pnode;
apicid = per_cpu(x86_cpu_to_apicid, cpu); apicid = per_cpu(x86_cpu_to_apicid, cpu);
pnode = uv_apicid_to_pnode(apicid); pnode = uv_apicid_to_pnode(apicid);
uv_hub_send_ipi(pnode, apicid, vector);
val = (1UL << UVH_IPI_INT_SEND_SHFT) |
(apicid << UVH_IPI_INT_APIC_ID_SHFT) |
(vector << UVH_IPI_INT_VECTOR_SHFT);
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
} }
static void uv_send_IPI_mask(const struct cpumask *mask, int vector) static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment