Message type for SYS_TIMES

Change-Id: Ia408aa7d76c47da9f600a724f82b347ba6ac641b
This commit is contained in:
2014-07-28 17:05:47 +02:00
parent dcb7493a05
commit 1ca0b449b2
6 changed files with 49 additions and 44 deletions
+4 -9
View File
@@ -4,19 +4,14 @@
* getuptime *
*===========================================================================*/
int getticks(ticks)
clock_t *ticks; /* monotonic time in ticks */
clock_t *ticks; /* monotonic time in ticks */
{
message m;
int s;
m.m_type = SYS_TIMES; /* request time information */
m.T_ENDPT = NONE; /* ignore process times */
m.m_type = SYS_TIMES; /* request time information */
m.m_lsys_krn_sys_times.endpt = NONE; /* ignore process times */
s = _kernel_call(SYS_TIMES, &m);
*ticks = m.T_BOOT_TICKS;
*ticks = m.m_krn_lsys_sys_times.boot_ticks;
return(s);
}
+7 -12
View File
@@ -4,23 +4,18 @@
* getuptime *
*===========================================================================*/
int getuptime(ticks, realtime, boottime)
clock_t *ticks; /* monotonic time in ticks */
clock_t *realtime; /* wall time in ticks */
clock_t *ticks; /* monotonic time in ticks */
clock_t *realtime; /* wall time in ticks */
time_t *boottime;
{
message m;
int s;
m.m_type = SYS_TIMES; /* request time information */
m.T_ENDPT = NONE; /* ignore process times */
m.m_type = SYS_TIMES; /* request time information */
m.m_lsys_krn_sys_times.endpt = NONE; /* ignore process times */
s = _kernel_call(SYS_TIMES, &m);
*ticks = m.T_BOOT_TICKS;
*realtime = m.T_REAL_TICKS;
*boottime = m.T_BOOTTIME;
*ticks = m.m_krn_lsys_sys_times.boot_ticks;
*realtime = m.m_krn_lsys_sys_times.real_ticks;
*boottime = m.m_krn_lsys_sys_times.boot_time;
return(s);
}
+5 -5
View File
@@ -13,11 +13,11 @@ time_t *boottime; /* boot time */
message m;
int r;
m.T_ENDPT = proc_ep;
m.m_lsys_krn_sys_times.endpt = proc_ep;
r = _kernel_call(SYS_TIMES, &m);
if (user_time) *user_time = m.T_USER_TIME;
if (sys_time) *sys_time = m.T_SYSTEM_TIME;
if (uptime) *uptime = m.T_BOOT_TICKS;
if (boottime) *boottime = m.T_BOOTTIME;
if (user_time) *user_time = m.m_krn_lsys_sys_times.user_time;
if (sys_time) *sys_time = m.m_krn_lsys_sys_times.system_time;
if (uptime) *uptime = m.m_krn_lsys_sys_times.boot_ticks;
if (boottime) *boottime = m.m_krn_lsys_sys_times.boot_time;
return(r);
}