#define SVRCTL_REQ m2_i1 /* int */
#define SVRCTL_ARG m2_p1 /* void * */
-/* Field names for the getrusage(2) call. */
-#define RU_ENDPT m1_i1 /* endpoint_t */
-#define RU_WHO m1_i1 /* int */
-#define RU_RUSAGE_ADDR m1_p1 /* struct rusage * */
-
/*===========================================================================*
* Internal codes used by several services *
*===========================================================================*/
} mess_lc_pm_reboot;
_ASSERT_MSG_SIZE(mess_lc_pm_reboot);
+typedef struct {
+ endpoint_t who;
+ vir_bytes addr;
+
+ uint8_t padding[48];
+} mess_lc_pm_rusage;
+_ASSERT_MSG_SIZE(mess_lc_pm_rusage);
+
typedef struct {
gid_t gid;
} mess_lc_vfs_readwrite;
_ASSERT_MSG_SIZE(mess_lc_vfs_readwrite);
+typedef struct {
+ vir_bytes addr;
+
+ uint8_t padding[52];
+} mess_lc_vfs_rusage;
+_ASSERT_MSG_SIZE(mess_lc_vfs_rusage);
+
typedef struct {
uint32_t nfds;
fd_set *readfds;
} mess_lc_vfs_umount;
_ASSERT_MSG_SIZE(mess_lc_vfs_umount);
+typedef struct {
+ vir_bytes addr;
+
+ uint8_t padding[52];
+} mess_lc_vm_rusage;
+_ASSERT_MSG_SIZE(mess_lc_vm_rusage);
+
typedef struct {
endpoint_t endpt;
vir_bytes ptr; /* struct exec_info * */
mess_lc_pm_priority m_lc_pm_priority;
mess_lc_pm_ptrace m_lc_pm_ptrace;
mess_lc_pm_reboot m_lc_pm_reboot;
+ mess_lc_pm_rusage m_lc_pm_rusage;
mess_lc_pm_setgid m_lc_pm_setgid;
mess_lc_pm_setuid m_lc_pm_setuid;
mess_lc_pm_sig m_lc_pm_sig;
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
mess_lc_vfs_readlink m_lc_vfs_readlink;
mess_lc_vfs_readwrite m_lc_vfs_readwrite;
+ mess_lc_vfs_rusage m_lc_vfs_rusage;
mess_lc_vfs_select m_lc_vfs_select;
mess_lc_vfs_stat m_lc_vfs_stat;
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
mess_lc_vfs_umask m_lc_vfs_umask;
mess_lc_vfs_umount m_lc_vfs_umount;
+ mess_lc_vm_rusage m_lc_vm_rusage;
+
mess_lexec_pm_exec_new m_lexec_pm_exec_new;
mess_li2cdriver_i2c_busc_i2c_exec m_li2cdriver_i2c_busc_i2c_exec;
message m;
memset(&m, 0, sizeof(m));
- m.RU_WHO = who;
- m.RU_RUSAGE_ADDR = (char *) r_usage;
+ m.m_lc_pm_rusage.who = who;
+ m.m_lc_pm_rusage.addr = (vir_bytes)r_usage;
if (r_usage == NULL) {
errno = EFAULT;
return rc;
memset(&m, 0, sizeof(m));
- m.RU_RUSAGE_ADDR = (char *) r_usage;
+ m.m_lc_vfs_rusage.addr = (vir_bytes)r_usage;
if ((rc = _syscall(VFS_PROC_NR, VFS_GETRUSAGE, &m)) < 0)
return rc;
memset(&m, 0, sizeof(m));
- m.RU_RUSAGE_ADDR = (char *) r_usage;
+ m.m_lc_vm_rusage.addr = (vir_bytes)r_usage;
return _syscall(VM_PROC_NR, VM_GETRUSAGE, &m);
}
clock_t sys_time = 0;
struct rusage r_usage;
u64_t usec;
- if (m_in.RU_WHO != RUSAGE_SELF && m_in.RU_WHO != RUSAGE_CHILDREN)
+ if (m_in.m_lc_pm_rusage.who != RUSAGE_SELF &&
+ m_in.m_lc_pm_rusage.who != RUSAGE_CHILDREN)
return EINVAL;
if ((res = sys_getrusage(&r_usage, who_e)) < 0)
return res;
- if (m_in.RU_WHO == RUSAGE_CHILDREN) {
+ if (m_in.m_lc_pm_rusage.who == RUSAGE_CHILDREN) {
usec = mp->mp_child_utime * 1000000 / sys_hz();
r_usage.ru_utime.tv_sec = usec / 1000000;
r_usage.ru_utime.tv_usec = usec % 1000000;
r_usage.ru_stime.tv_usec = usec % 1000000;
}
- return sys_datacopy(SELF, (vir_bytes) &r_usage, who_e,
- (vir_bytes) m_in.RU_RUSAGE_ADDR, (vir_bytes) sizeof(r_usage));
+ return sys_datacopy(SELF, (vir_bytes)&r_usage, who_e,
+ m_in.m_lc_pm_rusage.addr, (vir_bytes) sizeof(r_usage));
}
int res;
struct rusage r_usage;
- if ((res = sys_datacopy_wrapper(who_e, (vir_bytes) m_in.RU_RUSAGE_ADDR, SELF,
+ if ((res = sys_datacopy_wrapper(who_e, m_in.m_lc_vfs_rusage.addr, SELF,
(vir_bytes) &r_usage, (vir_bytes) sizeof(r_usage))) < 0)
return res;
r_usage.ru_isrss = DEFAULT_STACK_LIMIT;
return sys_datacopy_wrapper(SELF, (vir_bytes) &r_usage, who_e,
- (vir_bytes) m_in.RU_RUSAGE_ADDR, (phys_bytes) sizeof(r_usage));
+ m_in.m_lc_vfs_rusage.addr, (phys_bytes) sizeof(r_usage));
}
vmp = &vmproc[slot];
- if ((res = sys_datacopy(m->m_source, (vir_bytes) m->RU_RUSAGE_ADDR,
+ if ((res = sys_datacopy(m->m_source, m->m_lc_vm_rusage.addr,
SELF, (vir_bytes) &r_usage, (vir_bytes) sizeof(r_usage))) < 0)
return res;
r_usage.ru_majflt = vmp->vm_major_page_fault;
return sys_datacopy(SELF, (vir_bytes) &r_usage, m->m_source,
- (vir_bytes) m->RU_RUSAGE_ADDR, (vir_bytes) sizeof(r_usage));
+ m->m_lc_vm_rusage.addr, (vir_bytes) sizeof(r_usage));
}