svn commit: r254157 - in stable/9: lib/libc/sparc64/gen lib/libthread_db/arch/sparc64 sys/sparc64/include sys/sparc64/sparc64

Marius Strobl marius at FreeBSD.org
Fri Aug 9 19:44:20 UTC 2013


Author: marius
Date: Fri Aug  9 19:44:19 2013
New Revision: 254157
URL: http://svnweb.freebsd.org/changeset/base/254157

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

Modified:
  stable/9/lib/libc/sparc64/gen/makecontext.c
  stable/9/lib/libc/sparc64/gen/signalcontext.c
  stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c
  stable/9/sys/sparc64/include/ucontext.h
  stable/9/sys/sparc64/sparc64/machdep.c
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libthread_db/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/lib/libc/sparc64/gen/makecontext.c
==============================================================================
--- stable/9/lib/libc/sparc64/gen/makecontext.c	Fri Aug  9 19:20:46 2013	(r254156)
+++ stable/9/lib/libc/sparc64/gen/makecontext.c	Fri Aug  9 19:44:19 2013	(r254157)
@@ -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: stable/9/lib/libc/sparc64/gen/signalcontext.c
==============================================================================
--- stable/9/lib/libc/sparc64/gen/signalcontext.c	Fri Aug  9 19:20:46 2013	(r254156)
+++ stable/9/lib/libc/sparc64/gen/signalcontext.c	Fri Aug  9 19:44:19 2013	(r254157)
@@ -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: stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c
==============================================================================
--- stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c	Fri Aug  9 19:20:46 2013	(r254156)
+++ stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c	Fri Aug  9 19:44:19 2013	(r254157)
@@ -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: stable/9/sys/sparc64/include/ucontext.h
==============================================================================
--- stable/9/sys/sparc64/include/ucontext.h	Fri Aug  9 19:20:46 2013	(r254156)
+++ stable/9/sys/sparc64/include/ucontext.h	Fri Aug  9 19:44:19 2013	(r254157)
@@ -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: stable/9/sys/sparc64/sparc64/machdep.c
==============================================================================
--- stable/9/sys/sparc64/sparc64/machdep.c	Fri Aug  9 19:20:46 2013	(r254156)
+++ stable/9/sys/sparc64/sparc64/machdep.c	Fri Aug  9 19:44:19 2013	(r254157)
@@ -740,7 +740,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);
 }
 
@@ -773,7 +773,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];
@@ -793,13 +793,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);
@@ -808,7 +808,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);
@@ -820,8 +820,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;
@@ -847,14 +847,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;


More information about the svn-src-stable-9 mailing list