[Midnightbsd-cvs] src [8342] trunk/sys: rename deep sleep vars for acpi
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Sep 18 14:11:35 EDT 2016
Revision: 8342
http://svnweb.midnightbsd.org/src/?rev=8342
Author: laffer1
Date: 2016-09-18 14:11:35 -0400 (Sun, 18 Sep 2016)
Log Message:
-----------
rename deep sleep vars for acpi
Modified Paths:
--------------
trunk/sys/amd64/amd64/machdep.c
trunk/sys/i386/i386/machdep.c
trunk/sys/kern/kern_clocksource.c
trunk/sys/sys/systm.h
Modified: trunk/sys/amd64/amd64/machdep.c
===================================================================
--- trunk/sys/amd64/amd64/machdep.c 2016-09-18 18:06:38 UTC (rev 8341)
+++ trunk/sys/amd64/amd64/machdep.c 2016-09-18 18:11:35 UTC (rev 8342)
@@ -806,7 +806,7 @@
}
/* Apply AMD APIC timer C1E workaround. */
- if (cpu_ident_amdc1e && cpu_disable_c3_sleep) {
+ if (cpu_ident_amdc1e && cpu_disable_deep_sleep) {
msr = rdmsr(MSR_AMDK8_IPM);
if (msr & AMDK8_CMPHALT)
wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT);
Modified: trunk/sys/i386/i386/machdep.c
===================================================================
--- trunk/sys/i386/i386/machdep.c 2016-09-18 18:06:38 UTC (rev 8341)
+++ trunk/sys/i386/i386/machdep.c 2016-09-18 18:11:35 UTC (rev 8342)
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__MBSDID("$MidnightBSD$");
#include "opt_apic.h"
#include "opt_atalk.h"
@@ -1399,7 +1399,7 @@
#ifndef XEN
/* Apply AMD APIC timer C1E workaround. */
- if (cpu_ident_amdc1e && cpu_disable_c3_sleep) {
+ if (cpu_ident_amdc1e && cpu_disable_deep_sleep) {
msr = rdmsr(MSR_AMDK8_IPM);
if (msr & AMDK8_CMPHALT)
wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT);
Modified: trunk/sys/kern/kern_clocksource.c
===================================================================
--- trunk/sys/kern/kern_clocksource.c 2016-09-18 18:06:38 UTC (rev 8341)
+++ trunk/sys/kern/kern_clocksource.c 2016-09-18 18:11:35 UTC (rev 8342)
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: release/9.2.0/sys/kern/kern_clocksource.c 250600 2013-05-13 15:18:36Z fabient $");
/*
* Common routines to manage event timers hardware.
@@ -59,9 +59,8 @@
cyclic_clock_func_t cyclic_clock_func = NULL;
#endif
-int cpu_deepest_sleep = 0; /* Deepest Cx state available. */
-int cpu_disable_c2_sleep = 0; /* Timer dies in C2. */
-int cpu_disable_c3_sleep = 0; /* Timer dies in C3. */
+int cpu_can_deep_sleep = 0; /* C3 state is available. */
+int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */
static void setuptimer(void);
static void loadtimer(struct bintime *now, int first);
@@ -656,7 +655,7 @@
else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
periodic = 1;
if (timer->et_flags & ET_FLAGS_C3STOP)
- cpu_disable_c3_sleep++;
+ cpu_disable_deep_sleep++;
/*
* We honor the requested 'hz' value.
@@ -733,12 +732,15 @@
{
ET_LOCK();
- if (periodic) {
- configtimer(0);
- profiling = 1;
- configtimer(1);
+ if (profiling == 0) {
+ if (periodic) {
+ configtimer(0);
+ profiling = 1;
+ configtimer(1);
+ } else
+ profiling = 1;
} else
- profiling = 1;
+ profiling++;
ET_UNLOCK();
}
@@ -750,12 +752,15 @@
{
ET_LOCK();
- if (periodic) {
- configtimer(0);
+ if (profiling == 1) {
+ if (periodic) {
+ configtimer(0);
+ profiling = 0;
+ configtimer(1);
+ } else
profiling = 0;
- configtimer(1);
} else
- profiling = 0;
+ profiling--;
ET_UNLOCK();
}
@@ -934,9 +939,9 @@
configtimer(0);
et_free(timer);
if (et->et_flags & ET_FLAGS_C3STOP)
- cpu_disable_c3_sleep++;
+ cpu_disable_deep_sleep++;
if (timer->et_flags & ET_FLAGS_C3STOP)
- cpu_disable_c3_sleep--;
+ cpu_disable_deep_sleep--;
periodic = want_periodic;
timer = et;
et_init(timer, timercb, NULL, NULL);
Modified: trunk/sys/sys/systm.h
===================================================================
--- trunk/sys/sys/systm.h 2016-09-18 18:06:38 UTC (rev 8341)
+++ trunk/sys/sys/systm.h 2016-09-18 18:11:35 UTC (rev 8342)
@@ -49,6 +49,7 @@
extern int rebooting; /* kern_reboot() has been called. */
extern const char *panicstr; /* panic message */
extern char version[]; /* system version */
+extern char compiler_version[]; /* compiler version */
extern char copyright[]; /* system copyright */
extern int kstack_pages; /* number of kernel stack pages */
@@ -135,6 +136,7 @@
extern const void *zero_region; /* address space maps to a zeroed page */
+extern int unmapped_buf_allowed;
extern int iosize_max_clamp;
#define IOSIZE_MAX (iosize_max_clamp ? INT_MAX : SSIZE_MAX)
@@ -266,9 +268,7 @@
void cpu_stopprofclock(void);
void cpu_idleclock(void);
void cpu_activeclock(void);
-extern int cpu_deepest_sleep;
-extern int cpu_disable_c2_sleep;
-extern int cpu_disable_c3_sleep;
+extern int cpu_can_deep_sleep;
extern int cpu_disable_deep_sleep;
int cr_cansee(struct ucred *u1, struct ucred *u2);
More information about the Midnightbsd-cvs
mailing list