summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/smp.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-04-27 19:28:25 +0000
committerjhb <jhb@FreeBSD.org>2001-04-27 19:28:25 +0000
commit8bfdafc9349392c2fe02f548d6ffe6db56626575 (patch)
treeb44641a14ad9f8eb3b338e429775d3298b8946e2 /sys/amd64/include/smp.h
parent95c17411607d3bc160b63f97e94912bf27b24274 (diff)
downloadFreeBSD-src-8bfdafc9349392c2fe02f548d6ffe6db56626575.zip
FreeBSD-src-8bfdafc9349392c2fe02f548d6ffe6db56626575.tar.gz
Overhaul of the SMP code. Several portions of the SMP kernel support have
been made machine independent and various other adjustments have been made to support Alpha SMP. - It splits the per-process portions of hardclock() and statclock() off into hardclock_process() and statclock_process() respectively. hardclock() and statclock() call the *_process() functions for the current process so that UP systems will run as before. For SMP systems, it is simply necessary to ensure that all other processors execute the *_process() functions when the main clock functions are triggered on one CPU by an interrupt. For the alpha 4100, clock interrupts are delievered in a staggered broadcast fashion, so we simply call hardclock/statclock on the boot CPU and call the *_process() functions on the secondaries. For x86, we call statclock and hardclock as usual and then call forward_hardclock/statclock in the MD code to send an IPI to cause the AP's to execute forwared_hardclock/statclock which then call the *_process() functions. - forward_signal() and forward_roundrobin() have been reworked to be MI and to involve less hackery. Now the cpu doing the forward sets any flags, etc. and sends a very simple IPI_AST to the other cpu(s). AST IPIs now just basically return so that they can execute ast() and don't bother with setting the astpending or needresched flags themselves. This also removes the loop in forward_signal() as sched_lock closes the race condition that the loop worked around. - need_resched(), resched_wanted() and clear_resched() have been changed to take a process to act on rather than assuming curproc so that they can be used to implement forward_roundrobin() as described above. - Various other SMP variables have been moved to a MI subr_smp.c and a new header sys/smp.h declares MI SMP variables and API's. The IPI API's from machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h. - The globaldata_register() and globaldata_find() functions as well as the SLIST of globaldata structures has become MI and moved into subr_smp.c. Also, the globaldata list is only available if SMP support is compiled in. Reviewed by: jake, peter Looked over by: eivind
Diffstat (limited to 'sys/amd64/include/smp.h')
-rw-r--r--sys/amd64/include/smp.h50
1 files changed, 23 insertions, 27 deletions
diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h
index 9f9149e..f699e1f 100644
--- a/sys/amd64/include/smp.h
+++ b/sys/amd64/include/smp.h
@@ -41,7 +41,21 @@ extern int current_postcode; /** XXX currently in mp_machdep.c */
outb(0x80, current_postcode)
+#include <sys/bus.h> /* XXX */
#include <machine/apic.h>
+#include <machine/frame.h>
+#include <i386/isa/icu.h>
+#include <i386/isa/intr_machdep.h>
+
+/*
+ * Interprocessor interrupts for SMP.
+ */
+#define IPI_INVLTLB XINVLTLB_OFFSET
+#define IPI_RENDEZVOUS XRENDEZVOUS_OFFSET
+#define IPI_AST XCPUAST_OFFSET
+#define IPI_STOP XCPUSTOP_OFFSET
+#define IPI_HARDCLOCK XHARDCLOCK_OFFSET
+#define IPI_STATCLOCK XSTATCLOCK_OFFSET
/* global data in mpboot.s */
extern int bootMP_size;
@@ -49,18 +63,8 @@ extern int bootMP_size;
/* functions in mpboot.s */
void bootMP __P((void));
-/* global data in apic_vector.s */
-extern volatile u_int stopped_cpus;
-extern volatile u_int started_cpus;
-
-extern volatile u_int checkstate_probed_cpus;
-extern volatile u_int checkstate_need_ast;
-extern volatile u_int resched_cpus;
-extern void (*cpustop_restartfunc) __P((void));
-
/* global data in mp_machdep.c */
extern int bsp_apic_ready;
-extern int mp_ncpus;
extern int mp_naps;
extern int mp_nbusses;
extern int mp_napics;
@@ -81,14 +85,11 @@ struct apic_intmapinfo {
int redirindex;
};
extern struct apic_intmapinfo int_to_apicintpin[];
-extern u_int all_cpus;
extern struct pcb stoppcbs[];
/* functions in mp_machdep.c */
+void i386_mp_probe __P((void));
u_int mp_bootaddress __P((u_int));
-int mp_probe __P((void));
-void mp_start __P((void));
-void mp_announce __P((void));
u_int isa_apic_mask __P((u_int));
int isa_apic_irq __P((int));
int pci_apic_irq __P((int, int, int));
@@ -107,20 +108,17 @@ void revoke_apic_irq __P((int irq));
void bsp_apic_configure __P((void));
void init_secondary __P((void));
void smp_invltlb __P((void));
-int stop_cpus __P((u_int));
-int restart_cpus __P((u_int));
-void forward_statclock __P((int pscnt));
-void forward_hardclock __P((int pscnt));
-void forward_signal __P((struct proc *));
-void forward_roundrobin __P((void));
+void forward_statclock __P((void));
+void forwarded_statclock __P((struct trapframe frame));
+void forward_hardclock __P((void));
+void forwarded_hardclock __P((struct trapframe frame));
+void ipi_selected __P((u_int cpus, u_int ipi));
+void ipi_all __P((u_int ipi));
+void ipi_all_but_self __P((u_int ipi));
+void ipi_self __P((u_int ipi));
#ifdef APIC_INTR_REORDER
void set_lapic_isrloc __P((int, int));
#endif /* APIC_INTR_REORDER */
-void smp_rendezvous_action __P((void));
-void smp_rendezvous __P((void (*)(void *),
- void (*)(void *),
- void (*)(void *),
- void *arg));
/* global data in mpapic.c */
extern volatile lapic_t lapic;
@@ -147,8 +145,6 @@ void io_apic_write __P((int, int, u_int));
/* global data in init_smp.c */
extern int invltlb_ok;
-extern int smp_active;
-extern int smp_started;
extern volatile int smp_idle_loops;
#endif /* !LOCORE */
OpenPOWER on IntegriCloud