#define NR_PM_CALLS 48 /* highest number from base plus one */
-/* Field names for the kill(2), srv_kill(2), and sigaction(2) calls. */
-#define PM_SIG_PID m1_i1 /* pid_t */
-#define PM_SIG_NR m1_i2 /* int */
-#define PM_SIG_ACT m1_p1 /* const struct sigaction * */
-#define PM_SIG_OACT m1_p2 /* struct sigaction * */
-#define PM_SIG_RET m1_p3 /* int (*)(void) */
-
/*===========================================================================*
* Calls to VFS *
*===========================================================================*/
} mess_lc_pm_sysuname;
_ASSERT_MSG_SIZE(mess_lc_pm_sysuname);
+typedef struct {
+ pid_t pid;
+ int nr;
+ vir_bytes act; /* const struct sigaction * */
+ vir_bytes oact; /* struct sigaction * */
+ vir_bytes ret; /* int (*)(void) */
+
+ uint8_t padding[36];
+} mess_lc_pm_sig;
+_ASSERT_MSG_SIZE(mess_lc_pm_sig);
+
typedef struct {
int how;
vir_bytes ctx;
mess_lc_pm_reboot m_lc_pm_reboot;
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_pm_sigset m_lc_pm_sigset;
mess_lc_pm_sysuname m_lc_pm_sysuname;
mess_lc_pm_time m_lc_pm_time;
message m;
memset(&m, 0, sizeof(m));
- m.PM_SIG_NR = sig;
- m.PM_SIG_ACT = (char *) __UNCONST(act);
- m.PM_SIG_OACT = (char *) oact;
- m.PM_SIG_RET = (char *) __sigreturn;
+ m.m_lc_pm_sig.nr = sig;
+ m.m_lc_pm_sig.act = (vir_bytes)act;
+ m.m_lc_pm_sig.oact = (vir_bytes)oact;
+ m.m_lc_pm_sig.ret = (vir_bytes)__sigreturn;
return(_syscall(PM_PROC_NR, PM_SIGACTION, &m));
}
assert(!(mp->mp_flags & (PROC_STOPPED | VFS_CALL | UNPAUSED)));
- sig_nr = m_in.PM_SIG_NR;
+ sig_nr = m_in.m_lc_pm_sig.nr;
if (sig_nr == SIGKILL) return(OK);
if (sig_nr < 1 || sig_nr >= _NSIG) return(EINVAL);
svp = &mp->mp_sigact[sig_nr];
- if ((struct sigaction *) m_in.PM_SIG_OACT != (struct sigaction *) NULL) {
+ if (m_in.m_lc_pm_sig.oact != 0) {
r = sys_datacopy(PM_PROC_NR,(vir_bytes) svp, who_e,
- (vir_bytes) m_in.PM_SIG_OACT, (phys_bytes) sizeof(svec));
+ m_in.m_lc_pm_sig.oact, (phys_bytes) sizeof(svec));
if (r != OK) return(r);
}
- if ((struct sigaction *) m_in.PM_SIG_ACT == (struct sigaction *) NULL)
+ if (m_in.m_lc_pm_sig.act == 0)
return(OK);
/* Read in the sigaction structure. */
- r = sys_datacopy(who_e, (vir_bytes) m_in.PM_SIG_ACT,
- PM_PROC_NR, (vir_bytes) &svec, (phys_bytes) sizeof(svec));
+ r = sys_datacopy(who_e, m_in.m_lc_pm_sig.act, PM_PROC_NR, (vir_bytes) &svec,
+ (phys_bytes) sizeof(svec));
if (r != OK) return(r);
if (svec.sa_handler == SIG_IGN) {
sigdelset(&svec.sa_mask, SIGSTOP);
mp->mp_sigact[sig_nr].sa_mask = svec.sa_mask;
mp->mp_sigact[sig_nr].sa_flags = svec.sa_flags;
- mp->mp_sigreturn = (vir_bytes) m_in.PM_SIG_RET;
+ mp->mp_sigreturn = m_in.m_lc_pm_sig.ret;
return(OK);
}
{
/* Perform the kill(pid, signo) system call. */
- return check_sig(m_in.PM_SIG_PID, m_in.PM_SIG_NR, FALSE /* ksig */);
+ return check_sig(m_in.m_lc_pm_sig.pid, m_in.m_lc_pm_sig.nr, FALSE /* ksig */);
}
/*===========================================================================*