Changeset ea5cc5b in mainline
- Timestamp:
- 2012-08-12T18:24:56Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 43e660c
- Parents:
- db80a2e
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/time/cmos-rtc/cmos-rtc.c
rdb80a2e rea5cc5b 297 297 rtc_t *rtc = RTC_FROM_FNODE(fun); 298 298 299 if (boottime != 0) { 300 /* There is no need to read the current time from the 301 * device because it has already been cached. 302 */ 303 304 time_t cur_time = boottime + uptime_get(); 305 *t = *gmtime(&cur_time); 306 return EOK; 307 } 308 299 309 fibril_mutex_lock(&rtc->mutex); 300 310 … … 366 376 /* Try to normalize the content of the tm structure */ 367 377 time_t r = mktime(t); 378 379 boottime = r - uptime_get(); 368 380 369 381 return r < 0 ? EINVAL : EOK; … … 578 590 rtc_t *rtc = RTC_FROM_FNODE(fun); 579 591 bool batt_ok; 580 sysarg_t r = EOK;581 592 582 593 switch (method) { … … 586 597 RTC_D_BATTERY_OK; 587 598 async_answer_1(callid, EOK, batt_ok); 588 break;589 case CLOCK_GET_BOOTTIME:590 /* Get the boot time */591 if (boottime == 0) {592 struct tm cur_tm;593 time_t uptime;594 595 uptime = uptime_get();596 r = rtc_time_get(fun, &cur_tm);597 if (r == EOK) {598 time_t current_time = mktime(&cur_tm);599 if (current_time < uptime)600 r = EINVAL;601 else602 boottime = current_time - uptime;603 }604 }605 async_answer_1(callid, r, boottime);606 599 break; 607 600 default: -
uspace/lib/c/include/ipc/clock_ctl.h
rdb80a2e rea5cc5b 34 34 typedef enum { 35 35 CLOCK_GET_BATTERY_STATUS = DEV_FIRST_CUSTOM_METHOD, 36 CLOCK_GET_BOOTTIME,37 36 } clock_ctl_t; 38 37
Note:
See TracChangeset
for help on using the changeset viewer.