Author: marius
Date: Fri Jul 12 14:24:52 2013
New Revision: 253266
URL: http://svnweb.freebsd.org/changeset/base/253266

Log:
  Prefix the alias macros for members of struct __mcontext with an underscore
  in order to avoid a clash in the net80211 code.

Modified:
  head/lib/libc/sparc64/gen/makecontext.c
  head/lib/libc/sparc64/gen/signalcontext.c
  head/lib/libthread_db/arch/sparc64/libpthread_md.c
  head/sys/sparc64/include/ucontext.h
  head/sys/sparc64/sparc64/machdep.c

Modified: head/lib/libc/sparc64/gen/makecontext.c
==============================================================================
--- head/lib/libc/sparc64/gen/makecontext.c     Fri Jul 12 13:52:27 2013        
(r253265)
+++ head/lib/libc/sparc64/gen/makecontext.c     Fri Jul 12 14:24:52 2013        
(r253266)
@@ -54,12 +54,12 @@ __makecontext(ucontext_t *ucp, void (*st
 
        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 (*st
        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();
        }

Modified: head/lib/libc/sparc64/gen/signalcontext.c
==============================================================================
--- head/lib/libc/sparc64/gen/signalcontext.c   Fri Jul 12 13:52:27 2013        
(r253265)
+++ head/lib/libc/sparc64/gen/signalcontext.c   Fri Jul 12 14:24:52 2013        
(r253266)
@@ -52,7 +52,7 @@ __signalcontext(ucontext_t *ucp, int sig
        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
        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);

Modified: head/lib/libthread_db/arch/sparc64/libpthread_md.c
==============================================================================
--- head/lib/libthread_db/arch/sparc64/libpthread_md.c  Fri Jul 12 13:52:27 
2013        (r253265)
+++ head/lib/libthread_db/arch/sparc64/libpthread_md.c  Fri Jul 12 14:24:52 
2013        (r253266)
@@ -57,9 +57,9 @@ pt_fpreg_to_ucontext(const struct fpreg*
 
        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 *u
 {
        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));
 }

Modified: head/sys/sparc64/include/ucontext.h
==============================================================================
--- head/sys/sparc64/include/ucontext.h Fri Jul 12 13:52:27 2013        
(r253265)
+++ head/sys/sparc64/include/ucontext.h Fri Jul 12 14:24:52 2013        
(r253266)
@@ -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

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c  Fri Jul 12 13:52:27 2013        
(r253265)
+++ head/sys/sparc64/sparc64/machdep.c  Fri Jul 12 14:24:52 2013        
(r253266)
@@ -736,7 +736,7 @@ sys_sigreturn(struct thread *td, struct 
        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
         * 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
        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
        }
        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 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 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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to