aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/include/sys/cpu.h1
-rw-r--r--sys/kern/kern_cpu.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/sys/include/sys/cpu.h b/sys/include/sys/cpu.h
index 6697811..f22cba4 100644
--- a/sys/include/sys/cpu.h
+++ b/sys/include/sys/cpu.h
@@ -34,6 +34,7 @@
#define cpu_index(ci) ci->idx
+size_t cpu_count(void);
void cpu_attach(struct cpu_info *ci);
struct cpu_info *cpu_get(size_t i);
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c
index 97a7aa4..1779244 100644
--- a/sys/kern/kern_cpu.c
+++ b/sys/kern/kern_cpu.c
@@ -68,3 +68,9 @@ cpu_get(size_t i)
return ci_list[i];
}
+
+size_t
+cpu_count(void)
+{
+ return ncpu;
+}