diff options
author | Ed Maste <emaste@FreeBSD.org> | 2018-03-13 00:40:05 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2018-03-13 00:40:05 +0000 |
commit | 4ba257591b34c5acdbdce40d47c397ce181dfca2 (patch) | |
tree | 958272a4b1afc1bc9334cf410b84ed3078b11391 /sys/i386 | |
parent | 644055e74e059c26a0c25e6f1378a302d6eb02e1 (diff) | |
download | src-4ba257591b34c5acdbdce40d47c397ce181dfca2.tar.gz src-4ba257591b34c5acdbdce40d47c397ce181dfca2.zip |
Apply some style(9) to Linuxulator linux_sysvec.c comments
Notes
Notes:
svn path=/head/; revision=330823
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 104 |
1 files changed, 29 insertions, 75 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index ab5c8731d0ab..354ca1ca546b 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -88,10 +88,9 @@ SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, #endif /* - * Allow the sendsig functions to use the ldebug() facility - * even though they are not syscalls themselves. Map them - * to syscall 0. This is slightly less bogus than using - * ldebug(sigreturn). + * Allow the sendsig functions to use the ldebug() facility even though they + * are not syscalls themselves. Map them to syscall 0. This is slightly less + * bogus than using ldebug(sigreturn). */ #define LINUX_SYS_linux_rt_sendsig 0 #define LINUX_SYS_linux_sendsig 0 @@ -306,9 +305,7 @@ linux_copyout_strings(struct image_params *imgp) size_t execpath_len; struct proc *p; - /* - * Calculate string base and vector table pointers. - */ + /* Calculate string base and vector table pointers. */ p = imgp->proc; if (imgp->execpath != NULL && imgp->auxargs != NULL) execpath_len = strlen(imgp->execpath) + 1; @@ -320,9 +317,7 @@ linux_copyout_strings(struct image_params *imgp) roundup(execpath_len, sizeof(char *)) - roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); - /* - * install LINUX_PLATFORM - */ + /* Install LINUX_PLATFORM. */ copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform), linux_szplatform); @@ -332,19 +327,14 @@ linux_copyout_strings(struct image_params *imgp) copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); } - /* - * Prepare the canary for SSP. - */ + /* Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); imgp->canary = (uintptr_t)arginfo - linux_szplatform - roundup(execpath_len, sizeof(char *)) - roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ + /* If we have a valid auxargs ptr, prepare some room on the stack. */ if (imgp->auxargs) { /* * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for @@ -368,29 +358,21 @@ linux_copyout_strings(struct image_params *imgp) sizeof(char *)); } - /* - * vectp also becomes our initial stack base - */ + /* vectp also becomes our initial stack base. */ stack_base = (register_t *)vectp; stringp = imgp->args->begin_argv; argc = imgp->args->argc; envc = imgp->args->envc; - /* - * Copy out strings - arguments and environment. - */ + /* Copy out strings - arguments and environment. */ copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); - /* - * Fill in "ps_strings" struct for ps, w, etc. - */ + /* Fill in "ps_strings" struct for ps, w, etc. */ suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nargvstr, argc); - /* - * Fill in argument portion of vector table. - */ + /* Fill in argument portion of vector table. */ for (; argc > 0; --argc) { suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) @@ -398,15 +380,13 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* a null vector table pointer separates the argp's from the envp's */ + /* A null vector table pointer separates the argp's from the envp's. */ suword(vectp++, 0); suword(&arginfo->ps_envstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nenvstr, envc); - /* - * Fill in environment portion of vector table. - */ + /* Fill in environment portion of vector table. */ for (; envc > 0; --envc) { suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) @@ -414,7 +394,7 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* end of vector table is a null pointer */ + /* The end of the vector table is a null pointer. */ suword(vectp, 0); return (stack_base); @@ -444,9 +424,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) printf(ARGS(rt_sendsig, "%p, %d, %p, %u"), catcher, sig, (void*)mask, code); #endif - /* - * Allocate space for the signal handler context. - */ + /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + @@ -455,9 +433,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) fp = (struct l_rt_sigframe *)regs->tf_esp - 1; mtx_unlock(&psp->ps_mtx); - /* - * Build the argument list for the signal handler. - */ + /* Build the argument list for the signal handler. */ sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -467,12 +443,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) frame.sf_siginfo = &fp->sf_si; frame.sf_ucontext = &fp->sf_sc; - /* Fill in POSIX parts */ + /* Fill in POSIX parts. */ ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); - /* - * Build the signal context to be used by sigreturn. - */ + /* Build the signal context to be used by sigreturn. */ frame.sf_sc.uc_flags = 0; /* XXX ??? */ frame.sf_sc.uc_link = NULL; /* XXX ??? */ @@ -527,9 +501,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sigexit(td, SIGILL); } - /* - * Build context to run handler in. - */ + /* Build context to run handler in. */ regs->tf_esp = (int)fp; regs->tf_eip = linux_rt_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D); @@ -584,9 +556,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) catcher, sig, (void*)mask, code); #endif - /* - * Allocate space for the signal handler context. - */ + /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + @@ -596,9 +566,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); - /* - * Build the argument list for the signal handler. - */ + /* Build the argument list for the signal handler. */ sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -608,9 +576,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) bsd_to_linux_sigset(mask, &lmask); - /* - * Build the signal context to be used by sigreturn. - */ + /* Build the signal context to be used by sigreturn. */ frame.sf_sc.sc_mask = lmask.__mask; frame.sf_sc.sc_gs = rgs(); frame.sf_sc.sc_fs = regs->tf_fs; @@ -644,9 +610,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sigexit(td, SIGILL); } - /* - * Build context to run handler in. - */ + /* Build context to run handler in. */ regs->tf_esp = (int)fp; regs->tf_eip = linux_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D); @@ -693,9 +657,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) if (copyin(args->sfp, &frame, sizeof(frame)) != 0) return (EFAULT); - /* - * Check for security violations. - */ + /* Check for security violations. */ #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = frame.sf_sc.sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_eflags)) @@ -721,9 +683,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) linux_to_bsd_sigset(&lmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); - /* - * Restore signal context. - */ + /* Restore signal context. */ /* %gs was restored by the trampoline. */ regs->tf_fs = frame.sf_sc.sc_fs; regs->tf_es = frame.sf_sc.sc_es; @@ -782,9 +742,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) context = &uc.uc_mcontext; - /* - * Check for security violations. - */ + /* Check for security violations. */ #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = context->sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_eflags)) @@ -809,9 +767,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); - /* - * Restore signal context - */ + /* Restore signal context. */ /* %gs was restored by the trampoline. */ regs->tf_fs = context->sc_fs; regs->tf_es = context->sc_es; @@ -829,9 +785,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) regs->tf_esp = context->sc_esp_at_signal; regs->tf_ss = context->sc_ss; - /* - * call sigaltstack & ignore results.. - */ + /* Call sigaltstack & ignore results. */ lss = &uc.uc_stack; ss.ss_sp = lss->ss_sp; ss.ss_size = lss->ss_size; @@ -928,7 +882,7 @@ exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack) exec_setregs(td, imgp, stack); - /* Linux sets %gs to 0, we default to _udatasel */ + /* Linux sets %gs to 0, we default to _udatasel. */ pcb->pcb_gs = 0; load_gs(0); |