Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21390
b: refs/heads/master
c: ac29c11
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Mar 20, 2006
1 parent 0842ef2 commit 4bf82b6
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e088ad7ca3d09c96e63f1ce411a2ccba2688bf25
refs/heads/master: ac29c11d4cd4fa1fac968e99998a956405732f2f
48 changes: 48 additions & 0 deletions trunk/arch/sparc64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,13 +855,61 @@ void init_irqwork_curcpu(void)
memset(__irq_work + cpu, 0, sizeof(struct irq_work_struct));
}

static void __cpuinit init_one_mondo(unsigned long *pa_ptr, unsigned long type)
{
register unsigned long func __asm__("%o0");
register unsigned long arg0 __asm__("%o1");
register unsigned long arg1 __asm__("%o2");
register unsigned long arg2 __asm__("%o3");
unsigned long page = get_zeroed_page(GFP_ATOMIC);

if (!page) {
prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
prom_halt();
}

*pa_ptr = __pa(page);

func = HV_FAST_CPU_QCONF;
arg0 = type;
arg1 = *pa_ptr;
arg2 = 128; /* XXX Implied by Niagara queue offsets. XXX */
__asm__ __volatile__("ta %8"
: "=&r" (func), "=&r" (arg0),
"=&r" (arg1), "=&r" (arg2)
: "0" (func), "1" (arg0),
"2" (arg1), "3" (arg2),
"i" (HV_FAST_TRAP));

if (func != HV_EOK) {
prom_printf("SUN4V: cpu_qconf(%lu) failed with error %lu\n",
type, func);
prom_halt();
}
}

/* Allocate and init the mondo queues for this cpu. */
void __cpuinit sun4v_init_mondo_queues(void)
{
int cpu = hard_smp_processor_id();
struct trap_per_cpu *tb = &trap_block[cpu];

init_one_mondo(&tb->cpu_mondo_pa, HV_CPU_QUEUE_CPU_MONDO);
init_one_mondo(&tb->dev_mondo_pa, HV_CPU_QUEUE_DEVICE_MONDO);
init_one_mondo(&tb->resum_mondo_pa, HV_CPU_QUEUE_RES_ERROR);
init_one_mondo(&tb->nonresum_mondo_pa, HV_CPU_QUEUE_NONRES_ERROR);
}

/* Only invoked on boot processor. */
void __init init_IRQ(void)
{
map_prom_timers();
kill_prom_timer();
memset(&ivector_table[0], 0, sizeof(ivector_table));

if (tlb_type == hypervisor)
sun4v_init_mondo_queues();

/* We need to clear any IRQ's pending in the soft interrupt
* registers, a spurious one could be left around from the
* PROM timer which we just disabled.
Expand Down
12 changes: 11 additions & 1 deletion trunk/arch/sparc64/kernel/trampoline.S
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,17 @@ do_unlock:

call init_irqwork_curcpu
nop
call init_cur_cpu_trap

sethi %hi(tlb_type), %g3
lduw [%g3 + %lo(tlb_type)], %g2
cmp %g2, 3
bne,pt %icc, 1f
nop

call sun4v_init_mondo_queues
nop

1: call init_cur_cpu_trap
nop

/* Start using proper page size encodings in ctx register. */
Expand Down

0 comments on commit 4bf82b6

Please sign in to comment.