summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mp_machdep.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2010-08-10 16:14:10 +0000
committerattilio <attilio@FreeBSD.org>2010-08-10 16:14:10 +0000
commitece04c2557986041a9aaea9ac568c6b1f04bbde0 (patch)
treeab9d8012fcecf8f227bc430ccfe0b0922310be1a /sys/amd64/amd64/mp_machdep.c
parentb25a1960780811b3e7bc68abb4b0dd11c1625bec (diff)
downloadFreeBSD-src-ece04c2557986041a9aaea9ac568c6b1f04bbde0.zip
FreeBSD-src-ece04c2557986041a9aaea9ac568c6b1f04bbde0.tar.gz
Fix some places that may use cpumask_t while they still use 'int' types.
While there, also fix some places assuming cpu type is 'int' while u_int is really meant. Note: this will also fix some possible races in per-cpu data accessings to be addressed in further commits. In collabouration with: Yahoo! Incorporated (via sbruno and peter) Tested by: gianni MFC after: 1 month
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r--sys/amd64/amd64/mp_machdep.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index d39e252..6e8fb23 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -127,7 +127,7 @@ extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
* Local data and functions.
*/
-static u_int logical_cpus;
+static cpumask_t logical_cpus;
static volatile cpumask_t ipi_nmi_pending;
/* used to hold the AP's until we are ready to release them */
@@ -162,8 +162,8 @@ static int start_all_aps(void);
static int start_ap(int apic_id);
static void release_aps(void *dummy);
-static int hlt_logical_cpus;
-static u_int hyperthreading_cpus;
+static cpumask_t hlt_logical_cpus;
+static cpumask_t hyperthreading_cpus;
static cpumask_t hyperthreading_cpus_mask;
static int hyperthreading_allowed = 1;
static struct sysctl_ctx_list logical_cpu_clist;
@@ -1321,8 +1321,11 @@ ipi_nmi_handler()
void
cpustop_handler(void)
{
- int cpu = PCPU_GET(cpuid);
- int cpumask = PCPU_GET(cpumask);
+ cpumask_t cpumask;
+ u_int cpu;
+
+ cpu = PCPU_GET(cpuid);
+ cpumask = PCPU_GET(cpumask);
savectx(&stoppcbs[cpu]);
@@ -1349,9 +1352,12 @@ cpustop_handler(void)
void
cpususpend_handler(void)
{
+ cpumask_t cpumask;
register_t cr3, rf;
- int cpu = PCPU_GET(cpuid);
- int cpumask = PCPU_GET(cpumask);
+ u_int cpu;
+
+ cpu = PCPU_GET(cpuid);
+ cpumask = PCPU_GET(cpumask);
rf = intr_disable();
cr3 = rcr3();
@@ -1523,13 +1529,15 @@ SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_ANY, cpu_hlt_setup, NULL);
int
mp_grab_cpu_hlt(void)
{
- u_int mask = PCPU_GET(cpumask);
+ cpuset_t mask;
#ifdef MP_WATCHDOG
- u_int cpuid = PCPU_GET(cpuid);
+ u_int cpuid;
#endif
int retval;
+ mask = PCPU_GET(cpumask);
#ifdef MP_WATCHDOG
+ cpuid = PCPU_GET(cpuid);
ap_watchdog(cpuid);
#endif
OpenPOWER on IntegriCloud