}
memset(&m, 0, sizeof(m));
- m.RTCDEV_TM = (char *) t;
- m.RTCDEV_FLAGS = flags;
+ m.m_lc_readclock_rtcdev.tm = (vir_bytes)t;
+ m.m_lc_readclock_rtcdev.flags = flags;
r = _syscall(ep, type, &m);
- if (r != RTCDEV_REPLY || m.RTCDEV_STATUS != 0) {
+ if (r != RTCDEV_REPLY || m.m_readclock_lc_rtcdev.status != 0) {
if (!quiet) errmsg("Call to readclock.drv failed\n");
exit(1);
}
return -1;
}
- m.RTCDEV_GRANT = gid;
- m.RTCDEV_FLAGS = flags;
+ m.m_lc_readclock_rtcdev.grant = gid;
+ m.m_lc_readclock_rtcdev.flags = flags;
r = _syscall(ep, type, &m);
cpf_revoke(gid);
- if (r != RTCDEV_REPLY || m.RTCDEV_STATUS != 0) {
+ if (r != RTCDEV_REPLY || m.m_readclock_lc_rtcdev.status != 0) {
log_warn(&log, "Call to '%s' failed.\n", target_label);
return -1;
}
switch (m.m_type) {
case RTCDEV_GET_TIME:
/* Any user can read the time */
- reply_status = rtc.get_time(&t, m.RTCDEV_FLAGS);
+ reply_status = rtc.get_time(&t, m.m_lc_readclock_rtcdev.flags);
if (reply_status != OK) {
break;
}
/* write results back to calling process */
reply_status =
- store_t(caller, (vir_bytes) m.RTCDEV_TM, &t);
+ store_t(caller, m.m_lc_readclock_rtcdev.tm, &t);
break;
case RTCDEV_SET_TIME:
if (getnuid(caller) == SUPER_USER) {
/* read time from calling process */
reply_status =
- fetch_t(caller, (vir_bytes) m.RTCDEV_TM,
+ fetch_t(caller, m.m_lc_readclock_rtcdev.tm,
&t);
if (reply_status != OK) {
break;
}
reply_status =
- rtc.set_time(&t, m.RTCDEV_FLAGS);
+ rtc.set_time(&t, m.m_lc_readclock_rtcdev.flags);
} else {
reply_status = EPERM;
}
/* Send Reply */
m.m_type = RTCDEV_REPLY;
- m.RTCDEV_STATUS = reply_status;
+ m.m_readclock_lc_rtcdev.status = reply_status;
log_debug(&log, "Sending Reply");
switch (m.m_type) {
case RTCDEV_GET_TIME_G:
/* Any user can read the time */
- reply_status = rtc_get_time(&t, m.RTCDEV_FLAGS);
+ reply_status = rtc_get_time(&t, m.m_lc_readclock_rtcdev.flags);
if (reply_status != OK) {
break;
}
/* write results back to calling process */
reply_status =
- store_t(caller, (cp_grant_id_t) m.RTCDEV_GRANT,
- &t);
+ store_t(caller, m.m_lc_readclock_rtcdev.grant, &t);
break;
case RTCDEV_SET_TIME_G:
/* read time from calling process */
reply_status =
fetch_t(caller,
- (cp_grant_id_t) m.RTCDEV_GRANT, &t);
+ m.m_lc_readclock_rtcdev.grant, &t);
if (reply_status != OK) {
break;
}
reply_status =
- rtc_set_time(&t, m.RTCDEV_FLAGS);
+ rtc_set_time(&t,
+ m.m_lc_readclock_rtcdev.flags);
} else {
reply_status = EPERM;
}
/* Send Reply */
m.m_type = RTCDEV_REPLY;
- m.RTCDEV_STATUS = reply_status;
+ m.m_readclock_lc_rtcdev.status = reply_status;
log_debug(&log, "Sending Reply");
/* Message types for real time clock responses. */
#define RTCDEV_REPLY (RTCDEV_RS_BASE + 0) /* general reply code */
-/* Field names for real time clock messages */
-#define RTCDEV_TM m2_p1 /* pointer to struct tm */
-#define RTCDEV_FLAGS m2_s1 /* clock flags flags */
-#define RTCDEV_STATUS m2_i2 /* OK or error code */
-#define RTCDEV_GRANT m2_i3 /* grant containing struct tm */
-
-/* Bits in 'RTCDEV_FLAGS' field of real time clock requests. */
+/* Bits in 'lc_readclock_rtcdev.flags' field of real time clock requests. */
#define RTCDEV_NOFLAGS 0x00 /* no flags are set */
#define RTCDEV_Y2KBUG 0x01 /* Interpret 1980 as 2000 for RTC w/Y2K bug */
#define RTCDEV_CMOSREG 0x02 /* Also set the CMOS clock register bits. */
} mess_lc_pm_time;
_ASSERT_MSG_SIZE(mess_lc_pm_time);
+typedef struct {
+ cp_grant_id_t grant;
+ vir_bytes tm; /* struct tm * */
+ int flags;
+
+ uint8_t padding[44];
+} mess_lc_readclock_rtcdev;
+_ASSERT_MSG_SIZE(mess_lc_readclock_rtcdev);
+
+typedef struct {
+ int status;
+
+ uint8_t padding[52];
+} mess_readclock_lc_rtcdev;
+_ASSERT_MSG_SIZE(mess_readclock_lc_rtcdev);
+
typedef struct {
time_t sec;
mess_lc_pm_sysuname m_lc_pm_sysuname;
mess_lc_pm_time m_lc_pm_time;
mess_lc_pm_waitpid m_lc_pm_waitpid;
+ mess_lc_readclock_rtcdev m_lc_readclock_rtcdev;
mess_lc_vfs_chown m_lc_vfs_chown;
mess_lc_vfs_close m_lc_vfs_close;
mess_pm_sched_scheduling_set_nice m_pm_sched_scheduling_set_nice;
+ mess_readclock_lc_rtcdev m_readclock_lc_rtcdev;
+
mess_rs_pm_exec_restart m_rs_pm_exec_restart;
mess_rs_pm_srv_kill m_rs_pm_srv_kill;