Removing SYS_SIG_* field macros.

Change-Id: Ib4f1b48268d4539ae6d4502ad647ecb73ea87f79
This commit is contained in:
Lionel Sambuc 2013-11-28 19:22:37 +01:00
parent 301f5f87f0
commit 94c9376df5
12 changed files with 61 additions and 70 deletions

View file

@ -470,14 +470,6 @@
#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 */

View file

@ -35,17 +35,6 @@ typedef struct {
} 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;
@ -135,6 +124,16 @@ typedef struct {
} 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;
@ -186,10 +185,10 @@ typedef struct {
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);

View file

@ -2,7 +2,7 @@
* 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"
@ -24,7 +24,7 @@ int do_endksig(struct proc * caller, message * m_ptr)
/* 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);

View file

@ -2,8 +2,8 @@
* 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"
@ -28,8 +28,8 @@ int do_getksig(struct proc * caller, message * m_ptr)
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);
@ -37,8 +37,7 @@ int do_getksig(struct proc * caller, message * m_ptr)
}
/* No process with pending signals was found. */
m_ptr->SYS_SIG_ENDPT = NONE;
m_ptr->m_sigcalls.endpt = NONE;
return(OK);
}
#endif /* USE_GETKSIG */

View file

@ -2,8 +2,8 @@
* 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"
@ -23,9 +23,9 @@ int do_kill(struct proc * caller, message * m_ptr)
* 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);

View file

@ -2,8 +2,8 @@
* 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
*
*/
@ -25,13 +25,14 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
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__)
@ -62,7 +63,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
}
#endif
return(OK);
return OK;
}
#endif /* USE_SIGRETURN */

View file

@ -2,9 +2,8 @@
* 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
*
*/
@ -27,14 +26,14 @@ int do_sigsend(struct proc * caller, message * m_ptr)
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)
(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. */
@ -64,8 +63,9 @@ int do_sigsend(struct proc * caller, message * m_ptr)
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. */
@ -97,7 +97,7 @@ int do_sigsend(struct proc * caller, message * m_ptr)
/* 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,
m_ptr->m_sigcalls.endpt, (vir_bytes)frp,
(vir_bytes)sizeof(struct sigframe))) != OK)
return r;
@ -114,7 +114,7 @@ int do_sigsend(struct proc * caller, message * m_ptr)
proc_stacktrace(caller);
}
return(OK);
return OK;
}
#endif /* USE_SIGSEND */

View file

@ -9,7 +9,7 @@ endpoint_t proc_ep; /* process number */
message m;
int result;
m.SYS_SIG_ENDPT = proc_ep;
m.m_sigcalls.endpt = proc_ep;
result = _kernel_call(SYS_ENDKSIG, &m);
return(result);
}

View file

@ -11,8 +11,8 @@ sigset_t *k_sig_map; /* return signal map here */
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);
}

View file

@ -7,8 +7,8 @@ int signr; /* signal number: 1 - 16 */
/* 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));
}

View file

@ -10,8 +10,8 @@ struct sigmsg *sig_ctxt; /* POSIX style handling */
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);
}

View file

@ -10,8 +10,8 @@ struct sigmsg *sig_ctxt; /* POSIX style handling */
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);
}