Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
ID(sys_mprotect) \
\
ID(sys_statvfs) \
ID(sys_uname)
ID(sys_uname) \
\
ID(getThreadCpuTime)

/* parasoft-end-suppress MISRAC2012-RULE_20_7-a */
/* clang-format on */

Expand Down
6 changes: 6 additions & 0 deletions proc/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,12 @@ int proc_threadsOther(thread_t *t)
}


time_t threads_getCpuTime(thread_t *t)
{
return t->cpuTime;
}


int _threads_init(vm_map_t *kmap, vm_object_t *kernel)
{
unsigned int i;
Expand Down
3 changes: 3 additions & 0 deletions proc/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ time_t proc_uptime(void);
void proc_gettime(time_t *raw, time_t *offs);


extern time_t threads_getCpuTime(thread_t *t);


int proc_settime(time_t offs);


Expand Down
6 changes: 6 additions & 0 deletions syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ int syscalls_priority(u8 *ustack)
}


time_t syscalls_getThreadCpuTime(void *ustack)
{
return threads_getCpuTime(proc_current());
}


/*
* System state info
*/
Expand Down
Loading