Fix the acpi idle support on i386 which was broken by r312910.

The ifdefs were '#if !defined(__i386__) || !defined(PC98)' previously,
so cpu_idle_acpi was enabled both i386 and amd64 except PC98.

I was obfuscated by '#if !defined(__i386__)' condition.

Submitted by:	bde
Reported by:	bde
This commit is contained in:
Yoshihiro Takahashi 2017-02-26 13:25:56 +00:00
parent 15b2cdedca
commit 645b154260

View File

@ -451,9 +451,7 @@ struct {
{ cpu_idle_spin, "spin" },
{ cpu_idle_mwait, "mwait" },
{ cpu_idle_hlt, "hlt" },
#if !defined(__i386__)
{ cpu_idle_acpi, "acpi" },
#endif
{ NULL, NULL }
};
@ -470,11 +468,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARGS)
if (strstr(idle_tbl[i].id_name, "mwait") &&
(cpu_feature2 & CPUID2_MON) == 0)
continue;
#if !defined(__i386__)
if (strcmp(idle_tbl[i].id_name, "acpi") == 0 &&
cpu_idle_hook == NULL)
continue;
#endif
p += sprintf(p, "%s%s", p != avail ? ", " : "",
idle_tbl[i].id_name);
}
@ -509,11 +505,9 @@ idle_sysctl(SYSCTL_HANDLER_ARGS)
if (strstr(idle_tbl[i].id_name, "mwait") &&
(cpu_feature2 & CPUID2_MON) == 0)
continue;
#if !defined(__i386__)
if (strcmp(idle_tbl[i].id_name, "acpi") == 0 &&
cpu_idle_hook == NULL)
continue;
#endif
if (strcmp(idle_tbl[i].id_name, buf))
continue;
cpu_idle_fn = idle_tbl[i].id_fn;