diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-18 15:44:49 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-18 15:44:49 -0500 |
| commit | fb57d2c9e35ce9f6e6bdc79c2366915dc9034db1 (patch) | |
| tree | 7fb5726552a7760cbc6fb99b783456cd95d00a97 /sys/arch | |
| parent | 903e8af7a3c4f769d558e346bc2892da8277639d (diff) | |
kern/amd64: mp: Add application processor counter
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch')
| -rw-r--r-- | sys/arch/amd64/cpu/mp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/arch/amd64/cpu/mp.c b/sys/arch/amd64/cpu/mp.c index 5ab7815..c370906 100644 --- a/sys/arch/amd64/cpu/mp.c +++ b/sys/arch/amd64/cpu/mp.c @@ -27,6 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/atomic.h> #include <sys/types.h> #include <sys/cdefs.h> #include <sys/errno.h> @@ -101,6 +102,7 @@ struct mtrr_save { static struct ap_bootspace bs; static volatile size_t ap_sync = 0; +static volatile uint32_t ap_count = 0; __section(".trampoline") static char ap_code[4096]; static void @@ -263,6 +265,7 @@ cpu_lm_entry(void) ); cpu_loinit(); + atomic_inc_int(&ap_count); for (;;) { __asmv("cli; hlt"); } @@ -371,4 +374,10 @@ cpu_start_aps(struct cpu_info *ci) cpu_lapic_cb, lapic_read_id(mcb) ); + + if (ap_count == 0) { + dtrace("cpu only has a single core\n"); + } else { + dtrace("%d processor(s) up\n", ap_count); + } } |
