diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 29be4117fb87..2f5ae4de3939 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -232,9 +232,9 @@ struct kseq { */ struct kseq_group { int ksg_cpus; /* Count of CPUs in this kseq group. */ - int ksg_cpumask; /* Mask of cpus in this group. */ - int ksg_idlemask; /* Idle cpus in this group. */ - int ksg_mask; /* Bit mask for first cpu. */ + cpumask_t ksg_cpumask; /* Mask of cpus in this group. */ + cpumask_t ksg_idlemask; /* Idle cpus in this group. */ + cpumask_t ksg_mask; /* Bit mask for first cpu. */ int ksg_load; /* Total load of this group. */ int ksg_transferable; /* Transferable load of this group. */ LIST_HEAD(, kseq) ksg_members; /* Linked list of all members. */ @@ -245,7 +245,7 @@ struct kseq_group { * One kse queue per processor. */ #ifdef SMP -static int kseq_idle; +static cpumask_t kseq_idle; static int ksg_maxid; static struct kseq kseq_cpu[MAXCPU]; static struct kseq_group kseq_groups[MAXCPU]; diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index cc5a98b2a786..b1790b4d10bb 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$"); #include #ifdef SMP -volatile u_int stopped_cpus; -volatile u_int started_cpus; +volatile cpumask_t stopped_cpus; +volatile cpumask_t started_cpus; void (*cpustop_restartfunc)(void); #endif @@ -62,7 +62,7 @@ int mp_maxcpus = MAXCPU; struct cpu_top *smp_topology; volatile int smp_started; -u_int all_cpus; +cpumask_t all_cpus; u_int mp_maxid; SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD, NULL, "Kernel SMP"); @@ -214,7 +214,7 @@ forward_roundrobin(void) { struct pcpu *pc; struct thread *td; - u_int id, map; + cpumask_t id, map; mtx_assert(&sched_lock, MA_OWNED); @@ -255,7 +255,7 @@ forward_roundrobin(void) * from executing at same time. */ int -stop_cpus(u_int map) +stop_cpus(cpumask_t map) { int i; @@ -266,7 +266,7 @@ stop_cpus(u_int map) /* send the stop IPI to all CPUs in map */ ipi_selected(map, IPI_STOP); - + i = 0; while ((atomic_load_acq_int(&stopped_cpus) & map) != map) { /* spin */ @@ -297,7 +297,7 @@ stop_cpus(u_int map) * 1: ok */ int -restart_cpus(u_int map) +restart_cpus(cpumask_t map) { if (!smp_started) diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index eb7facaac03b..4c08ea06fc2b 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -63,8 +63,8 @@ struct pcpu { struct bintime pc_switchtime; int pc_switchticks; u_int pc_cpuid; /* This cpu number */ - u_int pc_cpumask; /* This cpu mask */ - u_int pc_other_cpus; /* Mask of all other cpus */ + cpumask_t pc_cpumask; /* This cpu mask */ + cpumask_t pc_other_cpus; /* Mask of all other cpus */ SLIST_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; #ifdef KTR_PERCPU diff --git a/sys/sys/smp.h b/sys/sys/smp.h index 519e917698a2..b9d57e216782 100644 --- a/sys/sys/smp.h +++ b/sys/sys/smp.h @@ -32,7 +32,7 @@ */ struct cpu_group { - u_int cg_mask; /* Mask of cpus in this group. */ + cpumask_t cg_mask; /* Mask of cpus in this group. */ int cg_count; /* Count of cpus in this group. */ int cg_children; /* Number of children groups. */ struct cpu_group *cg_child; /* Optional child group. */ @@ -47,11 +47,11 @@ extern struct cpu_top *smp_topology; extern void (*cpustop_restartfunc)(void); extern int smp_active; extern int smp_cpus; -extern volatile u_int started_cpus; -extern volatile u_int stopped_cpus; +extern volatile cpumask_t started_cpus; +extern volatile cpumask_t stopped_cpus; #endif /* SMP */ -extern u_int all_cpus; +extern cpumask_t all_cpus; extern u_int mp_maxid; extern int mp_ncpus; extern volatile int smp_started; @@ -92,8 +92,8 @@ void cpu_mp_start(void); void forward_signal(struct thread *); void forward_roundrobin(void); -int restart_cpus(u_int); -int stop_cpus(u_int); +int restart_cpus(cpumask_t); +int stop_cpus(cpumask_t); void smp_rendezvous_action(void); #endif /* SMP */ void smp_rendezvous(void (*)(void *),