From 85338755c1bcc98b2fdaeba1d666c038c7443875 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Fri, 12 Jul 2013 14:24:52 +0000 Subject: [PATCH] Prefix the alias macros for members of struct __mcontext with an underscore in order to avoid a clash in the net80211 code. --- lib/libc/sparc64/gen/makecontext.c | 10 ++--- lib/libc/sparc64/gen/signalcontext.c | 6 +-- lib/libthread_db/arch/sparc64/libpthread_md.c | 12 +++--- sys/sparc64/include/ucontext.h | 22 +++++----- sys/sparc64/sparc64/machdep.c | 40 +++++++++---------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/lib/libc/sparc64/gen/makecontext.c b/lib/libc/sparc64/gen/makecontext.c index 95795de992cf..42bcc8803060 100644 --- a/lib/libc/sparc64/gen/makecontext.c +++ b/lib/libc/sparc64/gen/makecontext.c @@ -54,12 +54,12 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) mc = &ucp->uc_mcontext; if (ucp == NULL || - (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) + (mc->_mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) return; if ((argc < 0) || (argc > 6) || (ucp->uc_stack.ss_sp == NULL) || (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { - mc->mc_flags = 0; + mc->_mc_flags = 0; return; } mc = &ucp->uc_mcontext; @@ -71,8 +71,8 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) mc->mc_global[1] = (uint64_t)start; mc->mc_global[2] = (uint64_t)ucp; mc->mc_out[6] = sp - SPOFF - sizeof(struct frame); - mc->mc_tnpc = (uint64_t)_ctx_start + 4; - mc->mc_tpc = (uint64_t)_ctx_start; + mc->_mc_tnpc = (uint64_t)_ctx_start + 4; + mc->_mc_tpc = (uint64_t)_ctx_start; } void @@ -82,7 +82,7 @@ _ctx_done(ucontext_t *ucp) if (ucp->uc_link == NULL) exit(0); else { - ucp->uc_mcontext.mc_flags = 0; + ucp->uc_mcontext._mc_flags = 0; setcontext((const ucontext_t *)ucp->uc_link); abort(); } diff --git a/lib/libc/sparc64/gen/signalcontext.c b/lib/libc/sparc64/gen/signalcontext.c index 622f36f5bd75..159184513807 100644 --- a/lib/libc/sparc64/gen/signalcontext.c +++ b/lib/libc/sparc64/gen/signalcontext.c @@ -52,7 +52,7 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) mcontext_t *mc; mc = &ucp->uc_mcontext; - sfp = (struct sigframe *)(mc->mc_sp + SPOFF) - 1; + sfp = (struct sigframe *)(mc->_mc_sp + SPOFF) - 1; fp = (struct frame *)sfp - 1; bzero(fp, sizeof(*fp)); @@ -67,8 +67,8 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) mc->mc_out[1] = (uint64_t)&sfp->sf_si; mc->mc_out[2] = (uint64_t)&sfp->sf_uc; mc->mc_out[6] = (uint64_t)fp - SPOFF; - mc->mc_tnpc = (uint64_t)_ctx_start + 4; - mc->mc_tpc = (uint64_t)_ctx_start; + mc->_mc_tnpc = (uint64_t)_ctx_start + 4; + mc->_mc_tpc = (uint64_t)_ctx_start; ucp->uc_link = &sfp->sf_uc; sigdelset(&ucp->uc_sigmask, sig); diff --git a/lib/libthread_db/arch/sparc64/libpthread_md.c b/lib/libthread_db/arch/sparc64/libpthread_md.c index 6a84518fa479..ffa67e9fde48 100644 --- a/lib/libthread_db/arch/sparc64/libpthread_md.c +++ b/lib/libthread_db/arch/sparc64/libpthread_md.c @@ -57,9 +57,9 @@ pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp), sizeof(r->fr_regs))); - mc->mc_fsr = r->fr_fsr; - mc->mc_gsr = r->fr_gsr; - mc->mc_fprs |= FPRS_FEF; + mc->_mc_fsr = r->fr_fsr; + mc->_mc_gsr = r->fr_gsr; + mc->_mc_fprs |= FPRS_FEF; } void @@ -67,11 +67,11 @@ pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { const mcontext_t *mc = &uc->uc_mcontext; - if ((mc->mc_fprs & FPRS_FEF) != 0) { + if ((mc->_mc_fprs & FPRS_FEF) != 0) { memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp), sizeof(r->fr_regs))); - r->fr_fsr = mc->mc_fsr; - r->fr_gsr = mc->mc_gsr; + r->fr_fsr = mc->_mc_fsr; + r->fr_gsr = mc->_mc_gsr; } else memset(r, 0, sizeof(*r)); } diff --git a/sys/sparc64/include/ucontext.h b/sys/sparc64/include/ucontext.h index c05ec26a9053..1c907fef9e6d 100644 --- a/sys/sparc64/include/ucontext.h +++ b/sys/sparc64/include/ucontext.h @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -42,16 +42,16 @@ struct __mcontext { typedef struct __mcontext mcontext_t; -#define mc_flags mc_global[0] -#define mc_sp mc_out[6] -#define mc_fprs mc_local[0] -#define mc_fsr mc_local[1] -#define mc_gsr mc_local[2] -#define mc_tnpc mc_in[0] -#define mc_tpc mc_in[1] -#define mc_tstate mc_in[2] -#define mc_y mc_in[4] -#define mc_wstate mc_in[5] +#define _mc_flags mc_global[0] +#define _mc_sp mc_out[6] +#define _mc_fprs mc_local[0] +#define _mc_fsr mc_local[1] +#define _mc_gsr mc_local[2] +#define _mc_tnpc mc_in[0] +#define _mc_tpc mc_in[1] +#define _mc_tstate mc_in[2] +#define _mc_y mc_in[4] +#define _mc_wstate mc_in[5] #define _MC_VERSION_SHIFT 0 #define _MC_VERSION_BITS 32 diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 00ae00fb7b30..de645da0b1ed 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -736,7 +736,7 @@ sys_sigreturn(struct thread *td, struct sigreturn_args *uap) kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", - td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); + td, mc->_mc_tpc, mc->_mc_sp, mc->_mc_tstate); return (EJUSTRETURN); } @@ -769,7 +769,7 @@ get_mcontext(struct thread *td, mcontext_t *mc, int flags) * Note that we skip %g7 which is used as the userland TLS register * and %wstate. */ - mc->mc_flags = _MC_VERSION; + mc->_mc_flags = _MC_VERSION; mc->mc_global[1] = tf->tf_global[1]; mc->mc_global[2] = tf->tf_global[2]; mc->mc_global[3] = tf->tf_global[3]; @@ -789,13 +789,13 @@ get_mcontext(struct thread *td, mcontext_t *mc, int flags) mc->mc_out[5] = tf->tf_out[5]; mc->mc_out[6] = tf->tf_out[6]; mc->mc_out[7] = tf->tf_out[7]; - mc->mc_fprs = tf->tf_fprs; - mc->mc_fsr = tf->tf_fsr; - mc->mc_gsr = tf->tf_gsr; - mc->mc_tnpc = tf->tf_tnpc; - mc->mc_tpc = tf->tf_tpc; - mc->mc_tstate = tf->tf_tstate; - mc->mc_y = tf->tf_y; + mc->_mc_fprs = tf->tf_fprs; + mc->_mc_fsr = tf->tf_fsr; + mc->_mc_gsr = tf->tf_gsr; + mc->_mc_tnpc = tf->tf_tnpc; + mc->_mc_tpc = tf->tf_tpc; + mc->_mc_tstate = tf->tf_tstate; + mc->_mc_y = tf->tf_y; critical_enter(); if ((tf->tf_fprs & FPRS_FEF) != 0) { savefpctx(pcb->pcb_ufp); @@ -804,7 +804,7 @@ get_mcontext(struct thread *td, mcontext_t *mc, int flags) } if ((pcb->pcb_flags & PCB_FEF) != 0) { bcopy(pcb->pcb_ufp, mc->mc_fp, sizeof(mc->mc_fp)); - mc->mc_fprs |= FPRS_FEF; + mc->_mc_fprs |= FPRS_FEF; } critical_exit(); return (0); @@ -816,8 +816,8 @@ set_mcontext(struct thread *td, const mcontext_t *mc) struct trapframe *tf; struct pcb *pcb; - if (!TSTATE_SECURE(mc->mc_tstate) || - (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) + if (!TSTATE_SECURE(mc->_mc_tstate) || + (mc->_mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION) return (EINVAL); tf = td->td_frame; pcb = td->td_pcb; @@ -843,14 +843,14 @@ set_mcontext(struct thread *td, const mcontext_t *mc) tf->tf_out[5] = mc->mc_out[5]; tf->tf_out[6] = mc->mc_out[6]; tf->tf_out[7] = mc->mc_out[7]; - tf->tf_fprs = mc->mc_fprs; - tf->tf_fsr = mc->mc_fsr; - tf->tf_gsr = mc->mc_gsr; - tf->tf_tnpc = mc->mc_tnpc; - tf->tf_tpc = mc->mc_tpc; - tf->tf_tstate = mc->mc_tstate; - tf->tf_y = mc->mc_y; - if ((mc->mc_fprs & FPRS_FEF) != 0) { + tf->tf_fprs = mc->_mc_fprs; + tf->tf_fsr = mc->_mc_fsr; + tf->tf_gsr = mc->_mc_gsr; + tf->tf_tnpc = mc->_mc_tnpc; + tf->tf_tpc = mc->_mc_tpc; + tf->tf_tstate = mc->_mc_tstate; + tf->tf_y = mc->_mc_y; + if ((mc->_mc_fprs & FPRS_FEF) != 0) { tf->tf_fprs = 0; bcopy(mc->mc_fp, pcb->pcb_ufp, sizeof(pcb->pcb_ufp)); pcb->pcb_flags |= PCB_FEF;