From: Lionel Sambuc Date: Wed, 27 Nov 2013 11:01:26 +0000 (+0100) Subject: PM_TIME_SEC into 64bit X-Git-Tag: v3.3.0~492 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch10.html?a=commitdiff_plain;h=4a0199d66d90eb674b9d8740f80a4551bd069a79;p=minix.git PM_TIME_SEC into 64bit Change-Id: I609ee8cac7aae8af2c0c0381710433a5df0caebd --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 40459736d..d6910d954 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -82,7 +82,7 @@ */ #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 */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 3290a9dcf..276434430 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -25,12 +25,13 @@ typedef struct { _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); @@ -206,6 +207,7 @@ typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ?1 : -1]; #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 diff --git a/lib/libc/sys-minix/adjtime.c b/lib/libc/sys-minix/adjtime.c index a8526e411..2aaa17b67 100644 --- a/lib/libc/sys-minix/adjtime.c +++ b/lib/libc/sys-minix/adjtime.c @@ -17,8 +17,8 @@ int adjtime(const struct timeval *delta, struct timeval *olddelta) 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; diff --git a/lib/libc/sys-minix/clock_getres.c b/lib/libc/sys-minix/clock_getres.c index c25da3efd..3e58be7c6 100644 --- a/lib/libc/sys-minix/clock_getres.c +++ b/lib/libc/sys-minix/clock_getres.c @@ -14,7 +14,7 @@ int clock_getres(clockid_t clock_id, struct timespec *res) 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; diff --git a/lib/libc/sys-minix/clock_gettime.c b/lib/libc/sys-minix/clock_gettime.c index 9a3f98ca6..bef4a063a 100644 --- a/lib/libc/sys-minix/clock_gettime.c +++ b/lib/libc/sys-minix/clock_gettime.c @@ -14,13 +14,13 @@ int clock_gettime(clockid_t clock_id, struct timespec *res) 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; } diff --git a/lib/libc/sys-minix/clock_settime.c b/lib/libc/sys-minix/clock_settime.c index 4e0e3a510..0b18ef5c3 100644 --- a/lib/libc/sys-minix/clock_settime.c +++ b/lib/libc/sys-minix/clock_settime.c @@ -14,10 +14,10 @@ int clock_settime(clockid_t clock_id, const struct timespec *ts) 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; diff --git a/lib/libc/sys-minix/stime.c b/lib/libc/sys-minix/stime.c index 1f9d1c653..42d255ca2 100644 --- a/lib/libc/sys-minix/stime.c +++ b/lib/libc/sys-minix/stime.c @@ -14,6 +14,6 @@ int stime(time_t *top) 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)); } diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 55ceef3fc..9f5f0e743 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -661,7 +661,7 @@ register struct mproc *child; /* tells which process is exiting */ 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; diff --git a/servers/pm/time.c b/servers/pm/time.c index cac0c48c0..dcc610fd0 100644 --- a/servers/pm/time.c +++ b/servers/pm/time.c @@ -38,8 +38,7 @@ int do_gettime() 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); @@ -102,8 +101,7 @@ int do_time() 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); @@ -126,7 +124,7 @@ int do_stime() } 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)