f5b454cf25
function to return the total number of CPUs and not the highest CPU id. o Define mp_maxid based on the minimum of the actual number of CPUs in the system and MAXCPU. o In cpu_mp_add, when the CPU id of the CPU we're trying to add is larger than mp_maxid, don't add the CPU. Formerly this was based on MAXCPU. Don't count CPUs when we add them. We already know how many CPUs exist. o Replace MAXCPU with mp_maxid when used in loops that iterate over the id space. This avoids a couple of useless iterations. o In cpu_mp_unleash, use the number of CPUs to determine if we need to launch the CPUs. o Remove mp_hardware as it's not used anymore. o Move the IPI vector array from mp_machdep.c to sal.c. We use the array as a centralized place to collect vector assignments. Note that we still assign vectors to SMP specific IPIs in non-SMP configurations. Rename the array from mp_ipi_vector to ipi_vector. o Add IPI_MCA_RENDEZ and IPI_MCA_CMCV. These are used by MCA. Note that IPI_MCA_CMCV is not SMP specific. o Initialize the ipi_vector array so that we place the IPIs in sensible priority classes. The classes are relative to where the AP wake-up vector is located to guarantee that it's the highest priority (external) interrupt. Class assignment is as follows: class IPI notes x AP wake-up (normally x=15) x-1 MCA rendezvous x-2 AST, Rendezvous, stop x-3 CMCV, test
39 lines
854 B
C
39 lines
854 B
C
/*
|
|
* $FreeBSD$
|
|
*/
|
|
#ifndef _MACHINE_SMP_H_
|
|
#define _MACHINE_SMP_H_
|
|
|
|
#ifdef _KERNEL
|
|
|
|
/*
|
|
* Interprocessor interrupts for SMP. The following values are indices
|
|
* into the IPI vector table. The SAL gives us the vector used for AP
|
|
* wake-up. We base the other vectors on that. Keep IPI_AP_WAKEUP at
|
|
* index 0 and IPI_MCA_RENDEZ at index 1. See sal.c for details.
|
|
*/
|
|
/* Architecture specific IPIs. */
|
|
#define IPI_AP_WAKEUP 0
|
|
#define IPI_MCA_RENDEZ 1
|
|
#define IPI_MCA_CMCV 2
|
|
#define IPI_TEST 3
|
|
/* Machine independent IPIs. */
|
|
#define IPI_AST 4
|
|
#define IPI_RENDEZVOUS 5
|
|
#define IPI_STOP 6
|
|
|
|
#define IPI_COUNT 7
|
|
|
|
#ifndef LOCORE
|
|
|
|
extern int ipi_vector[];
|
|
|
|
void ipi_all(int ipi);
|
|
void ipi_all_but_self(int ipi);
|
|
void ipi_selected(u_int64_t cpus, int ipi);
|
|
void ipi_self(int ipi);
|
|
|
|
#endif /* !LOCORE */
|
|
#endif /* _KERNEL */
|
|
#endif /* !_MACHINE_SMP_H */
|