Module Name: src
Committed By: jruoho
Date: Thu Oct 20 13:21:11 UTC 2011
Modified Files:
src/sys/arch/xen/x86: cpu.c
Log Message:
Remove code that is commented out and out-of-sync with x86. If Xen needs to
use cpu_resume(), cpu_suspend(), or cpu_shutdown() in the future, it is
better to expose these from x86 rather than duplicate code.
To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/xen/x86/cpu.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.67 src/sys/arch/xen/x86/cpu.c:1.68
--- src/sys/arch/xen/x86/cpu.c:1.67 Thu Oct 6 06:56:30 2011
+++ src/sys/arch/xen/x86/cpu.c Thu Oct 20 13:21:11 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.67 2011/10/06 06:56:30 mrg Exp $ */
+/* $NetBSD: cpu.c,v 1.68 2011/10/20 13:21:11 jruoho Exp $ */
/* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */
/*-
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.67 2011/10/06 06:56:30 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.68 2011/10/20 13:21:11 jruoho Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -535,11 +535,6 @@ cpu_attach_common(device_t parent, devic
pat_init(ci);
atomic_or_32(&cpus_attached, ci->ci_cpumask);
-#if 0
- if (!pmf_device_register(self, cpu_suspend, cpu_resume))
- aprint_error_dev(self, "couldn't establish power handler\n");
-#endif
-
#ifdef MPVERBOSE
if (mp_verbose) {
struct lwp *l = ci->ci_data.cpu_idlelwp;
@@ -1132,72 +1127,6 @@ cpu_offline_md(void)
splx(s);
}
-#if 0
-/* XXX joerg restructure and restart CPUs individually */
-static bool
-cpu_suspend(device_t dv, const pmf_qual_t *qual)
-{
- struct cpu_softc *sc = device_private(dv);
- struct cpu_info *ci = sc->sc_info;
- int err;
-
- if ((ci->ci_flags & CPUF_PRESENT) == 0)
- return true;
-
- cpufreq_suspend(ci);
-
- if ((ci->ci_flags & CPUF_PRIMARY) != 0)
- return true;
-
- if (ci->ci_data.cpu_idlelwp == NULL)
- return true;
-
- sc->sc_wasonline = !(ci->ci_schedstate.spc_flags & SPCF_OFFLINE);
-
- if (sc->sc_wasonline) {
- mutex_enter(&cpu_lock);
- err = cpu_setstate(ci, false);
- mutex_exit(&cpu_lock);
-
- if (err != 0)
- return false;
- }
-
- return true;
-}
-
-static bool
-cpu_resume(device_t dv, const pmf_qual_t *qual)
-{
- struct cpu_softc *sc = device_private(dv);
- struct cpu_info *ci = sc->sc_info;
- int err = 0;
-
- if ((ci->ci_flags & CPUF_PRESENT) == 0)
- return true;
-
- if ((ci->ci_flags & CPUF_PRIMARY) != 0)
- goto out;
-
- if (ci->ci_data.cpu_idlelwp == NULL)
- goto out;
-
- if (sc->sc_wasonline) {
- mutex_enter(&cpu_lock);
- err = cpu_setstate(ci, true);
- mutex_exit(&cpu_lock);
- }
-
-out:
- if (err != 0)
- return false;
-
- cpufreq_resume(ci);
-
- return true;
-}
-#endif
-
void
cpu_get_tsc_freq(struct cpu_info *ci)
{