Author: jhb Date: Wed Jan 27 17:55:01 2016 New Revision: 294930 URL: https://svnweb.freebsd.org/changeset/base/294930
Log: Convert ss_sp in stack_t and sigstack to void *. POSIX requires these members to be of type void * rather than the char * inherited from 4BSD. NetBSD and OpenBSD both changed their fields to void * back in 1998. No new build failures were reported via an exp-run. PR: 206503 (exp-run) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5092 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/vm_machdep.c head/sys/i386/i386/machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/i386/svr4/svr4_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/vm_machdep.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sys/signal.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/amd64/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -389,7 +389,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/ia32/ia32_signal.c Wed Jan 27 17:55:01 2016 (r294930) @@ -354,7 +354,7 @@ ia32_osendsig(sig_t catcher, ksiginfo_t /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct ia32_sigframe3 *)(td->td_sigstk.ss_sp + + fp = (struct ia32_sigframe3 *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(sf)); td->td_sigstk.ss_flags |= SS_ONSTACK; } else @@ -488,7 +488,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct ia32_sigframe4 *)(td->td_sigstk.ss_sp + + sfp = (struct ia32_sigframe4 *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(sf)); } else sfp = (struct ia32_sigframe4 *)regs->tf_rsp - 1; @@ -622,7 +622,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; else sp = (char *)regs->tf_rsp; if (xfpusave != NULL) { Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/linux/linux_sysvec.c Wed Jan 27 17:55:01 2016 (r294930) @@ -630,7 +630,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size - + sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe); } else sp = (caddr_t)regs->tf_rsp - sizeof(struct l_rt_sigframe) - 128; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 17:55:01 2016 (r294930) @@ -315,7 +315,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_rt_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe)); } else fp = (struct l_rt_sigframe *)regs->tf_rsp - 1; @@ -460,7 +460,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_sigframe)); } else fp = (struct l_sigframe *)regs->tf_rsp - 1; Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/arm/arm/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -296,7 +296,7 @@ sendsig(catcher, ksi, mask) /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)(td->td_sigstk.ss_sp + + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/arm64/arm64/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -527,7 +527,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)(td->td_sigstk.ss_sp + + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/arm64/arm64/vm_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -186,7 +186,7 @@ cpu_set_upcall_kse(struct thread *td, vo { struct trapframe *tf = td->td_frame; - tf->tf_sp = STACKALIGN(stack->ss_sp + stack->ss_size); + tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); tf->tf_elr = (register_t)entry; tf->tf_x[0] = (register_t)arg; } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/i386/i386/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -368,7 +368,7 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct osigframe *)(td->td_sigstk.ss_sp + + fp = (struct osigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct osigframe)); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -515,7 +515,7 @@ freebsd4_sendsig(sig_t catcher, ksiginfo /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe4 *)(td->td_sigstk.ss_sp + + sfp = (struct sigframe4 *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe4)); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -675,7 +675,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/i386/linux/linux_sysvec.c Wed Jan 27 17:55:01 2016 (r294930) @@ -451,7 +451,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_rt_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe)); } else fp = (struct l_rt_sigframe *)regs->tf_esp - 1; @@ -591,7 +591,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_sigframe)); } else fp = (struct l_sigframe *)regs->tf_esp - 1; Modified: head/sys/i386/svr4/svr4_machdep.c ============================================================================== --- head/sys/i386/svr4/svr4_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/i386/svr4/svr4_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -441,7 +441,7 @@ svr4_sendsig(catcher, ksi, mask) */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct svr4_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct svr4_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct svr4_sigframe)); td->td_sigstk.ss_flags |= SS_ONSTACK; } else { Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/mips/mips/freebsd32_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -410,7 +410,7 @@ freebsd32_sendsig(sig_t catcher, ksiginf /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe32 *)((vm_offset_t)(td->td_sigstk.ss_sp + + sfp = (struct sigframe32 *)(((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe32)) & ~(sizeof(__int64_t) - 1)); } else Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/mips/mips/pm_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -126,7 +126,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)((vm_offset_t)(td->td_sigstk.ss_sp + + sfp = (struct sigframe *)(((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe)) & ~(sizeof(__int64_t) - 1)); } else Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/mips/mips/vm_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -432,7 +432,7 @@ cpu_set_upcall_kse(struct thread *td, vo * in ``See MIPS Run'' by D. Sweetman, p. 269 * align stack */ - sp = ((register_t)(intptr_t)(stack->ss_sp + stack->ss_size) & ~0x7) - + sp = (((intptr_t)stack->ss_sp + stack->ss_size) & ~0x7) - CALLFRAME_SIZ; /* Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/powerpc/powerpc/exec_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -219,7 +219,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - usfp = (void *)(td->td_sigstk.ss_sp + + usfp = (void *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - rndfsize); } else { usfp = (void *)(tf->fixreg[1] - rndfsize); Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/sparc64/sparc64/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -646,7 +646,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)(td->td_sigstk.ss_sp + + sfp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe)); } else sfp = (struct sigframe *)sp - 1; Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/sys/signal.h Wed Jan 27 17:55:01 2016 (r294930) @@ -362,7 +362,7 @@ typedef struct sigaltstack { #else typedef struct { #endif - char *ss_sp; /* signal stack base */ + void *ss_sp; /* signal stack base */ __size_t ss_size; /* signal stack length */ int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ } stack_t; @@ -406,8 +406,7 @@ struct osigcontext { * Structure used in sigstack call. */ struct sigstack { - /* XXX ss_sp's type should be `void *'. */ - char *ss_sp; /* signal stack pointer */ + void *ss_sp; /* signal stack pointer */ int ss_onstack; /* current status */ }; #endif _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"