Clean up the intr* MD KPI from the SMP dependency, removing a cause of
discrepancy between modules and kernel, but deal with SMP differences within the functions themselves. As an added bonus this also helps in terms of code readability. Requested by: gibbs Reviewed by: jhb, marius MFC after: 1 week
This commit is contained in:
parent
a1cd9c816d
commit
70dbd1604c
@ -296,12 +296,10 @@ cpu_startup(dummy)
|
||||
|
||||
cpu_setregs();
|
||||
|
||||
#ifdef SMP
|
||||
/*
|
||||
* Add BSP as an interrupt target.
|
||||
*/
|
||||
intr_add_cpu(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -140,15 +140,11 @@ int elcr_probe(void);
|
||||
enum intr_trigger elcr_read_trigger(u_int irq);
|
||||
void elcr_resume(void);
|
||||
void elcr_write_trigger(u_int irq, enum intr_trigger trigger);
|
||||
#ifdef SMP
|
||||
void intr_add_cpu(u_int cpu);
|
||||
#endif
|
||||
int intr_add_handler(const char *name, int vector, driver_filter_t filter,
|
||||
driver_intr_t handler, void *arg, enum intr_type flags,
|
||||
void **cookiep);
|
||||
#ifdef SMP
|
||||
int intr_bind(u_int vector, u_char cpu);
|
||||
#endif
|
||||
int intr_config_intr(int vector, enum intr_trigger trig,
|
||||
enum intr_polarity pol);
|
||||
int intr_describe(u_int vector, void *ih, const char *descr);
|
||||
|
@ -337,12 +337,10 @@ cpu_startup(dummy)
|
||||
cpu_setregs();
|
||||
#endif
|
||||
|
||||
#ifdef SMP
|
||||
/*
|
||||
* Add BSP as an interrupt target.
|
||||
*/
|
||||
intr_add_cpu(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -131,14 +131,10 @@ int elcr_probe(void);
|
||||
enum intr_trigger elcr_read_trigger(u_int irq);
|
||||
void elcr_resume(void);
|
||||
void elcr_write_trigger(u_int irq, enum intr_trigger trigger);
|
||||
#ifdef SMP
|
||||
void intr_add_cpu(u_int cpu);
|
||||
#endif
|
||||
int intr_add_handler(const char *name, int vector, driver_filter_t filter,
|
||||
driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
|
||||
#ifdef SMP
|
||||
int intr_bind(u_int vector, u_char cpu);
|
||||
#endif
|
||||
int intr_config_intr(int vector, enum intr_trigger trig,
|
||||
enum intr_polarity pol);
|
||||
int intr_describe(u_int vector, void *ih, const char *descr);
|
||||
|
@ -272,12 +272,10 @@ cpu_startup(dummy)
|
||||
vm_pager_bufferinit();
|
||||
cpu_setregs();
|
||||
|
||||
#ifdef SMP
|
||||
/*
|
||||
* Add BSP as an interrupt target.
|
||||
*/
|
||||
intr_add_cpu(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -91,9 +91,7 @@ struct intr_vector {
|
||||
extern ih_func_t *intr_handlers[];
|
||||
extern struct intr_vector intr_vectors[];
|
||||
|
||||
#ifdef SMP
|
||||
void intr_add_cpu(u_int cpu);
|
||||
#endif
|
||||
int intr_bind(int vec, u_char cpu);
|
||||
int intr_describe(int vec, void *ih, const char *descr);
|
||||
void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
|
||||
|
@ -554,4 +554,20 @@ intr_shuffle_irqs(void *arg __unused)
|
||||
}
|
||||
SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs,
|
||||
NULL);
|
||||
#else /* !SMP */
|
||||
|
||||
/* Return EOPNOTSUPP in the UP case. */
|
||||
int
|
||||
intr_bind(int vec __unused, u_char cpu __unused)
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/* Use an empty stub for compatibility. */
|
||||
void
|
||||
intr_add_cpu(u_int cpu __unused)
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -197,12 +197,10 @@ cpu_startup(void *arg)
|
||||
|
||||
cpu_identify(rdpr(ver), PCPU_GET(clock), curcpu);
|
||||
|
||||
#ifdef SMP
|
||||
/*
|
||||
* Add BSP as an interrupt target.
|
||||
*/
|
||||
intr_add_cpu(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -565,4 +565,19 @@ intr_next_cpu(void)
|
||||
|
||||
return (PCPU_GET(apic_id));
|
||||
}
|
||||
|
||||
/* Return EOPNOTSUPP in the UP case. */
|
||||
int
|
||||
intr_bind(u_int vector __unused, u_char cpu __unused)
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/* Use an empty stub for compatibility. */
|
||||
void
|
||||
intr_add_cpu(u_int cpu __unused)
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user