aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-16 17:26:53 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:13:16 -0500
commit94f8762db9a80ed34252e9fe5fa38be87bb7826b (patch)
tree22279c62d2d4d583c64f1d2c6122f4eb98b429a6
parentbc45e32e0fbf661d0c5c5b9c981bc0fe5da4901f (diff)
[SPARC64]: Add sun4v_cpu_qconf() hypervisor call.
Call it from register_one_mondo(). Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/kernel/entry.S12
-rw-r--r--arch/sparc64/kernel/irq.c26
-rw-r--r--include/asm-sparc64/hypervisor.h6
3 files changed, 25 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index bf40b065bcc0..f5c8a293979f 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -1772,3 +1772,15 @@ sun4v_intr_settarget:
1772 retl 1772 retl
1773 nop 1773 nop
1774 1774
1775 /* %o0: type
1776 * %o1: queue paddr
1777 * %o2: num queue entries
1778 *
1779 * returns %o0: status
1780 */
1781 .globl sun4v_cpu_qconf
1782sun4v_cpu_qconf:
1783 mov HV_FAST_CPU_QCONF, %o5
1784 ta HV_FAST_TRAP
1785 retl
1786 nop
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 4d9931d124ab..e1729e5189a3 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -939,25 +939,13 @@ void init_irqwork_curcpu(void)
939 939
940static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type) 940static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type)
941{ 941{
942 register unsigned long func __asm__("%o5"); 942 unsigned long num_entries = 128;
943 register unsigned long arg0 __asm__("%o0"); 943 unsigned long status;
944 register unsigned long arg1 __asm__("%o1"); 944
945 register unsigned long arg2 __asm__("%o2"); 945 status = sun4v_cpu_qconf(type, paddr, num_entries);
946 946 if (status != HV_EOK) {
947 func = HV_FAST_CPU_QCONF; 947 prom_printf("SUN4V: sun4v_cpu_qconf(%lu:%lx:%lu) failed, "
948 arg0 = type; 948 "err %lu\n", type, paddr, num_entries, status);
949 arg1 = paddr;
950 arg2 = 128; /* XXX Implied by Niagara queue offsets. XXX */
951 __asm__ __volatile__("ta %8"
952 : "=&r" (func), "=&r" (arg0),
953 "=&r" (arg1), "=&r" (arg2)
954 : "0" (func), "1" (arg0),
955 "2" (arg1), "3" (arg2),
956 "i" (HV_FAST_TRAP));
957
958 if (arg0 != HV_EOK) {
959 prom_printf("SUN4V: cpu_qconf(%lu) failed with error %lu\n",
960 type, func);
961 prom_halt(); 949 prom_halt();
962 } 950 }
963} 951}
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h
index f14992ab7fec..cd5fbcd9556e 100644
--- a/include/asm-sparc64/hypervisor.h
+++ b/include/asm-sparc64/hypervisor.h
@@ -301,6 +301,12 @@
301#define HV_CPU_QUEUE_RES_ERROR 0x3e 301#define HV_CPU_QUEUE_RES_ERROR 0x3e
302#define HV_CPU_QUEUE_NONRES_ERROR 0x3f 302#define HV_CPU_QUEUE_NONRES_ERROR 0x3f
303 303
304#ifndef __ASSEMBLY__
305extern unsigned long sun4v_cpu_qconf(unsigned long type,
306 unsigned long queue_paddr,
307 unsigned long num_queue_entries);
308#endif
309
304/* cpu_qinfo() 310/* cpu_qinfo()
305 * TRAP: HV_FAST_TRAP 311 * TRAP: HV_FAST_TRAP
306 * FUNCTION: HV_FAST_CPU_QINFO 312 * FUNCTION: HV_FAST_CPU_QINFO