|
FreeBSD kernel kern code
|
#include <sys/cdefs.h>#include <sys/param.h>#include <sys/systm.h>#include <sys/kernel.h>#include <sys/bus.h>#include <sys/clock.h>#include <sys/limits.h>#include <sys/sysctl.h>#include <sys/timetc.h>
Go to the source code of this file.
Macros | |
| #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)) |
| #define | day_of_week(days) (((days) + 4) % 7) |
Functions | |
| __FBSDID ("$BSDSUniX$") | |
| static int | sysctl_machdep_adjkerntz (SYSCTL_HANDLER_ARGS) |
| SYSCTL_PROC (_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,&adjkerntz, 0, sysctl_machdep_adjkerntz,"I","Local offset from UTC in seconds") | |
| SYSCTL_INT (_debug, OID_AUTO, clocktime, CTLFLAG_RW,&ct_debug, 0,"Enable printing of clocktime debugging") | |
| SYSCTL_INT (_machdep, OID_AUTO, wall_cmos_clock, CTLFLAG_RW,&wall_cmos_clock, 0,"Enables application of machdep.adjkerntz") | |
| static int | leapyear (int year) |
| static void | print_ct (struct clocktime *ct) |
| int | clock_ct_to_ts (struct clocktime *ct, struct timespec *ts) |
| void | clock_ts_to_ct (struct timespec *ts, struct clocktime *ct) |
| int | utc_offset (void) |
Variables | |
| int | tz_minuteswest |
| int | tz_dsttime |
| static int | adjkerntz |
| static int | ct_debug |
| static int | wall_cmos_clock |
| static const int | month_days [12] |
Definition at line 94 of file subr_clock.c.
Referenced by clock_ts_to_ct().
| #define days_in_month | ( | y, | |
| m | |||
| ) | (month_days[(m) - 1] + (m == FEBRUARY ? leapyear(y) : 0)) |
Definition at line 91 of file subr_clock.c.
Referenced by clock_ct_to_ts(), and clock_ts_to_ct().
| #define days_in_year | ( | y | ) | (leapyear(y) ? 366 : 365) |
Definition at line 90 of file subr_clock.c.
Referenced by clock_ct_to_ts(), and clock_ts_to_ct().
| #define FEBRUARY 2 |
Definition at line 89 of file subr_clock.c.
| __FBSDID | ( | "$BSDSUniX$" | ) |
| int clock_ct_to_ts | ( | struct clocktime * | ct, |
| struct timespec * | ts | ||
| ) |
Definition at line 134 of file subr_clock.c.
References ct_debug, days, days_in_month, days_in_year, print_ct(), and printf().

| void clock_ts_to_ct | ( | struct timespec * | ts, |
| struct clocktime * | ct | ||
| ) |
Definition at line 181 of file subr_clock.c.
References ct_debug, day_of_week, days, days_in_month, days_in_year, print_ct(), and printf().

|
static |
Definition at line 110 of file subr_clock.c.
|
static |
Definition at line 126 of file subr_clock.c.
References printf().
Referenced by clock_ct_to_ts(), and clock_ts_to_ct().


| SYSCTL_INT | ( | _debug | , |
| OID_AUTO | , | ||
| clocktime | , | ||
| CTLFLAG_RW | , | ||
| & | ct_debug, | ||
| 0 | , | ||
| "Enable printing of clocktime debugging" | |||
| ) |
| SYSCTL_INT | ( | _machdep | , |
| OID_AUTO | , | ||
| wall_cmos_clock | , | ||
| CTLFLAG_RW | , | ||
| & | wall_cmos_clock, | ||
| 0 | , | ||
| "Enables application of machdep.adjkerntz" | |||
| ) |
|
static |
Definition at line 62 of file subr_clock.c.
References resettodr(), and sysctl_handle_int().

| SYSCTL_PROC | ( | _machdep | , |
| OID_AUTO | , | ||
| adjkerntz | , | ||
| CTLTYPE_INT| | CTLFLAG_RW, | ||
| & | adjkerntz, | ||
| 0 | , | ||
| sysctl_machdep_adjkerntz | , | ||
| "I" | , | ||
| "Local offset from UTC in seconds" | |||
| ) |
| int utc_offset | ( | void | ) |
Definition at line 222 of file subr_clock.c.
References adjkerntz, tz_minuteswest, and wall_cmos_clock.
Referenced by fattime2timespec(), inittodr(), resettodr(), and timespec2fattime().

|
static |
Definition at line 60 of file subr_clock.c.
Referenced by utc_offset().
|
static |
Definition at line 74 of file subr_clock.c.
Referenced by clock_ct_to_ts(), and clock_ts_to_ct().
|
static |
Definition at line 96 of file subr_clock.c.
| int tz_dsttime |
Definition at line 54 of file subr_clock.c.
Referenced by kern_settimeofday(), and sys_gettimeofday().
| int tz_minuteswest |
Definition at line 53 of file subr_clock.c.
Referenced by kern_settimeofday(), sys_gettimeofday(), and utc_offset().
|
static |
Definition at line 78 of file subr_clock.c.
Referenced by utc_offset().