Fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5141 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -173,7 +173,7 @@ cmos_to_secs(const cmos_time *cmos)
|
|||||||
{
|
{
|
||||||
uint32 wholeYear;
|
uint32 wholeYear;
|
||||||
uint32 time = 0;
|
uint32 time = 0;
|
||||||
int i;
|
uint32 i;
|
||||||
|
|
||||||
wholeYear = bcd_to_int(cmos->century) * 100 + bcd_to_int(cmos->year);
|
wholeYear = bcd_to_int(cmos->century) * 100 + bcd_to_int(cmos->year);
|
||||||
|
|
||||||
@@ -206,7 +206,6 @@ secs_to_cmos(uint32 seconds, cmos_time *cmos)
|
|||||||
uint32 secsThisYear;
|
uint32 secsThisYear;
|
||||||
bool keepLooping;
|
bool keepLooping;
|
||||||
bool isLeapYear;
|
bool isLeapYear;
|
||||||
int i;
|
|
||||||
int temp;
|
int temp;
|
||||||
int month;
|
int month;
|
||||||
|
|
||||||
|
|||||||
@@ -15,46 +15,6 @@
|
|||||||
static bigtime_t sBootTime;
|
static bigtime_t sBootTime;
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
rtc_print(void)
|
|
||||||
{
|
|
||||||
uint32 currentTime;
|
|
||||||
|
|
||||||
currentTime = (sBootTime + system_time()) / 1000000;
|
|
||||||
dprintf("system_time: %u\n", (unsigned)system_time());
|
|
||||||
dprintf("boot_time: %u\n", (unsigned)sBootTime);
|
|
||||||
dprintf("current_time: %u\n", (unsigned)currentTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
rtc_debug(int argc, char **argv)
|
|
||||||
{
|
|
||||||
if (argc < 2) {
|
|
||||||
// If no arguments were given, output all usefull data.
|
|
||||||
rtc_print();
|
|
||||||
} else {
|
|
||||||
// If there was an argument, reset the system and hw time.
|
|
||||||
rtc_set_system_time(strtoul(argv[1], NULL, 10));
|
|
||||||
rtc_system_to_hw();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
rtc_init(kernel_args *ka)
|
|
||||||
{
|
|
||||||
//dprintf("rtc_init: entry\n");
|
|
||||||
add_debugger_command("rtc", &rtc_debug, "Set and test the real-time clock");
|
|
||||||
|
|
||||||
rtc_hw_to_system();
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
rtc_set_system_time(uint32 current_time)
|
rtc_set_system_time(uint32 current_time)
|
||||||
{
|
{
|
||||||
@@ -94,3 +54,44 @@ rtc_boot_time(void)
|
|||||||
{
|
{
|
||||||
return sBootTime;
|
return sBootTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
rtc_print(void)
|
||||||
|
{
|
||||||
|
uint32 currentTime;
|
||||||
|
|
||||||
|
currentTime = (sBootTime + system_time()) / 1000000;
|
||||||
|
dprintf("system_time: %u\n", (unsigned)system_time());
|
||||||
|
dprintf("boot_time: %u\n", (unsigned)sBootTime);
|
||||||
|
dprintf("current_time: %u\n", (unsigned)currentTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
rtc_debug(int argc, char **argv)
|
||||||
|
{
|
||||||
|
if (argc < 2) {
|
||||||
|
// If no arguments were given, output all usefull data.
|
||||||
|
rtc_print();
|
||||||
|
} else {
|
||||||
|
// If there was an argument, reset the system and hw time.
|
||||||
|
rtc_set_system_time(strtoul(argv[1], NULL, 10));
|
||||||
|
rtc_system_to_hw();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
rtc_init(kernel_args *ka)
|
||||||
|
{
|
||||||
|
//dprintf("rtc_init: entry\n");
|
||||||
|
add_debugger_command("rtc", &rtc_debug, "Set and test the real-time clock");
|
||||||
|
|
||||||
|
rtc_hw_to_system();
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user