*/
#define PM_TIME_CLK_ID m2_i1 /* clockid_t */
#define PM_TIME_NOW m2_i2 /* int */
-#define PM_TIME_SEC m2_l1 /* time_t */
+#define PM_TIME_SEC m2_ll1 /* time_t */
#define PM_TIME_USEC m2_l2 /* long */
#define PM_TIME_NSEC m2_l2 /* long */
_ASSERT_MSG_SIZE(mess_1);
typedef struct {
+ int64_t m2ll1;
int m2i1, m2i2, m2i3;
long m2l1, m2l2;
char *m2p1;
sigset_t sigset;
short m2s1;
- uint8_t padding[14];
+ uint8_t padding[6];
} mess_2;
_ASSERT_MSG_SIZE(mess_2);
#define m1_p4 m_u.m_m1.m1p4
#define m1_ull1 m_u.m_m1.m1ull1
+#define m2_ll1 m_u.m_m2.m2ll1
#define m2_i1 m_u.m_m2.m2i1
#define m2_i2 m_u.m_m2.m2i2
#define m2_i3 m_u.m_m2.m2i3
memset(&m, 0, sizeof(m));
m.PM_TIME_CLK_ID = (clockid_t) CLOCK_REALTIME;
m.PM_TIME_NOW = 0; /* use adjtime() method to slowly adjust the clock. */
- m.PM_TIME_SEC = (int32_t)delta->tv_sec;
- m.PM_TIME_NSEC = (int32_t)delta->tv_usec * 1000; /* convert usec to nsec */
+ m.PM_TIME_SEC = delta->tv_sec;
+ m.PM_TIME_NSEC = delta->tv_usec * 1000; /* convert usec to nsec */
if (_syscall(PM_PROC_NR, PM_CLOCK_SETTIME, &m) < 0)
return -1;
message m;
memset(&m, 0, sizeof(m));
- m.PM_TIME_CLK_ID = (clockid_t) clock_id;
+ m.PM_TIME_CLK_ID = clock_id;
if (_syscall(PM_PROC_NR, PM_CLOCK_GETRES, &m) < 0)
return -1;
message m;
memset(&m, 0, sizeof(m));
- m.PM_TIME_CLK_ID = (clockid_t) clock_id;
+ m.PM_TIME_CLK_ID = clock_id;
if (_syscall(PM_PROC_NR, PM_CLOCK_GETTIME, &m) < 0)
return -1;
- res->tv_sec = (time_t) m.PM_TIME_SEC;
- res->tv_nsec = (long) m.PM_TIME_USEC;
+ res->tv_sec = m.PM_TIME_SEC;
+ res->tv_nsec = m.PM_TIME_NSEC;
return 0;
}
message m;
memset(&m, 0, sizeof(m));
- m.PM_TIME_CLK_ID = (clockid_t) clock_id;
+ m.PM_TIME_CLK_ID = clock_id;
m.PM_TIME_NOW = 1; /* set time immediately. don't use adjtime() method. */
- m.PM_TIME_SEC = (time_t) ts->tv_sec;
- m.PM_TIME_NSEC = (long) ts->tv_nsec;
+ m.PM_TIME_SEC = ts->tv_sec;
+ m.PM_TIME_NSEC = ts->tv_nsec;
if (_syscall(PM_PROC_NR, PM_CLOCK_SETTIME, &m) < 0)
return -1;
message m;
memset(&m, 0, sizeof(m));
- m.PM_TIME_SEC = (long)*top;
+ m.PM_TIME_SEC = *top;
return(_syscall(PM_PROC_NR, PM_STIME, &m));
}
static void tell_tracer(child)
struct mproc *child; /* tells which process is exiting */
{
- int exitstatus, mp_tracer;
+ int mp_tracer;
struct mproc *tracer;
mp_tracer = child->mp_tracer;
return EINVAL; /* invalid/unsupported clock_id */
}
- /* For now simply truncate time to a 32b value. */
- mp->mp_reply.PM_TIME_SEC = (int32_t) (boottime + (clock / system_hz));
+ mp->mp_reply.PM_TIME_SEC = boottime + (clock / system_hz);
mp->mp_reply.PM_TIME_NSEC =
(uint32_t) ((clock % system_hz) * 1000000000ULL / system_hz);
if ( (s=getuptime(&ticks, &realtime, &boottime)) != OK)
panic("do_time couldn't get uptime: %d", s);
- /* For now simply truncate time to a 32b value. */
- mp->mp_reply.PM_TIME_SEC = (int32_t) (boottime + (realtime / system_hz));
+ mp->mp_reply.PM_TIME_SEC = boottime + (realtime / system_hz);
mp->mp_reply.PM_TIME_USEC =
(uint32_t) ((realtime % system_hz) * 1000000ULL / system_hz);
return(OK);
}
if ( (s=getuptime(&uptime, &realtime, &boottime)) != OK)
panic("do_stime couldn't get uptime: %d", s);
- boottime = (time_t)m_in.PM_TIME_SEC - (realtime/system_hz);
+ boottime = m_in.PM_TIME_SEC - (realtime/system_hz);
s= sys_stime(boottime); /* Tell kernel about boottime */
if (s != OK)