Message type for SYS_TIMES

Change-Id: Ia408aa7d76c47da9f600a724f82b347ba6ac641b
This commit is contained in:
2014-05-22 11:32:14 +02:00
parent dcb7493a05
commit 1ca0b449b2
6 changed files with 49 additions and 44 deletions

View File

@@ -2,11 +2,12 @@
* 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"
@@ -29,17 +30,17 @@ int do_times(struct proc * caller, message * m_ptr)
* 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 */