From: Sepherosa Ziehau Date: Wed, 4 May 2011 03:26:00 +0000 (+0800) Subject: i386: Move ioapic function declarations from smp.h to apic/ioapic.h X-Git-Tag: v2.12.0~687 X-Git-Url: https://gitweb.dragonflybsd.org/~nant/dragonfly.git/commitdiff_plain/4298586ae54d29d8aa73f0ab00f7467dea230448 i386: Move ioapic function declarations from smp.h to apic/ioapic.h --- diff --git a/sys/platform/pc32/apic/ioapic.c b/sys/platform/pc32/apic/ioapic.c index 4204a0757f..235126a724 100644 --- a/sys/platform/pc32/apic/ioapic.c +++ b/sys/platform/pc32/apic/ioapic.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/platform/pc32/apic/ioapic.h b/sys/platform/pc32/apic/ioapic.h new file mode 100644 index 0000000000..f680c4148c --- /dev/null +++ b/sys/platform/pc32/apic/ioapic.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 1996, by Steve Passe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. The name of the developer may NOT be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/include/mpapic.h,v 1.14.2.2 2000/09/30 02:49:34 ps Exp $ + * $DragonFly: src/sys/platform/pc32/apic/mpapic.h,v 1.12 2008/06/07 11:37:23 mneumann Exp $ + */ + +#ifndef _ARCH_APIC_IOAPIC_H_ +#define _ARCH_APIC_IOAPIC_H_ + +#ifndef _SYS_BUS_H_ +#include +#endif + +#ifndef _SYS_QUEUE_H_ +#include +#endif + +u_int ioapic_read(volatile void *, int); +void ioapic_write(volatile void *, int, u_int); + +struct ioapic_enumerator { + int ioapic_prio; + TAILQ_ENTRY(ioapic_enumerator) ioapic_link; + int (*ioapic_probe)(struct ioapic_enumerator *); + void (*ioapic_enumerate)(struct ioapic_enumerator *); +}; + +#define IOAPIC_ENUM_PRIO_MPTABLE 20 +#define IOAPIC_ENUM_PRIO_MADT 40 + +void ioapic_config(void); +void ioapic_enumerator_register(struct ioapic_enumerator *); +void ioapic_add(void *, int, int); +void ioapic_intsrc(int, int, enum intr_trigger, enum intr_polarity); +void *ioapic_gsi_ioaddr(int); +int ioapic_gsi_pin(int); +void ioapic_pin_setup(void *, int, int, + enum intr_trigger, enum intr_polarity); +void ioapic_extpin_setup(void *, int, int); +int ioapic_extpin_gsi(void); +int ioapic_gsi(int, int); + +#endif /* !_ARCH_APIC_IOAPIC_H_ */ diff --git a/sys/platform/pc32/apic/ioapic_abi.c b/sys/platform/pc32/apic/ioapic_abi.c index 9b82a08521..2bf2c5f981 100644 --- a/sys/platform/pc32/apic/ioapic_abi.c +++ b/sys/platform/pc32/apic/ioapic_abi.c @@ -51,12 +51,13 @@ #include #include #include -#include #include #include +#include #include +#include #include #include diff --git a/sys/platform/pc32/i386/mp_machdep.c b/sys/platform/pc32/i386/mp_machdep.c index ba30820d6c..6d70f22a07 100644 --- a/sys/platform/pc32/i386/mp_machdep.c +++ b/sys/platform/pc32/i386/mp_machdep.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/platform/pc32/include/smp.h b/sys/platform/pc32/include/smp.h index 32bf4214b9..60f9955f96 100644 --- a/sys/platform/pc32/include/smp.h +++ b/sys/platform/pc32/include/smp.h @@ -57,10 +57,6 @@ extern volatile cpumask_t started_cpus; extern volatile u_int checkstate_probed_cpus; extern void (*cpustop_restartfunc) (void); -/* functions in apic_ipl.s */ -u_int ioapic_read (volatile void *, int); -void ioapic_write (volatile void *, int, u_int); - /* global data in mp_machdep.c */ extern int imcr_present; extern int mp_naps; @@ -104,37 +100,6 @@ void forward_signal (struct proc *); int mptable_pci_int_route(int, int, int, int); void mptable_pci_int_dump(void); -#ifndef _SYS_QUEUE_H_ -#include -#endif - -struct ioapic_enumerator { - int ioapic_prio; - TAILQ_ENTRY(ioapic_enumerator) ioapic_link; - int (*ioapic_probe)(struct ioapic_enumerator *); - void (*ioapic_enumerate)(struct ioapic_enumerator *); -}; - -#define IOAPIC_ENUM_PRIO_MPTABLE 20 -#define IOAPIC_ENUM_PRIO_MADT 40 - -#ifndef _SYS_BUS_H_ -#include -#endif - -/* functions in mpapic.c */ -void ioapic_config(void); -void ioapic_enumerator_register(struct ioapic_enumerator *); -void ioapic_add(void *, int, int); -void ioapic_intsrc(int, int, enum intr_trigger, enum intr_polarity); -void *ioapic_gsi_ioaddr(int); -int ioapic_gsi_pin(int); -void ioapic_pin_setup(void *, int, int, - enum intr_trigger, enum intr_polarity); -void ioapic_extpin_setup(void *, int, int); -int ioapic_extpin_gsi(void); -int ioapic_gsi(int, int); - extern int apic_io_enable; #if defined(READY)