Second part of a little cleanup in the calendar/timezone/RTC handling.
Split subr_clock.c in two parts (by repo-copy): subr_clock.c contains generic RTC and calendaric stuff. etc. subr_rtc.c contains the newbus'ified RTC interface. Centralize the machdep.{adjkerntz,disable_rtc_set,wall_cmos_clock} sysctls and associated variables into subr_clock.c. They are not machine dependent and we have generic code that relies on being present so they are not even optional.
This commit is contained in:
parent
81bdd4b329
commit
84cc0f277f
@ -631,26 +631,6 @@ cpu_setregs(void)
|
||||
load_cr0(cr0);
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2,
|
||||
req);
|
||||
if (!error && req->newptr)
|
||||
resettodr();
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set,
|
||||
CTLFLAG_RW, &disable_rtc_set, 0, "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
/*
|
||||
* Initialize amd64 and configure to run kernel
|
||||
*/
|
||||
|
@ -93,9 +93,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x))
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int clkintr_pending;
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int pscnt = 1;
|
||||
int psdiv = 1;
|
||||
int statclock_disable;
|
||||
@ -105,7 +103,6 @@ int statclock_disable;
|
||||
u_int timer_freq = TIMER_FREQ;
|
||||
int timer0_max_count;
|
||||
int timer0_real_max_count;
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
struct mtx clock_lock;
|
||||
#define RTC_LOCK mtx_lock_spin(&clock_lock)
|
||||
#define RTC_UNLOCK mtx_unlock_spin(&clock_lock)
|
||||
|
@ -1370,7 +1370,7 @@ kern/subr_acl_posix1e.c standard
|
||||
kern/subr_autoconf.c standard
|
||||
kern/subr_blist.c standard
|
||||
kern/subr_bus.c standard
|
||||
kern/subr_clock.c optional genclock
|
||||
kern/subr_clock.c standard
|
||||
kern/subr_devstat.c standard
|
||||
kern/subr_disk.c standard
|
||||
kern/subr_eventhandler.c standard
|
||||
@ -1390,6 +1390,7 @@ kern/subr_power.c standard
|
||||
kern/subr_prf.c standard
|
||||
kern/subr_prof.c standard
|
||||
kern/subr_rman.c standard
|
||||
kern/subr_rtc.c optional genclock
|
||||
kern/subr_sbuf.c standard
|
||||
kern/subr_scanf.c standard
|
||||
kern/subr_sleepqueue.c standard
|
||||
|
@ -1259,26 +1259,6 @@ cpu_setregs(void)
|
||||
load_gs(_udatasel);
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2,
|
||||
req);
|
||||
if (!error && req->newptr)
|
||||
resettodr();
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set,
|
||||
CTLFLAG_RW, &disable_rtc_set, 0, "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
u_long bootdev; /* not a struct cdev *- encoding is different */
|
||||
SYSCTL_ULONG(_machdep, OID_AUTO, guessed_bootdev,
|
||||
CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in struct cdev *format)");
|
||||
|
@ -103,9 +103,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x))
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int clkintr_pending;
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int pscnt = 1;
|
||||
int psdiv = 1;
|
||||
int statclock_disable;
|
||||
@ -115,7 +113,6 @@ int statclock_disable;
|
||||
u_int timer_freq = TIMER_FREQ;
|
||||
int timer0_max_count;
|
||||
int timer0_real_max_count;
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
struct mtx clock_lock;
|
||||
#define RTC_LOCK mtx_lock_spin(&clock_lock)
|
||||
#define RTC_UNLOCK mtx_unlock_spin(&clock_lock)
|
||||
|
@ -41,31 +41,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/efi.h>
|
||||
|
||||
static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set,
|
||||
CTLFLAG_RW, &disable_rtc_set, 0, "");
|
||||
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
static int
|
||||
sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
|
||||
if (!error && req->newptr)
|
||||
resettodr();
|
||||
return (error);
|
||||
}
|
||||
|
||||
uint64_t ia64_clock_reload;
|
||||
|
||||
static int clock_initialized = 0;
|
||||
|
@ -103,9 +103,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x))
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int clkintr_pending;
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int pscnt = 1;
|
||||
int psdiv = 1;
|
||||
int statclock_disable;
|
||||
@ -115,7 +113,6 @@ int statclock_disable;
|
||||
u_int timer_freq = TIMER_FREQ;
|
||||
int timer0_max_count;
|
||||
int timer0_real_max_count;
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
struct mtx clock_lock;
|
||||
#define RTC_LOCK mtx_lock_spin(&clock_lock)
|
||||
#define RTC_UNLOCK mtx_unlock_spin(&clock_lock)
|
||||
|
@ -38,21 +38,6 @@
|
||||
* from: src/sys/i386/isa/clock.c,v 1.176 2001/09/04
|
||||
*/
|
||||
|
||||
/*
|
||||
* Helpers for time-of-day clocks. This is useful for architectures that need
|
||||
* support multiple models of such clocks, and generally serves to make the
|
||||
* code more machine-independent.
|
||||
* If the clock in question can also be used as a time counter, the driver
|
||||
* needs to initiate this.
|
||||
* This code is not yet used by all architectures.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic routines to convert between a POSIX date
|
||||
* (seconds since 1/1/1970) and yr/mo/day/hr/min/sec
|
||||
* Derived from NetBSD arch/hp300/hp300/clock.c
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
@ -64,28 +49,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/timetc.h>
|
||||
|
||||
/* XXX: for the CPU_* sysctl OID constants. */
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include "clock_if.h"
|
||||
|
||||
static __inline int leapyear(int year);
|
||||
static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
#define FEBRUARY 2
|
||||
#define days_in_year(y) (leapyear(y) ? 366 : 365)
|
||||
#define days_in_month(y, m) \
|
||||
(month_days[(m) - 1] + (m == FEBRUARY ? leapyear(y) : 0))
|
||||
/* Day of week. Days are counted from 1/1/1970, which was a Thursday */
|
||||
#define day_of_week(days) (((days) + 4) % 7)
|
||||
|
||||
static const int month_days[12] = {
|
||||
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
||||
};
|
||||
|
||||
static device_t clock_dev = NULL;
|
||||
static long clock_res;
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
@ -94,9 +57,6 @@ int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
* These have traditionally been in machdep, but should probably be moved to
|
||||
* kern.
|
||||
*/
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set,
|
||||
CTLFLAG_RW, &disable_rtc_set, 0, "");
|
||||
|
||||
@ -114,6 +74,28 @@ sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS)
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Generic routines to convert between a POSIX date
|
||||
* (seconds since 1/1/1970) and yr/mo/day/hr/min/sec
|
||||
* Derived from NetBSD arch/hp300/hp300/clock.c
|
||||
*/
|
||||
|
||||
|
||||
#define FEBRUARY 2
|
||||
#define days_in_year(y) (leapyear(y) ? 366 : 365)
|
||||
#define days_in_month(y, m) \
|
||||
(month_days[(m) - 1] + (m == FEBRUARY ? leapyear(y) : 0))
|
||||
/* Day of week. Days are counted from 1/1/1970, which was a Thursday */
|
||||
#define day_of_week(days) (((days) + 4) % 7)
|
||||
|
||||
static const int month_days[12] = {
|
||||
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This inline avoids some unnecessary modulo operations
|
||||
* as compared with the usual macro:
|
||||
@ -212,106 +194,3 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime *ct)
|
||||
ct->sec = rsec;
|
||||
ct->nsec = ts->tv_nsec;
|
||||
}
|
||||
|
||||
void
|
||||
clock_register(device_t dev, long res) /* res has units of microseconds */
|
||||
{
|
||||
|
||||
if (clock_dev != NULL) {
|
||||
if (clock_res > res) {
|
||||
if (bootverbose) {
|
||||
device_printf(dev, "not installed as "
|
||||
"time-of-day clock: clock %s has higher "
|
||||
"resolution\n", device_get_name(clock_dev));
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (bootverbose) {
|
||||
device_printf(clock_dev, "removed as "
|
||||
"time-of-day clock: clock %s has higher "
|
||||
"resolution\n", device_get_name(dev));
|
||||
}
|
||||
}
|
||||
}
|
||||
clock_dev = dev;
|
||||
clock_res = res;
|
||||
if (bootverbose) {
|
||||
device_printf(dev, "registered as a time-of-day clock "
|
||||
"(resolution %ldus)\n", res);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* inittodr and settodr derived from the i386 versions written
|
||||
* by Christoph Robitschko <chmr@edvz.tu-graz.ac.at>, reintroduced and
|
||||
* updated by Chris Stenton <chris@gnome.co.uk> 8/10/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialize the time of day register, based on the time base which is, e.g.
|
||||
* from a filesystem.
|
||||
*/
|
||||
void
|
||||
inittodr(time_t base)
|
||||
{
|
||||
struct timespec diff, ref, ts;
|
||||
int error;
|
||||
|
||||
if (base) {
|
||||
ref.tv_sec = base;
|
||||
ref.tv_nsec = 0;
|
||||
tc_setclock(&ref);
|
||||
}
|
||||
|
||||
if (clock_dev == NULL) {
|
||||
printf("warning: no time-of-day clock registered, system time "
|
||||
"will not be set accurately\n");
|
||||
return;
|
||||
}
|
||||
error = CLOCK_GETTIME(clock_dev, &ts);
|
||||
if (error != 0 && error != EINVAL) {
|
||||
printf("warning: clock_gettime failed (%d), the system time "
|
||||
"will not be set accurately\n", error);
|
||||
return;
|
||||
}
|
||||
if (error == EINVAL || ts.tv_sec < 0) {
|
||||
printf("Invalid time in real time clock.\n");
|
||||
printf("Check and reset the date immediately!\n");
|
||||
}
|
||||
|
||||
ts.tv_sec += tz_minuteswest * 60 +
|
||||
(wall_cmos_clock ? adjkerntz : 0);
|
||||
|
||||
if (timespeccmp(&ref, &ts, >)) {
|
||||
diff = ref;
|
||||
timespecsub(&ref, &ts);
|
||||
} else {
|
||||
diff = ts;
|
||||
timespecsub(&diff, &ref);
|
||||
}
|
||||
if (ts.tv_sec >= 2) {
|
||||
/* badly off, adjust it */
|
||||
tc_setclock(&ts);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Write system time back to RTC
|
||||
*/
|
||||
void
|
||||
resettodr()
|
||||
{
|
||||
struct timespec ts;
|
||||
int error;
|
||||
|
||||
if (disable_rtc_set || clock_dev == NULL)
|
||||
return;
|
||||
|
||||
getnanotime(&ts);
|
||||
ts.tv_sec -= tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
|
||||
if ((error = CLOCK_SETTIME(clock_dev, &ts)) != 0) {
|
||||
printf("warning: clock_settime failed (%d), time-of-day clock "
|
||||
"not adjusted to system time\n", error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -47,12 +47,6 @@
|
||||
* This code is not yet used by all architectures.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic routines to convert between a POSIX date
|
||||
* (seconds since 1/1/1970) and yr/mo/day/hr/min/sec
|
||||
* Derived from NetBSD arch/hp300/hp300/clock.c
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
@ -69,150 +63,9 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "clock_if.h"
|
||||
|
||||
static __inline int leapyear(int year);
|
||||
static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
#define FEBRUARY 2
|
||||
#define days_in_year(y) (leapyear(y) ? 366 : 365)
|
||||
#define days_in_month(y, m) \
|
||||
(month_days[(m) - 1] + (m == FEBRUARY ? leapyear(y) : 0))
|
||||
/* Day of week. Days are counted from 1/1/1970, which was a Thursday */
|
||||
#define day_of_week(days) (((days) + 4) % 7)
|
||||
|
||||
static const int month_days[12] = {
|
||||
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
||||
};
|
||||
|
||||
static device_t clock_dev = NULL;
|
||||
static long clock_res;
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
|
||||
/*
|
||||
* These have traditionally been in machdep, but should probably be moved to
|
||||
* kern.
|
||||
*/
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set,
|
||||
CTLFLAG_RW, &disable_rtc_set, 0, "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
static int
|
||||
sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2,
|
||||
req);
|
||||
if (!error && req->newptr)
|
||||
resettodr();
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* This inline avoids some unnecessary modulo operations
|
||||
* as compared with the usual macro:
|
||||
* ( ((year % 4) == 0 &&
|
||||
* (year % 100) != 0) ||
|
||||
* ((year % 400) == 0) )
|
||||
* It is otherwise equivalent.
|
||||
*/
|
||||
static __inline int
|
||||
leapyear(int year)
|
||||
{
|
||||
int rv = 0;
|
||||
|
||||
if ((year & 3) == 0) {
|
||||
rv = 1;
|
||||
if ((year % 100) == 0) {
|
||||
rv = 0;
|
||||
if ((year % 400) == 0)
|
||||
rv = 1;
|
||||
}
|
||||
}
|
||||
return (rv);
|
||||
}
|
||||
|
||||
int
|
||||
clock_ct_to_ts(struct clocktime *ct, struct timespec *ts)
|
||||
{
|
||||
time_t secs;
|
||||
int i, year, days;
|
||||
|
||||
year = ct->year;
|
||||
|
||||
/* Sanity checks. */
|
||||
if (ct->mon < 1 || ct->mon > 12 || ct->day < 1 ||
|
||||
ct->day > days_in_month(year, ct->mon) ||
|
||||
ct->hour > 23 || ct->min > 59 || ct->sec > 59 ||
|
||||
ct->year > 2037) /* time_t overflow */
|
||||
return (EINVAL);
|
||||
|
||||
/*
|
||||
* Compute days since start of time
|
||||
* First from years, then from months.
|
||||
*/
|
||||
days = 0;
|
||||
for (i = POSIX_BASE_YEAR; i < year; i++)
|
||||
days += days_in_year(i);
|
||||
|
||||
/* Months */
|
||||
for (i = 1; i < ct->mon; i++)
|
||||
days += days_in_month(year, i);
|
||||
days += (ct->day - 1);
|
||||
|
||||
/* Another sanity check. */
|
||||
if (ct->dow != -1 && ct->dow != day_of_week(days))
|
||||
return (EINVAL);
|
||||
|
||||
/* Add hours, minutes, seconds. */
|
||||
secs = ((days * 24 + ct->hour) * 60 + ct->min) * 60 + ct->sec;
|
||||
|
||||
ts->tv_sec = secs;
|
||||
ts->tv_nsec = ct->nsec;
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
clock_ts_to_ct(struct timespec *ts, struct clocktime *ct)
|
||||
{
|
||||
int i, year, days;
|
||||
time_t rsec; /* remainder seconds */
|
||||
time_t secs;
|
||||
|
||||
secs = ts->tv_sec;
|
||||
days = secs / SECDAY;
|
||||
rsec = secs % SECDAY;
|
||||
|
||||
ct->dow = day_of_week(days);
|
||||
|
||||
/* Subtract out whole years, counting them in i. */
|
||||
for (year = POSIX_BASE_YEAR; days >= days_in_year(year); year++)
|
||||
days -= days_in_year(year);
|
||||
ct->year = year;
|
||||
|
||||
/* Subtract out whole months, counting them in i. */
|
||||
for (i = 1; days >= days_in_month(year, i); i++)
|
||||
days -= days_in_month(year, i);
|
||||
ct->mon = i;
|
||||
|
||||
/* Days are what is left over (+1) from all that. */
|
||||
ct->day = days + 1;
|
||||
|
||||
/* Hours, minutes, seconds are easy */
|
||||
ct->hour = rsec / 3600;
|
||||
rsec = rsec % 3600;
|
||||
ct->min = rsec / 60;
|
||||
rsec = rsec % 60;
|
||||
ct->sec = rsec;
|
||||
ct->nsec = ts->tv_nsec;
|
||||
}
|
||||
|
||||
void
|
||||
clock_register(device_t dev, long res) /* res has units of microseconds */
|
||||
{
|
||||
|
@ -100,9 +100,7 @@
|
||||
|
||||
#define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x))
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int clkintr_pending;
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int pscnt = 1;
|
||||
int psdiv = 1;
|
||||
int statclock_disable;
|
||||
@ -112,7 +110,6 @@ int statclock_disable;
|
||||
u_int timer_freq = TIMER_FREQ;
|
||||
int timer0_max_count;
|
||||
int timer0_real_max_count;
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
struct mtx clock_lock;
|
||||
|
||||
static int beeping = 0;
|
||||
|
@ -100,9 +100,7 @@
|
||||
|
||||
#define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x))
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
int clkintr_pending;
|
||||
int disable_rtc_set; /* disable resettodr() if != 0 */
|
||||
int pscnt = 1;
|
||||
int psdiv = 1;
|
||||
int statclock_disable;
|
||||
@ -112,7 +110,6 @@ int statclock_disable;
|
||||
u_int timer_freq = TIMER_FREQ;
|
||||
int timer0_max_count;
|
||||
int timer0_real_max_count;
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
struct mtx clock_lock;
|
||||
|
||||
static int beeping = 0;
|
||||
|
@ -1254,26 +1254,6 @@ cpu_setregs(void)
|
||||
load_gs(_udatasel);
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2,
|
||||
req);
|
||||
if (!error && req->newptr)
|
||||
resettodr();
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set,
|
||||
CTLFLAG_RW, &disable_rtc_set, 0, "");
|
||||
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
u_long bootdev; /* not a struct cdev *- encoding is different */
|
||||
SYSCTL_ULONG(_machdep, OID_AUTO, guessed_bootdev,
|
||||
CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in struct cdev *format)");
|
||||
|
@ -82,16 +82,6 @@ static u_long ticks_per_sec = 12500000;
|
||||
static long ticks_per_intr;
|
||||
static volatile u_long lasttb;
|
||||
|
||||
static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
#define SECDAY 86400
|
||||
#define DIFF19041970 2082844800
|
||||
|
||||
|
@ -82,16 +82,6 @@ static u_long ticks_per_sec = 12500000;
|
||||
static long ticks_per_intr;
|
||||
static volatile u_long lasttb;
|
||||
|
||||
static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
|
||||
SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock,
|
||||
CTLFLAG_RW, &wall_cmos_clock, 0, "");
|
||||
|
||||
int adjkerntz; /* local offset from GMT in seconds */
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
|
||||
|
||||
#define SECDAY 86400
|
||||
#define DIFF19041970 2082844800
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user