On Mon, Mar 21, 2022 at 08:24:05PM +0000, Miod Vallat wrote:
> Two simple changes here:
> - dumpframe() is not used by anything. I opted to remove it, but it
> could be wrapped in #if 0 or #ifdef DEBUG if people want to keep it
> around.
> - the /* NOTREACHED */ comment in sendsig() is obviously reachable, so
> remove it and update the comment to match the new world order.
>
> Completely untested (see a trend there?)
ok jsg@
>
> Index: sig_machdep.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/arch/riscv64/riscv64/sig_machdep.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 sig_machdep.c
> --- sig_machdep.c 6 Oct 2021 15:46:03 -0000 1.9
> +++ sig_machdep.c 21 Mar 2022 20:21:57 -0000
> @@ -84,24 +84,6 @@ process_frame(struct proc *p)
> return p->p_addr->u_pcb.pcb_tf;
> }
>
> -void dumpframe (char *msg, struct trapframe *tf, void *p)
> -{
> - int i;
> - printf("%s\n",msg);
> - printf("pc %lx ra %lx sp %lx tp %lx\n", tf->tf_sepc, tf->tf_ra,
> tf->tf_sp, tf->tf_tp);
> - for(i = 0; i < 7; i++)
> - printf("%st%d %lx", (i==0)?"":", ", i, tf->tf_t[i]);
> - printf("\n");
> - for(i = 0; i < 12; i++)
> - printf("%ss%d %lx", (i==0)?"":", ", i, tf->tf_s[i]);
> - printf("\n");
> - for(i = 0; i < 8; i++)
> - printf("%sa%d %lx", (i==0)?"":", ", i, tf->tf_a[i]);
> - printf("\n");
> - if (p != NULL)
> - printf("fp %p\n", p);
> -}
> -
> /*
> * Send an interrupt to process.
> *
> @@ -176,10 +158,10 @@ sendsig(sig_t catcher, int sig, sigset_t
> frame.sf_sc.sc_cookie = (long)&fp->sf_sc ^ p->p_p->ps_sigcookie;
> if (copyout(&frame, fp, sizeof(frame)) != 0) {
> /*
> - * Process has trashed its stack; give it an illegal
> - * instruction to halt it in its tracks.
> + * Process has trashed its stack; alert caller which
> + * will give it an illegal instruction to halt it in
> + * its tracks.
> */
> - /* NOTREACHED */
> return 1;
> }
>
>
>