#define __INTR_PRIVATE
#define __INTR_NOINLINE
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr_stubs.c,v 1.7 2020/07/06 09:34:18 rin Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
#include <sys/intr.h>
static int
null_splraise(int ipl)
{
int cpl = curcpu()->ci_cpl;
curcpu()->ci_cpl = ipl;
return cpl;
}
static void
null_splx(int ipl)
{
curcpu()->ci_cpl = ipl;
}
static const struct intrsw null_intrsw = {
.intrsw_splraise = null_splraise,
.intrsw_splx = null_splx,
};
const struct intrsw *powerpc_intrsw = &null_intrsw;
#define __stub __section(".stub") __noprofile
void *intr_establish(int, int, int, int (*)(void *), void *) __noprofile;
void *
intr_establish(int irq, int ipl, int ist, int (*func)(void *), void *arg)
{
return (*powerpc_intrsw->intrsw_establish)(irq, ipl, ist, func, arg,
NULL);
}
void *intr_establish_xname(int, int, int, int (*)(void *), void *,
const char *) __stub;
void *
intr_establish_xname(int irq, int ipl, int ist, int (*func)(void *), void *arg,
const char *xname)
{
return (*powerpc_intrsw->intrsw_establish)(irq, ipl, ist, func, arg,
xname);
}
void intr_disestablish(void *) __stub;
void
intr_disestablish(void *ih)
{
(*powerpc_intrsw->intrsw_disestablish)(ih);
}
const char *intr_string(int, int, char *, size_t) __stub;
const char *
intr_string(int irq, int ist, char *buf, size_t len)
{
return (*powerpc_intrsw->intrsw_string)(irq, ist, buf, len);
}
void spl0(void) __stub;
void
spl0(void)
{
(*powerpc_intrsw->intrsw_spl0)();
}
int splraise(int) __stub;
int
splraise(int ipl)
{
return (*powerpc_intrsw->intrsw_splraise)(ipl);
}
int
splhigh(void)
{
return splraise(IPL_HIGH);
}
void splx(int) __stub;
void
splx(int ipl)
{
return (*powerpc_intrsw->intrsw_splx)(ipl);
}
#ifdef __HAVE_FAST_SOFTINTS
void softint_init_md(struct lwp *, u_int, uintptr_t *) __stub;
void
softint_init_md(struct lwp *l, u_int level, uintptr_t *machdep_p)
{
(*powerpc_intrsw->intrsw_softint_init_md)(l, level, machdep_p);
}
void softint_trigger(uintptr_t) __stub;
void
softint_trigger(uintptr_t machdep)
{
(*powerpc_intrsw->intrsw_softint_trigger)(machdep);
}
#endif
void intr_cpu_attach(struct cpu_info *) __stub;
void
intr_cpu_attach(struct cpu_info *ci)
{
(*powerpc_intrsw->intrsw_cpu_attach)(ci);
}
void intr_cpu_hatch(struct cpu_info *) __stub;
void
intr_cpu_hatch(struct cpu_info *ci)
{
(*powerpc_intrsw->intrsw_cpu_hatch)(ci);
}
void intr_init(void) __stub;
void
intr_init(void)
{
(*powerpc_intrsw->intrsw_init)();
}
void intr_critintr(struct trapframe *) __stub;
void
intr_critintr(struct trapframe *tf)
{
(*powerpc_intrsw->intrsw_critintr)(tf);
}
void intr_extintr(struct trapframe *) __stub;
void
intr_extintr(struct trapframe *tf)
{
(*powerpc_intrsw->intrsw_extintr)(tf);
}
void intr_decrintr(struct trapframe *) __stub;
void
intr_decrintr(struct trapframe *tf)
{
(*powerpc_intrsw->intrsw_decrintr)(tf);
}
void intr_fitintr(struct trapframe *) __stub;
void
intr_fitintr(struct trapframe *tf)
{
(*powerpc_intrsw->intrsw_fitintr)(tf);
}
void intr_wdogintr(struct trapframe *) __stub;
void
intr_wdogintr(struct trapframe *tf)
{
(*powerpc_intrsw->intrsw_wdogintr)(tf);
}
void cpu_send_ipi(cpuid_t, uint32_t) __stub;
void
cpu_send_ipi(cpuid_t id, uint32_t mask)
{
(*powerpc_intrsw->intrsw_cpu_send_ipi)(id, mask);
}