Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/i386/libi386/time.c
Show All 26 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <stand.h> | #include <stand.h> | ||||
#include <btxv86.h> | #include <btxv86.h> | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
#include "libi386.h" | #include "libi386.h" | ||||
time_t getsecs(void); | |||||
static int bios_seconds(void); | static int bios_seconds(void); | ||||
/* | /* | ||||
* Return the BIOS time-of-day value. | * Return the BIOS time-of-day value. | ||||
* | * | ||||
* XXX uses undocumented BCD support from libstand. | * XXX uses undocumented BCD support from libstand. | ||||
*/ | */ | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (check != now) | ||||
if (now < lasttime) | if (now < lasttime) | ||||
now += 24 * 3600; | now += 24 * 3600; | ||||
lasttime = now; | lasttime = now; | ||||
if (t != NULL) | if (t != NULL) | ||||
*t = now; | *t = now; | ||||
return(now); | return(now); | ||||
} | |||||
time_t | |||||
getsecs(void) | |||||
{ | |||||
time_t n = 0; | |||||
time(&n); | |||||
return n; | |||||
} | } | ||||
/* | /* | ||||
* Use the BIOS Wait function to pause for (period) microseconds. | * Use the BIOS Wait function to pause for (period) microseconds. | ||||
* | * | ||||
* Resolution of this function is variable, but typically around | * Resolution of this function is variable, but typically around | ||||
* 1ms. | * 1ms. | ||||
*/ | */ | ||||
Show All 10 Lines |