# define GET_REGS 24 /* get general process registers */
# define GET_RUSAGE 25 /* get resource usage */
-/* Field names for SYS_TIMES. */
-#define T_ENDPT m4_l1 /* process to request time info for */
-#define T_USER_TIME m4_l1 /* user time consumed by process */
-#define T_SYSTEM_TIME m4_l2 /* system time consumed by process */
#define T_BOOTTIME m4_ll1 /* Boottime in seconds (also for SYS_STIME) */
-#define T_REAL_TICKS m4_l4 /* number of wall clock ticks since boottime */
-#define T_BOOT_TICKS m4_l5 /* number of hard clock ticks since boottime */
/* Field names for SYS_SETTIME. */
#define T_SETTIME_NOW m4_l2 /* non-zero for immediate, 0 for adjtime */
} mess_lsys_krn_sys_setalarm;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_setalarm);
+typedef struct {
+ endpoint_t endpt;
+
+ uint8_t padding[52];
+} mess_lsys_krn_sys_times;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_times);
+
+typedef struct {
+ clock_t real_ticks;
+ clock_t boot_ticks;
+ clock_t boot_time;
+ clock_t user_time;
+ clock_t system_time;
+
+ uint8_t padding[36];
+} mess_krn_lsys_sys_times;
+_ASSERT_MSG_SIZE(mess_krn_lsys_sys_times);
+
typedef struct {
endpoint_t src_endpt;
int segment;
mess_krn_lsys_schedule m_krn_lsys_schedule;
mess_krn_lsys_sys_getwhoami m_krn_lsys_sys_getwhoami;
mess_krn_lsys_sys_irqctl m_krn_lsys_sys_irqctl;
+ mess_krn_lsys_sys_times m_krn_lsys_sys_times;
mess_krn_lsys_sys_umap m_krn_lsys_sys_umap;
mess_krn_lsys_sys_vumap m_krn_lsys_sys_vumap;
mess_lsys_krn_sys_memset m_lsys_krn_sys_memset;
mess_lsys_krn_sys_sdevio m_lsys_krn_sys_sdevio;
mess_lsys_krn_sys_setalarm m_lsys_krn_sys_setalarm;
+ mess_lsys_krn_sys_times m_lsys_krn_sys_times;
mess_lsys_krn_sys_umap m_lsys_krn_sys_umap;
mess_lsys_krn_sys_vdevio m_lsys_krn_sys_vdevio;
mess_lsys_krn_sys_vumap m_lsys_krn_sys_vumap;
* m_type: SYS_TIMES
*
* The parameters for this kernel call are:
- * m4_l1: T_ENDPT (get info for this process)
- * m4_l1: T_USER_TIME (return values ...)
- * m4_l2: T_SYSTEM_TIME
- * m4_ll1: T_BOOTTIME
- * m4_l5: T_BOOT_TICKS
+ * m_lsys_krn_sys_times.endpt (get info for this process)
+ * m_krn_lsys_sys_times.user_time (return values ...)
+ * m_krn_lsys_sys_times.system_time
+ * m_krn_lsys_sys_times.boot_time
+ * m_krn_lsys_sys_times.boot_ticks
+ * m_krn_lsys_sys_times.real_ticks
*/
#include "kernel/system.h"
* The clock's interrupt handler may run to update the user or system time
* while in this code, but that cannot do any harm.
*/
- e_proc_nr = (m_ptr->T_ENDPT == SELF) ? caller->p_endpoint : m_ptr->T_ENDPT;
+ e_proc_nr = (m_ptr->m_lsys_krn_sys_times.endpt == SELF) ?
+ caller->p_endpoint : m_ptr->m_lsys_krn_sys_times.endpt;
if(e_proc_nr != NONE && isokendpt(e_proc_nr, &proc_nr)) {
rp = proc_addr(proc_nr);
- m_ptr->T_USER_TIME = rp->p_user_time;
- m_ptr->T_SYSTEM_TIME = rp->p_sys_time;
+ m_ptr->m_krn_lsys_sys_times.user_time = rp->p_user_time;
+ m_ptr->m_krn_lsys_sys_times.system_time = rp->p_sys_time;
}
- m_ptr->T_BOOT_TICKS = get_monotonic();
- m_ptr->T_REAL_TICKS = get_realtime();
- m_ptr->T_BOOTTIME = boottime;
+ m_ptr->m_krn_lsys_sys_times.boot_ticks = get_monotonic();
+ m_ptr->m_krn_lsys_sys_times.real_ticks = get_realtime();
+ m_ptr->m_krn_lsys_sys_times.boot_time = boottime;
return(OK);
}
#endif /* USE_TIMES */
-
* 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);
}
-
-
-
-
-
* 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);
}
-
-
-
-
-
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);
}