#define SG_ADDR m2_p1 /* address */
#define SG_SIZE m2_i2 /* no. of entries */
-/* Field names for SYS_GETKSIG, _ENDKSIG, _KILL, _SIGSEND, _SIGRETURN. */
-#define SYS_SIG_ENDPT m_sigcalls.ep /* process number for inform */
-#define SYS_SIG_NUMBER m_sigcalls.sig /* signal number to send */
-#define SYS_SIG_FLAGS m_sigcalls.flags /* signal flags field */
-#define SYS_SIG_MAP m_sigcalls.sigs /* used to pass signal bit map */
-#define SYS_SIG_CTXT_PTR m_sigcalls.sigctx /* pointer to signal context */
-#define SYS_SIG_HOW m_sigcalls.how /* used to pass signal bit map */
-
/* Field names for SYS_FORK, _EXEC, _EXIT, GETMCONTEXT, SETMCONTEXT.*/
#define PR_ENDPT m1_i1 /* indicates a process */
#define PR_PRIORITY m1_i2 /* process priority */
} mess_2;
_ASSERT_MSG_SIZE(mess_2);
-typedef struct {
- endpoint_t ep;
- int sig;
- u32_t flags;
- sigset_t sigs;
- void *sigctx;
- int how;
- uint8_t padding[20];
-} mess_sigcalls;
-_ASSERT_MSG_SIZE(mess_sigcalls);
-
typedef struct {
int m3i1, m3i2;
char *m3p1;
} mess_notify;
_ASSERT_MSG_SIZE(mess_notify);
+/* For SYS_GETKSIG, _ENDKSIG, _KILL, _SIGSEND, _SIGRETURN. */
+typedef struct {
+ sigset_t map; /* used to pass signal bit map */
+ endpoint_t endpt; /* process number for inform */
+ int sig; /* signal number to send */
+ void *sigctx; /* pointer to signal context */
+ uint8_t padding[28];
+} mess_sigcalls;
+_ASSERT_MSG_SIZE(mess_sigcalls);
+
typedef struct {
off_t offset;
dev_t dev;
mess_11 m_m11;
mess_mmap m_mmap;
mess_notify m_notify;
+ mess_sigcalls m_sigcalls;
mess_vm_vfs_mmap m_vm_vfs_mmap;
mess_vmmcp m_vmmcp;
mess_vmmcp_reply m_vmmcp_reply;
- mess_sigcalls m_sigcalls; /* SYS_{GETKSIG,ENDKSIG,KILL,SIGSEND,SIGRETURN} */
u8_t size[56]; /* message payload may have 56 bytes at most */
};
} message __aligned(16);
/* The kernel call that is implemented in this file:
- * m_type: SYS_ENDKSIG
+ * m_type: SYS_ENDKSIG
*
* The parameters for this kernel call are:
- * m2_i1: SIG_ENDPT # process for which PM is done
+ * m_sigcalls.endpt # process for which PM is done
*/
#include "kernel/system.h"
/* Get process pointer and verify that it had signals pending. If the
* process is already dead its flags will be reset.
*/
- if(!isokendpt(m_ptr->SYS_SIG_ENDPT, &proc_nr))
+ if(!isokendpt(m_ptr->m_sigcalls.endpt, &proc_nr))
return EINVAL;
rp = proc_addr(proc_nr);
/* The kernel call that is implemented in this file:
- * m_type: SYS_GETKSIG
+ * m_type: SYS_GETKSIG
*
* The parameters for this kernel call are:
- * m2_i1: SYS_SIG_ENDPT # process with pending signals
- * m2_l1: SYS_SIG_MAP # bit map with pending signals
+ * m_sigcalls.endpt # process with pending signals
+ * m_sigcalls.map # bit map with pending signals
*/
#include "kernel/system.h"
if (RTS_ISSET(rp, RTS_SIGNALED)) {
if (caller->p_endpoint != priv(rp)->s_sig_mgr) continue;
/* store signaled process' endpoint */
- m_ptr->SYS_SIG_ENDPT = rp->p_endpoint;
- m_ptr->SYS_SIG_MAP = rp->p_pending; /* pending signals map */
+ m_ptr->m_sigcalls.endpt = rp->p_endpoint;
+ m_ptr->m_sigcalls.map = rp->p_pending; /* pending signals map */
(void) sigemptyset(&rp->p_pending); /* clear map in the kernel */
RTS_UNSET(rp, RTS_SIGNALED); /* blocked by SIG_PENDING */
return(OK);
}
/* No process with pending signals was found. */
- m_ptr->SYS_SIG_ENDPT = NONE;
+ m_ptr->m_sigcalls.endpt = NONE;
return(OK);
}
#endif /* USE_GETKSIG */
-
/* The kernel call that is implemented in this file:
- * m_type: SYS_KILL
+ * m_type: SYS_KILL
*
* The parameters for this kernel call are:
- * m2_i1: SYS_SIG_ENDPT # process to signal/ pending
- * m2_i2: SYS_SIG_NUMBER # signal number to send to process
+ * m_sigcalls.endpt # process to signal/ pending
+ * m_sigcalls.sig # signal number to send to process
*/
#include "kernel/system.h"
* translated into an IPC message for system services.
*/
proc_nr_t proc_nr, proc_nr_e;
- int sig_nr = m_ptr->SYS_SIG_NUMBER;
+ int sig_nr = m_ptr->m_sigcalls.sig;
- proc_nr_e= (proc_nr_t) m_ptr->SYS_SIG_ENDPT;
+ proc_nr_e = (proc_nr_t)m_ptr->m_sigcalls.endpt;
if (!isokendpt(proc_nr_e, &proc_nr)) return(EINVAL);
if (sig_nr >= _NSIG) return(EINVAL);
/* The kernel call that is implemented in this file:
- * m_type: SYS_SIGRETURN
+ * m_type: SYS_SIGRETURN
*
* The parameters for this kernel call are:
- * m2_i1: SIG_ENDPT # process returning from handler
- * m2_p1: SIG_CTXT_PTR # pointer to sigcontext structure
+ * m_sigcalls.endp # process returning from handler
+ * m_sigcalls.sigctx # pointer to sigcontext structure
*
*/
register struct proc *rp;
int proc_nr, r;
- if (! isokendpt(m_ptr->SYS_SIG_ENDPT, &proc_nr)) return(EINVAL);
- if (iskerneln(proc_nr)) return(EPERM);
+ if (!isokendpt(m_ptr->m_sigcalls.endpt, &proc_nr)) return EINVAL;
+ if (iskerneln(proc_nr)) return EPERM;
rp = proc_addr(proc_nr);
/* Copy in the sigcontext structure. */
- if((r=data_copy(m_ptr->SYS_SIG_ENDPT, (vir_bytes) m_ptr->SYS_SIG_CTXT_PTR,
- KERNEL, (vir_bytes) &sc, sizeof(struct sigcontext))) != OK)
+ if ((r = data_copy(m_ptr->m_sigcalls.endpt,
+ (vir_bytes)m_ptr->m_sigcalls.sigctx, KERNEL,
+ (vir_bytes)&sc, sizeof(struct sigcontext))) != OK)
return r;
#if defined(__i386__)
/* Restore the registers. */
arch_proc_setcontext(rp, &sc.sc_regs, 1, sc.trap_style);
#if defined(__i386__)
- if(sc.sc_flags & MF_FPU_INITIALIZED)
+ if (sc.sc_flags & MF_FPU_INITIALIZED)
{
memcpy(rp->p_seg.fpu_state, &sc.sc_fpu_state, FPU_XFP_SIZE);
rp->p_misc_flags |= MF_FPU_INITIALIZED; /* Restore math usage flag. */
}
#endif
- return(OK);
+ return OK;
}
#endif /* USE_SIGRETURN */
/* The kernel call that is implemented in this file:
- * m_type: SYS_SIGSEND
+ * m_type: SYS_SIGSEND
*
* The parameters for this kernel call are:
- * m2_i1: SYS_SIG_ENDPT # process to call signal handler
- * m2_p1: SYS_SIG_CTXT_PTR # pointer to sigcontext structure
- * m2_i3: SYS_SIG_FLAGS # flags for S_SIGRETURN call
+ * m_sigcalls.endpt # process to call signal handler
+ * m_sigcalls.sigctx # pointer to sigcontext structure
*
*/
struct sigframe fr, *frp;
int proc_nr, r;
- if (!isokendpt(m_ptr->SYS_SIG_ENDPT, &proc_nr)) return(EINVAL);
- if (iskerneln(proc_nr)) return(EPERM);
+ if (!isokendpt(m_ptr->m_sigcalls.endpt, &proc_nr)) return EINVAL;
+ if (iskerneln(proc_nr)) return EPERM;
rp = proc_addr(proc_nr);
/* Get the sigmsg structure into our address space. */
- if((r=data_copy_vmcheck(caller, caller->p_endpoint,
- (vir_bytes) m_ptr->SYS_SIG_CTXT_PTR, KERNEL, (vir_bytes) &smsg,
- (phys_bytes) sizeof(struct sigmsg))) != OK)
+ if ((r = data_copy_vmcheck(caller, caller->p_endpoint,
+ (vir_bytes)m_ptr->m_sigcalls.sigctx, KERNEL,
+ (vir_bytes)&smsg, (phys_bytes) sizeof(struct sigmsg))) != OK)
return r;
/* Compute the user stack pointer where sigcontext will be stored. */
#if defined(__i386__)
sc.trap_style = rp->p_seg.p_kern_trap_style;
- if(sc.trap_style == KTS_NONE) {
+ if (sc.trap_style == KTS_NONE) {
printf("do_sigsend: sigsend an unsaved process\n");
return EINVAL;
}
- if(proc_used_fpu(rp)) {
+ if (proc_used_fpu(rp)) {
/* save the FPU context before saving it to the sig context */
save_fpu(rp);
memcpy(&sc.sc_fpu_state, rp->p_seg.fpu_state, FPU_XFP_SIZE);
sc.sc_flags = rp->p_misc_flags & MF_FPU_INITIALIZED;
/* Copy the sigcontext structure to the user's stack. */
- if((r=data_copy_vmcheck(caller, KERNEL, (vir_bytes) &sc, m_ptr->SYS_SIG_ENDPT,
- (vir_bytes) scp, (vir_bytes) sizeof(struct sigcontext))) != OK)
+ if ((r = data_copy_vmcheck(caller, KERNEL, (vir_bytes)&sc,
+ m_ptr->m_sigcalls.endpt, (vir_bytes)scp,
+ (vir_bytes)sizeof(struct sigcontext))) != OK)
return r;
/* Initialize the sigframe structure. */
#endif
/* Copy the sigframe structure to the user's stack. */
- if((r=data_copy_vmcheck(caller, KERNEL, (vir_bytes) &fr,
- m_ptr->SYS_SIG_ENDPT, (vir_bytes) frp,
- (vir_bytes) sizeof(struct sigframe))) != OK)
+ if ((r = data_copy_vmcheck(caller, KERNEL, (vir_bytes)&fr,
+ m_ptr->m_sigcalls.endpt, (vir_bytes)frp,
+ (vir_bytes)sizeof(struct sigframe))) != OK)
return r;
/* Reset user registers to execute the signal handler. */
proc_stacktrace(caller);
}
- return(OK);
+ return OK;
}
#endif /* USE_SIGSEND */
message m;
int result;
- m.SYS_SIG_ENDPT = proc_ep;
+ m.m_sigcalls.endpt = proc_ep;
result = _kernel_call(SYS_ENDKSIG, &m);
return(result);
}
int result;
result = _kernel_call(SYS_GETKSIG, &m);
- *proc_ep = m.SYS_SIG_ENDPT;
- *k_sig_map = m.SYS_SIG_MAP;
+ *proc_ep = m.m_sigcalls.endpt;
+ *k_sig_map = m.m_sigcalls.map;
return(result);
}
/* A proc_ep has to be signaled via PM. Tell the kernel. */
message m;
- m.SYS_SIG_ENDPT = proc_ep;
- m.SYS_SIG_NUMBER = signr;
+ m.m_sigcalls.endpt = proc_ep;
+ m.m_sigcalls.sig = signr;
return(_kernel_call(SYS_KILL, &m));
}
message m;
int result;
- m.SYS_SIG_ENDPT = proc_ep;
- m.SYS_SIG_CTXT_PTR = (char *) sig_ctxt;
+ m.m_sigcalls.endpt = proc_ep;
+ m.m_sigcalls.sigctx = sig_ctxt;
result = _kernel_call(SYS_SIGRETURN, &m);
return(result);
}
message m;
int result;
- m.SYS_SIG_ENDPT = proc_ep;
- m.SYS_SIG_CTXT_PTR = (char *) sig_ctxt;
+ m.m_sigcalls.endpt = proc_ep;
+ m.m_sigcalls.sigctx = sig_ctxt;
result = _kernel_call(SYS_SIGSEND, &m);
return(result);
}